horizontal line 

Newsgroups: comp.text.tex
>might sb tell me how to draw a horizontal line outside a table, i.e. not with
>the command \hline.
\hrule

William

horizontal line 

Also take a look at \rule, which lets you draw a filled rectangle of a given width and height. (A horizontal line is merely a very short rectangle.)

Scott

\bf or \textbf 

> All the books I read (quite limited though :->) use \textbf for
> bolding, but I also see people use \bf. So can somebody shed some
> light on this topic? like where \bf is defined?, are they
> interchangeable?, etc.

\bf was borrowed from plain TeX and is now obsolete in LaTeX2e and should not be used.

is very long, in which case {bfseries stuff} is better because TeX won't fill up your memory looking for the } of the argument.

Peter

\bf or \textbf 

\textbf (or \bfseries) is the right way to select bold in LaTeX2e (see fntguide.dvi for more information on fonts). As for the differences, try

\textbf{\textit{test}}

vs.

\bf{\it{test}}

Stefan Ulrich

\bf or \textbf 

> \bf was borrowed from plain TeX and is now obsolete in
> LaTeX2e and should not be used.

The reasons behind this are to do with the NFSS (New Font[1] Selection Scheme) which gets round problems that \bf had. \bfseries and \textbf{} work more smoothly - they actually switch you to the bold version of the current fount, which is what the average user usually wants. \bf doesn't. I can't remember exactly what it does (and Lamport's 1st edition LaTeX book appears to not provide the details), but I do recall it being a pain in the bum.

> The recommended syntax is \textbf{stuff} unless the stuff
> is very long, in which case {\bfseries stuff} is better
> because TeX won't fill up your memory looking for the }
> of the argument.

More or less. {bfseries …} also works a bit more quickly and therefore has two reasons to be preferred by class and package writers who don't have to ensure that their class and package files are easily comprehensible (and in the case of the LaTeX team itself, seem to delight in writing the most incomprehensible code possible - or maybe I'm just stupid. Or maybe both).

In Lamport's 1st edition LaTeX book, the recommended procedure is to not use such commands at all in body text, but to define commands that describe structural information and use the type style commands inside them. For example, the \url{} command provided by the url package switches to \ttfamily by default when typesetting a url.

I often define commands describing structure that do nothing but select a different type style. Something like:

\newcommand{\realperson}[1]{{\textbf #1}}
\newcommand{\fictionalperson}[1]{{\textit #1}}

It has the advantage that I can leave thinking about *which* type style is the most appropriate for *that* document element until after I've written the bloody thing and seen how it looks on paper. On top of that, when I come back to the document years later and want to re-use text, I can change type style to match whatever I want to use the text for with a single easy-to-apply change for each logical element rather than having to read the entire document, figure out what the hell I was on at the time, and then manually change each instance of type styling to suit the new document.

I've written package documentation that uses similar commands for elements like documentclass name, package name, file name, and so on. Many of these elements end up being typeset identically - but if I ever change my mind, I can change the style of a single kind of element with a single change and almost no effort.

Rowland.

Table of Contents 

*Tags*: TOC

A table of contents is produced with the \tableofcontents command. You put the command right where you want the table of contents to go; LaTeX does the rest for you. Entries are taken from the Sectioning commands.

\tableofcontents produces a heading, but it does not automatically start a new page. If you want a new page after the table of contents, include a \newpage command after the \tableofcontents command.

How do I disable hyphenation completely ? 

Newsgroups: comp.text.tex
Date: 1996/07/02

set a minimum length of word to hyphenate (64 is treated as infinite):

\lefthyphenmin=64

Or, if you are switching languages with babel or using ancient TeX 2.xx:

\hyphenpenalty=10000

Donald Arseneau

How do I disable hyphenation completely ? 

>How do I disable hyphenation completely.  I have tried the \sloppy
>command, which reduces the number of word divisions, but does not
>switch it off completely.

Mike Piff <M.Piff@shef.ac.uk> replied:

> \pretolerance=10000
> TeX should then never get to its hyphenation pass.

dak@neuroinformatik.ruhr-uni-bochum.de (David Kastrup) said:

>\language=-1

Unfortunately, neither of these really works. TeX will do a hyphenation pass regardless of the value in \pretolerance (\maxdimen even) in order to avoid a 10000-badness underfull line. Thus, just like \sloppy, it reduces but does not eliminate hyphenation. You might say that falling back to hyphenation is better than giving overfull lines, but this ignores the effect of \emergencystretch, which would prevent overfull lines. Even if \pretolerance=10000 prevented the hyphenation pass, working the same as \tolerance=10000, this would waste the benefit of the emergencypass.

\language=-1 doesn't work at all because TeX only accepts \languages from 0 to 15; it treats invalid settings as language 0. Language 0 is usually American English! You must use another number; 15 is probably safe, but it is best to allocate a new language without any hyphenation patterns:

\newlanguage\nohyphens
\language=\nohyphens

Other methods are to set a minimum length of word to hyphenate (64 is treated as infinite):

\lefhyphenmin=64

Or, if you are switching languages with babel or using ancient TeX 2.xx:

\hyphenpenalty=10000

Note that \sloppy (with a substantial \emergencystretch) is imperitive for typesetting without hyphenation. I also strongly recommend \raggedright, which pretty much suppresses hyphens all by itself.

Donald Arseneau

How do I disable hyphenation completely ? 

:   \hyphenpenalty=10000
..and additionally set \exhyphenpenalty=1000, if you want to suppress

hyphenation points at explizit hyphens, too.

Bernd Raichle

No hyphenation? 

Newsgroups: comp.text.tex
Date: 1996/09/07
|Having a paranoid dislike of hyphenation, I was wondering if there's
|any way I can turn off *all* hyphenation in my LaTeX?

No hyphenation? 

Hyphenation should be suppressed by using a language with no patterns, setting \lefthyphenmin>=64, or \hyphenpenalty>=10000 (\hyphenchar=-1 works on a font-by-font basis). However, setting a good pretolerance should help in optimizing performance. I'm not sure whether it is better to use -1 to suppress the first pass or \tolerance to avoid the second pass (and attempted hyphenation) whenever possible.

(I seem to be a real spoil-sport tonight.)

Donald Arseneau

No hyphenation? 

|Having a paranoid dislike of hyphenation, I was wondering if there's
|any way I can turn off *all* hyphenation in my LaTeX?

FAQ.

  1. set the language to a non-existing one. As the language has no hyphenation rules, no hyphenation will be done.

  2. set the minimum right/left part of hyphenated words to 64. TeX won't be able to hyphenate at all.

  3. set the value of \hyphenchar to -1. Perhaps it is better to set the \defaulthyphenchar to -1 as well.

Of those three, the third is what TeX wants us to do.

Dr Yoshimasa Tsuji

No hyphenation? 

% FYI, \hyphenchar\font=-1 is so far the simplest way to disable % hyphenations (I already mentioned it).

I hate to jump into this debate, but this is a {it ridiculous} statement. For instance, if I were to follow your advice, there's a chance this paragraph would have a hyphen in it.

Setting a high pretolerance works in most but not all circumstances. Setting hyphenchar to -1 works always, but you have to do it for every font you have loaded, at every size. This is not simple.

Setting \lefthyphenmin to 64 works always, provided you're using a TeX less than seven years old. Switching to a language without hyphenation patterns works always (with the same proviso). These are both simple.

Patrick TJ McPhee

Use brace in command definition 

Newsgroups:  comp.text.tex
Date:        05 Feb 2004 21:55:13 -0800
> Is it possible to use braces in command definition?

Yes, but not the way you tried.

> For example, instead of "This is \textbf{boldface}. "
> Then "This is \ob boldface \cb. "
\def\ob#1\cb{\textbf{#1}}

Donald Arseneau

Use brace in command definition 

> > Can I define:
> >
> > \newcommand{\ob}{\textbf\{}
> > \newcommand{\cb}{\}}
>
> You can use \bgroup and \egroup; in your example
>
> \newcommand{\ob}{\textbf\bgroup}
> \newcommand{\cb}{\egroup}

Did you try this? :-)

You could write

\newcommand{\ob}{\bgroup\bf}

with the plain TeX \bf, but \textbf takes an argument, thus you need _explicit_ braces (neither { nor \bgroup)! (But you can let \ob take an argument delimited by \cb, as Donald already suggested.

Peter

Use brace in command definition 

> \def\ob#1\cb{\textbf{#1}}

\ob A brace looks like \verb+{+ \eb

My solution (see separate post) does not fall apart in such cases.

David Kastrup

Use brace in command definition 

> Can I define:
>
> \newcommand{\ob}{\textbf\{}
> \newcommand{\cb}{\}}
>
> Then "This is \ob boldface \cb. "
\newcommand{\ob}{\expandafter\textbf\expandafter{\iffalse}\fi}
\newcommand{\cb}{\iffalse{\fi}}

A pity this does not work since \textbf is a macro all by itself. So you rather want to use \bfseries instead of \textbf.

David Kastrup

Use brace in command definition 

How about paragraphs in parameter?

\def\tb#1\te{%
\begin{tabular}{ll}
paragraph & \parbox[t]{0.8\linewidth}{#1}
\end{tabular}
}
\tb
    The content here are
    Indented.
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
\te
Tip !!

Runaway argument? The content here are Indented. blah blah blah blah blah blah blah bla\ETC. ! Paragraph ended before \tb was complete. <to be read again> \par l.41

I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.

! Undefined control sequence. l.42 \te

Tip !!

This works:

\newcommand{\tb}{
\begin{tabular}{ll}
paragraph & \parbox[t]{0.8\linewidth}
}
\newcommand{\te}{\end{tabular}}
\tb{
    The content here are
    Indented.
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
}\te

documented on: 2004.02.06 Fri

interesting LaTeX question 

Newsgroups: comp.text.tex
Date: 1996/10/15
> include the current date in the document body, i.e. any paragraph
> withing the document body? I thought about the \date command but it
> works only in the title page.

Use \today , it inserts the date in the format October 14th, 1996.

Paul Branston.

Getting current date as 8/11/93, not August 11, 1993 

Newsgroups: comp.text.tex
Date: 1993-08-11 15:03:41 PST
> We've got a LaTeX file that prints the date using \today on the header
> of each page, and the header's getting kinda crowded.  Since we figure
> that "8/11/93" takes up less space than "August 11, 1993", we'd like
> to change the date format to MM/DD/YY.
>
> I've researched the \date and \today commands as far as my manuals will
> allow (which isn't far at all), and I couldn't find anything that allowed
> you to switch formats without supplying the date yourself (as per \date).
> Is there any way to get \today's information in MM/DD/YY format?

The real manual is the source :-) so look for the definition of \today in e.g. article.sty and redefine \today as something like

\def\today{\number\month/\number\day/\number\year}

(But you'll get dates like 1/1/94 without leading zeroes, so perhaps you will have to do a bit of refinement …)

Reinhard Zierke

Change format of \today's date? 

Newsgroups: comp.text.tex
Date: 1997/01/27
>Is there a way to make \today yield "27 January 1997"
>instead of "January 27, 1997"?

Just get the definition of \today from article.cls (or wherever) and permute it, eg

\documentclass[12pt,a4paper]{article}
\edef\today{\number\day\space
  \ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi,
  \number\year}
\begin{document}
\today
\end{document}

Timothy Murphy

Unusual Paragraph Indent 

http://groups.google.com/group/comp.text.tex/browse_frm/thread/df56a2d5699a46d4/d4b1bb71fa7cb9df

Newsgroups: comp.text.tex
Date: 1995/05/26

I'm trying to get an unusual paragraph indentation as follows. The first line in the paragraph is flush with the left margin but the subsequent lines are slightly indented. Apart from the first line, both sides are justified. Here is an example:

The first line of the paragraph is  longer
  than the second and the third and indeed
  all the subsequent ones.  This continues
  up to the end of the paragraph where the
  whole process starts again.

The only way I though of doing this is to define the following environment:

\newenvironment{reference}%
  {\begin{list}{}{%
    \setlength{\leftmargin}{0.5cm}%
    \setlength{\listparindent}{0cm}%
    \setlength{\itemindent}{0cm}%
    \setlength{\labelwidth}{0.5 cm}%
    \setlength{\itemsep}{0cm}%
    \setlength{\parsep}{0cm}%
    \setlength{\labelsep}{0cm}}}
  {\end{list}}

This seems clumsy as I have to do the following:

\begin{reference}
\item [First] word of first paragraph.
\item [Second] paragraph.
\item [Last] paragraph.
\end{reference}

Also, If an item starts with a very short word, it will leave a gap between it and the rest of the sentence.

I think that using a list is the wrong way to do this. Anybody got any better ideas?

Unusual Paragraph Indent 

> first line in the paragraph is flush with the left margin but the
> subsequent lines are slightly indented.
> I think that using a list is the wrong way to do this.  Anybody got
> any better ideas?

No, a list is the right way to do it, but not by using items, but just modifying the formatting of the paragraphs. Try the following. It works for me.

\newenvironment{outdent}%
{\begin{list}{}%
{\listparindent=-1.5em\itemindent=\listparindent\leftmargin=1.5em}%
\item[]}%
{\end{list}}

Use it as follows:

\begin{outdent}
first paragraph first paragraph first paragraph first paragraph first
paragraph first paragraph first paragraph first paragraph first paragraph
first paragraph

second paragraph second paragraph second paragraph second paragraph second
paragraph second paragraph second paragraph second paragraph second
paragraph second paragraph second paragraph second paragraph second
paragraph second paragraph second paragraph second paragraph second
paragraph

third paragraph third paragraph third paragraph third paragraph third
paragraph third paragraph third paragraph third paragraph third paragraph
third paragraph third paragraph third paragraph third paragraph third
paragraph third paragraph third paragraph third paragraph third paragraph
\end{outdent}

Scott D. Anderson @cs.umass.edu

hang left and block paragraphs 

http://groups.google.com/group/comp.text.tex/browse_frm/thread/551f2ae284d88b2c/1aba92b60e9c1130

Newsgroups: comp.text.tex
Date: 2 Jul 1993

I am trying to create a paragraph style in a LaTeX document where the first paragraph is hung left (sometimes called exdented in troff). That is, the first line of the paragraph runs the full width while subsequent lines are indented a given amount from the left. I would like subsequent paragraphs to be indented the same amount from the left, and to be in block format (no more indent on the first line). I would also like equations interspersed with these paragraphs to be full measure. Is there an elegant solution to this?

The solution I am using so far is to use "hangindent," "hangafter," and "hang" in TeX to create hangleft and indented paragraphs, and then to call the left-indent command for each paragraph, together with a \noindent command. This seems a bit awkward, although I can't see how to solve this using an environment, especially since the equations must come out to full measure. I seem to need to use the \noindent command, since setting \parindent to zero points seems to interfere with the "hangindent," "hangafter," or "hang" commands in TeX.

Danny Heap

NB, no answer.

documented on: 2008-06-21

Indenting a list 

Newsgroups: comp.text.tex
Date: Fri, 28 Mar 2003 21:12:14 GMT

Hi,

I want my .ps file looks like this:

Point1
The content here are
Indented.
Another paragraph, still Indented.
May be a table here, still Indented.
Point2
More Indented
content.

How can I do this? Thanks

Indenting a list 

f.ex.:

\documentclass{article}
\usepackage{sectsty}
\sectionfont{\hspace{-1cm}}
\parindent0pt
\begin{document}
\rule{\textwidth}{1pt}
\section{first}
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
blah
\section{second}
blah
blah
\end{document}

Herbert

Indenting a list 

You might try the itemize environment, although you'll want empty labels (use \item[]).

Matthew Low

\newline is illegal 

> You might try the itemize environment, although you'll want empty labels

Thanks, Matthew. Following your direction, I found that the description environment is more suitable for my situation. Just that I can't figure out how to make the descriptions not following my points (\newline is illegal)…

\begin{description}
\item [Point1] \newline
The content here are
Indented.
Another paragraph, still Indented.
May be a table here, still Indented.
\end{description}

\newline is illegal 

> points (\newline is illegal)...
>
> \item [Point1] \newline

Use \item [Point1] ~\newline

Donald Arseneau

help with this expression 

> a quick question that I can't get it straight:
>
> ($L_i < L_j < R_i$) \leftarrow \leftarrow~ i is the ancestor of j
>

\leftarrow has to be put in math mode:

$(L_i < L_j < R_i) \leftarrow \leftarrow\hbox{ i is the ancestor of
j}$

possibly in displaymath is better.

Giuseppe Bilotta

More help with this expression 

> why can't I combine the two expressions like this?
> \[
> (L_i < L_j < R_i) ~\arl \arr~ \hbox{i is the ancestor of j}
>
> (L_i < R_j < R_i) ~\arl \arr~ \hbox{i is the ancestor of j}
> \]

\[ \] is wrong. Check your manuals again. It sounds like you want {eqnarray*}. Really, nobody wants to be used to regurgitate basic instructions that are given in any manual.

Secondly (and the reason I bothered replying) is that the \hbox answer is seriously deficient. It should be \mbox{$i$ is the ancestor of $j$} You could also write: i\mbox{ is the ancestor of }j but that is awful. If you are using amsmath (amstext) then even better is \text{$i$ is the ancestor of $j$}

Thirdly, \arl\arr should probably be \rightleftarrow. Do you mean "implies"? That is usually \Rightleftarrow.

Donald Arseneau

More help with this expression 

\[ .. \] is intended for single equations; if you want more than one equation in a single displaymath environment, you should use the eqnarray env:

\begin{eqnarray*} %the * is to prevent numbering (L_i < L_j < R_i) ~\arl \arr~ \hbox{i is the ancestor of j}

(L_i < R_j < R_i) ~\arl \arr~ \hbox{i is the ancestor of j} \end{eqnarray*}

And by the way, instead of ~\arl \arr~ you should use \iff

(which is \Leftrightarrow plus some spacing; if you really want single implication arrows---not common nowadays--- you could grab the definiton of \iff and replay it with \leftrightarrow instead of \Leftrightarrow)

Giuseppe Bilotta

More help with this expression 

\begin{eqnarray*} %the * is to prevent numbering
ac & = & bd \\
c & = & d \\   % '=' sign aligned
a  =  b \\     % '=' sign not aligned
\end{eqnarray*}

:comment a block 

> Hi, I'd like to comment a whole block of text in a tex file.
> The '%' only work for a single line.  How to it for multilines,
> whithout placing a % in front of each line?

you could make the text into a command

\newcommand{\dumpa}{
omit omit omit omit
}

Now to actually see this, you must say \dumpa

If you don't say \dumpa, you don't see it.

:comment a block 

I define

\newcommand{\empty}[1]{}

and then use it as follows:

\empty{
text text text text text text text text text text
text text text text text text text text text text
text text text text text text text text text text
text text text text text text text text text text
}

Works only when you don't have to use it a lot :-) Otherwise, use \includeonly

Herman.Bruyninckx

:comment a block 

\usepackage{comment}   % from CTAN
...
\begin{comment}
...  Nothing here will be typeset
\end{comment}

Peter W.

:comment a block 

If you are using LaTeX then you can use the verbatim package and then use

\begin{comment}
\end{comment}

(But they can't be nested).

Jeffrey Goldberg

documented on: 2000.11.25 Sat 16:22:12

robust commands? 

Newsgroups: comp.text.tex

Is there a way to allow the content of \text?? command to spread over paragraph? Eg:

\textsl{blah blah blah blah
blah blah blah}

robust commands? 

\slshape
blah blah blah blah
blah blah blah blah
 blah blah blah
\upshape

Works for the example you provided.

Chris W

robust commands? 

Or, better,

{\slshape
Blah blah ...
blah blah...
blah}  back to normal here

Mogens

Boxes 

Simple box 

Line-oriented.

\fbox{
Just
a
test
}
\fbox{
Just
a
test
\linebreak
another parargraph
}

The "another parargraph" will still follows the "Just a test", forming a single line box

Boxing for paragraphs 

Whereas the \framebox, \makebox and savebox commands process their text arguments in LR mode, the minipage environment and the \parbox command process their text arguments in paragraph mode.

To place a box around the following use \fbox + \minipage

\bi
\item Instances map to points in $\Re^n$
\item Less than 20 attributes per instance
\ei
\begin{center}
\fbox{\begin{minipage}{5in}
[...]
\end{minipage}}
\end{center}

box for paragraph 

> How can I put a box around several paragraphs?
>
> I tried \parbox and \begin{minpage} according to the books, but why
> not box lines show up? What should I do?

They don't give box lines. A "box" in that context is an object that holds its contents together in one piece; makes it behave like a single character, according to the LaTeX manual.

What you seek is a "frame". Thus \fbox{} or \framebox{}. To frame a paragraph, you need to put \fbox{parbox{}{ }}. You probably also want a larger setting of \fboxsep.

> \begin{center}\begin{figure}[!ht]\begin{center}
> \parbox{5in}{\begin{flushleft}
> Given query instance $x_q$,  \newline
>  first locate nearest training example $x_n$, \newline
>  then estimate $\hat{f}(x_q) \equiv f(x_n)$.
> \caption{Nearest Neighbor Algorithm}
> \end{flushleft}}\end{center}
> \end{figure}\end{center}

Get rid of the outermost center environment; it introduces space outside of the figure.

You may also want to look up the simple sty file boxedminipage.sty.

Finally, for this algorithmic example, which is not a natural paragraph, I think it would work better as a tabular, which can also provide the frame:

\begin{figure}[!ht]
\centering % no extra space that {center} would give
\begin{tabular}{|l|}\hline
 Given query instance $x_q$,  \\
 first locate nearest training example $x_n$, \\
 then estimate $\hat{f}(x_q) \equiv f(x_n)$. \\ \hline
\end{tabular}
\caption{Nearest Neighbor Algorithm}
\end{figure}

Donald Arseneau

dotted line? 

Newsgroups: comp.text.tex
> Is their Latex command for a dotted line? or I just use a bunch of
> \ldots...? thanks
\dotfill

Magnus

dotted line? 

> Thanks, I've trying to figure out how to limit the dot lines to only
> half of the page. So far no success yet.
> perhaps \dotfill\hfill could do the trick

No. The glue of \hfill is discardable if nothing follows on the line, but putting an empty \hbox{} afterwards does the trick:

\dotfill\hfill\hbox{}

For a general solution to get a dotfill of arbitrary length, the following macro can be useful:

\newcommand{\dotrule}[1]{%
   \parbox[t]{#1}{\dotfill}}

Removing the [t] will center the line vertically somewhat. To get the requested length, the following will work and is probably easier to understand than the previous solution:

\dotrule{0.5\textwidth}

Magnus

dotted line? 

> No. The glue of \hfill is discardable if nothing follows on the line,
> but putting an empty \hbox{} afterwards does the trick:
>
>    \dotfill\hfill\hbox{}

Of course… I should never answer a question …

I often used for such thing : \dotfill\hfill\null, which this time do actually the trick ;=)

Mathieu GOUTELLE

dotted line? 

\makebox[0.5\columnwidth]{\dotfill}

Greg Harmer

How to indent (was: Using right part of the page) 

Newsgroups: comp.text.tex
> All that I want is latex to produce the following effect:
>
>
>
>                                               ___________________
>                                               Author
>
>                                               ___________________
>                                               Supervisor
>
>                                               ___________________
>                                               Date

How about:

\newcommand{\signature}[1]{%
  \par\hfill\parbox[t]{40mm}{\hrulefill\newline#1}\vspace{15mm}\par}
\signature{Author}
\signature{Supervisor}
\signature{Date}

You'll probably have to add some vertical space above the first signature.

Magnus

How to indent (was: Using right part of the page) 

\newcommand{\signature}[1]{%
 \par\hfill\parbox[t]{40mm}{\vspace{18mm}\hrulefill\medskip#1}\par}

How to indent (was: Using right part of the page) 

thanks Magnus

FYI, my current solution:

\begin{tabular}{p{3in}p{2.4in}}
&
\vspace{1cm}
\vspace{2cm}
\hrule\medskip
\noindent Author
\vspace{2cm}
\hrule\medskip
\noindent Supervisor
\vspace{2cm}
\hrule\medskip
\noindent Date
\end{tabular}

T

How to indent (was: Using right part of the page) 

Take a look at the formular package.

Ulrike Fischer