[net.text] LaTeX: a long list of quirks

podar@sbcs.UUCP (Sunil Podar) (06/18/85)

I got a couple of responses regarding my offer to post this list, hence
here is a long (my apologies for being rather verbose) list of comments,
kluges, bugs? and at times mere observations about the quirky behavior of
LateX. By and large things work out right except for little things. I am a
very satisfied user of LaTeX and quite enthusiatic about it. I don't know
troff at all, but my impression is that LaTeX is much simpler to learn and
use. I hope this list will be of use to you and might save you a few hours
of hacking. We have the older version of LaTeX here i.e. 2.06a hence some 
of these comments might not be valid for later versions. I will be glad to 
hear about your experiences. Perhaps some ideas underlying my comments could
be candidates for considerations in future updates.
enjoy.

                 LaTeX: QUIRKS, COMMENTS, OBSERVATIONS, BUGS?
                 --------------------------------------------
      (compiled from experiences of: ganesh@sbcs, stark@sbcs, sen@sbcs, myself)

1.	The caption in the pic environment seems to have a bug. the literal
	''Fig. 2.1'' always prints in normalsize roman no matter what 
	font is active in your environment. I had to use explicit makebox
	and design my own caption whenever I used other fonts.
2.	Also shortstack doesn't work with the caption command properly.
	It lines up the bottom of stack with the ''Fig. x.y'' line.
	A parbox with proper lining-up option might work. haven't tried.
3.	In the pic environment you can only put circles at specified
	coordinates; no other character works. What happens is that
	the character is treated as a box and the bottom-left corner of the
	box is put at the specified coordinates and not its center.If you
	really want other chars like + or a * then you have to put them in
	a \makebox(0,0) and this way you can put any symmetrical chars
	including a variety of math symbols. e.g.
	\put(70,54){\makebox(0,0){$\otimes$}}
             ...   {\makebox(0,0){$*$}}
             ...   {\makebox(0,0){\framebox(2,2){$+$}}} (!!).

4.	\baselinestretch works, but is highly screwed up.
	a. \renewcommand{\baselinestretch}{1.6} before the \begin{document}
	   magnifies the baselineskip globally for the entire document. 1.6
	   approx. gives a double spacing if using 10pt typesize. For other
	   typesizes you will have to play with the value.
	b. The errata claims that you can change baselinestretch anywhere 
	   in the document and it gets redefined only when you give a 
	   type-size-changing command. Yes, but if you follow the 
	   renewcommand by a \normalsize command & IF YOU WERE ALREADY IN
	   THE NORMALSIZE MODE then it acts smart and doesn't recalculate
	   things; It works if you fool it as follows:
	   	\renewcommand{\baselinestretch}{0.6} 
		\large  %just to force the renewing, a bug and a kluge
		\normalsize %to get back to normalsize
		
	   moral is that to enforce the renewing you have to CHANGE the
	   currently active type-size & go back. The errata says that the
	   \begin{document} command executes a \normalsize hence defining
	   the baselineskip but I guess that works because it is the first
	   time.
	c. The errata also claims that a global declaration of
	   baselinestretch (before \begin{document}) ``magnifies'' (in
	   double quotes) baselineskip suggesting that future changes
	   made to it ought to be relative to this value, but that is not
	   true. Each renewcommand redefines ABSOLUTE baselineskip.
	d. It seems that only \mainbaselineskip has been eliminated.
	   \baselineskip is perhaps still valid and could be used locally
	   but haven't tried.

5.	The `` '' sequence in tt font does not translate to " ". I guess
	this behavior ought to be expected since tt is a fixed-width font.

6.	If you combine two tabular environments using minipages to appear
	side-by-side, one without \hline and the other with them, then they
	don't line up i.e. the one with \hline's takes a wee bit more space
	per line , in other words it seems that hline takes additional
	space. Perhaps with the \cline the problem should disappear.

7.	There seems to be no way to tell latex not to break words, e.g.
	hyphenated words like-this-one. In troff apparently you can say
	$roman like-this-one$ but if you try in latex in math mode, it 
	thinks - is a minus sign and puts spaces between the individual 
	words. 
*****	I found out a way. \mbox{arguement} does the job, but still can not
	resolve linebreaking if a long word in \mbox is at the end of line.

8.	\dashbox(0,10) or \dashbox(10,0)  can be used to get variety of
	dash'ed lines, except that it seems it is not meant to be used this
	way; it leaves a small dash (of size \unitlength) on both ends
	on the axis with 0 width. It ought to be fixed thereby making the
	command really powerful, atleast for getting horizontal & vertical
	dashed lines.
	
9.	How does one give a \sloppy command or achieve an equivalent effect
	when using p-expressions in tabular environment. LaTeX complains hell 
	of a lot with line-breaking there, but there seems to be no simple &
	obvious way to tell it to be sloppy. Same problem is there in \parbox
	in tabbing environment --- do you have to give a \sloppy command in
	EVERY \parbox!!!!?. Is there a way to tell it to be sloppy in the whole
	environment?. I tried putting the entire tabular env in {\sloppy .....
	but it didn't work.
	
10.	Note: If you want a * as part of regular text immediately following a
	\\ then you must use {} before the *, else the * is treated to mean
	\\*. (see page 15 of THE MANUAL).
	
11.	some quirks about tabular env.
	a. the following two are more-or-less equivalent:
		i. \begin{flushleft}
		   \begin{tabular}{......}
		   .......
		   \end{tabular}
		   \end{flushleft}
		   
		ii.\noindent \begin{tabular}[l]{.....}
		   .......
		   \end{tabular}
	
	   I had empty lines before and after the environments in (i) & (ii).
	   in (i) there is additional vertical space before & after the
	   tabular env.
	   In (ii) the vertical spacing was the same as \parskip.
		   
	b. no matter what, the tabular environment seems to leave ONE char
	   worth of space on the left margin, whether you use (i) or (ii)
	   above!!. can't get it to really flush on the left.
	   
	c. found out the way in errata. use {@{}lp{..}} to cancel the space
	   at the beginning.

12.	tabular env: avoid using it unless you must. If you suspect even
	slightly that the tabular env might either be too big for ONE page
	or that in the final layout it might come at the bottom of a page 
	and thus spill over to the next page, DONT USE IT. LaTeX does not break
	a page in the middle of a tabular env. Use tabbing instead, with a
	{\parbox[t]{xin}{.......}} construct in colums where a paragraph
	is desired; a bit painful, but you'll be happy eventually.I use an
	abbreviation for the parboxes: pb -----> {\parbox[t]{X.Yin}{  to 
	make life easier.
	Of course, the tabbing env is not advisable if the text in columns
	is anything other than flush on the left. 
	Also if you must use a tabular, and run into problems, then in your
	final version after seeing how things will locate themselves, you
	can explicitely break the env into two or more exactly same env's.

13.	In giving labels to figures, put them after the \caption stmt,
	otherwise it picks up thr section number instead of the fig. number.

14.	use ~ if you do not want a line break in the middle. ~ is meant to
	be used in place of the blank separating the words. e.g. "Figure
	2.3" is broken & is usually not desirable so you say Figure~2.3.
	Use mbox if the words in question have hyphens in the middle. 
	
15.	doesn't like numerals in the name of the newcommand, i.e. the new name
	that you give to the defined command. 
	( can't say \newcommand{\xyz1}{\hspace{2em}} )
	
16.	In array (in displaymath mode) all fractions are automatically
	reduced in size and printed in textstyle. use explicit displaystyle
	command for them if you like bigger looking fractions.
	The eqnarray environment does not do that to the fractions.!!!

17.	If there are figures that appear with text on the same page and
	there is not enough space between the figure & the text then one
	way is 	play with the \intextsep & \textfloatsep, but the manual
	advises against it because they are supposed to be rubber lengths.
	One simple way around that is to have extra space (e.g. \medskip,
	\vspace...,etc.) just after the \begin{figure} or just before the
	\end{figure} statement, after the \caption & \label statement if
	any.
18.	If you have accented math symbols in a \caption statement, put them in 
	a \mbox with \protect otherwise it bombs out in printing the 
	listoffigures, although it prints OK in the text; gives an "improper
	spacefactor" error. e.g.
	 \caption{junk junk \mbox{$\,\protect\tilde{h}\,$} more junk}
	\protect may not be necessary, but then the manual says, if in doubt
	put it.
	
19.	If ever latex complains with "inserted {" or "}" or gives an error
	of "missing \endgroup" when everything seems OK and all {} matched
	then it probably means it wants the offending paragraph or environment
	in a \parbox or \minipage. It often likes to have things in a so-called
	"outer para mode" when the manual doesn't specifically say so and
	that means it wants a parbox.
	one instance with me was: I had the following setup with two pictures
	that could fit on one page (I could have used two figure envs, but
	then it may not have put them both on one page):
	....
	\begin{figure}
	\begin{picture}...
	......
	\end{picture}
	\caption{....}	<-------bombed out here and it worked only when I
				put both the pictures in separate parboxes.
	\begin{picture}...
	......
	\end{picture}
	\caption{....}
	\end{figure}

20.	Is there a simple way to manipulate the fontsizes of things like
	Chapter 1, Apendix A, that LaTeX chooses by itself (in report style).
	I think not. They come out much too big for my liking. The only way
	seems to be to redefine the \@makechapter... & related commands using
	\makeatletter & \makeatother (not documented & perhaps not meant to
	be used). Same problem is with the default roman font for such
	captions even if the rest of the document is in some other font.

21.	does not expand file name "s3.5" to "s3.5.tex" (for example) ;
	but does expand "s3" to "s3.tex"

22.	LaTeX should have a begin{comment} & end{comment} environment that
	it will simply ignore, instead of requiring one to put % in all the
	lines.


23.	bug in underline?: In any kind of math mode \underline requires two
	args e.g.\underline{}{this will get underlined} whereas in regular
	paragraph mode it requires only one.In math mode it just eats up the
	first arg and underlines the second properly; can't think of any need
	for the fist arg in math mode.
	
24. 	Underlining doesn't quite work properly when you have a variety of 
	consecutive words underlined. e.g. thats how it comes out:
   
   	aaaaaaaaaa yyyyyyyyy bbbbbbbbbb
   	---------- _________ ----------
        	   ^^^^^^^^^
	meaning that if a char in the underlined word extends below the "bottom
	of line" then the underline gets lowered. One solution that I found is
	to use a strut "\rule[-1mm]{0mm}{1ex}" in every word.
	If you have many words then you could put the whole set of words in an 
	mbox with one strut (I haven't tried this but think it would work).
	The only problem with the second solution is that
	you will have to do your own linebreaking that is to say have separate
	mbox'es if one such mbox is much too big for one line. I don't know
	how one would manage justification of text; perhaps a better idea is to
	underline each word individually!!!! and have some \newcommand like
	"\newcommand{\myunderline}[1]{\underline{\rule[-1mm]{0mm}{1ex}#1}}"
	(I said , something like, don't hold me to above definition) and use
	\myunderline for every word.!?

25.	Latex gives a rather thin line for \overline, \frac, & \underline. I 
	haven't been able to figure out how to manipulate the thickness of
	such lines. Help!!!
	I tried playing around with the following, and none of them worked:
	 a. changing \fboxrule thinking that's what might affect it.
	 b. \thicklines
	 c. changing \linethickness
	Perhaps this dirty fix will work: {\bf \underline{\rm #1}}

-- 
Sunil Podar
SUNY at Stony Brook

	CSNET: podar@sbcs.csnet
	ARPA: podar%suny-sb.csnet@csnet-relay.arpa
	UUCP: {allegra, hocsd, philabs, ogcvax} !sbcs!podar