"spurious" leading in latex - latex

the following latex input:
\rule{1cm}{1cm}\\
\rule{1cm}{1cm}
leaves a gap of about .35mm between the boxes. what is the length that defines this gap?

Edit: I was only partly right at first, but GoogleBooks knew. It pointed me at A Beginner's Book of TeX
By Raymond Seroul, Silvio Levy, Silvio Vieira Ferreira Levy, which says:
Three variables control this behavior \baselineskip, \lineskip and \lineskiplimit.
The default separation of lines is \baselineskip, but boxes are not allowed to come closer than \lineskiplimit. If they would, the vertical spacing is adjusted until \lineskip space lies between them...

Related

LaTeX: typesetting chapter and section number in margin

I'm trying to typeset something in LaTeX and I would like to know if I'm doing it right. The basic idea is that section number hangs in the left margin. The number takes the height of the header+2 lines for a chapter heading, +1 line for section heading, and has the same height as the header for subsections, and is aligned to the top of the heading. See the following image to get an idea of what I'm talking about:
http://img62.imageshack.us/img62/8404/bladld.png
My approach is using titlesec and doing something like this:
\titleformat{\chapter}%
{\Huge\bfseries\sffamily}% format
{\vbox to 16pt{\llap{% label
\fontsize{3em}{0}\selectfont{\thechapter}%
\hskip 9pt%
}}}%
{0pt}% horizontal sep
{}% before
\titlespacing*{\chapter}%
{0pt}% left
{-2em}% before
{0pt}% after
But this solution has some hacks that I would rather avoid. The \vbox height for instance, is found by trial and error. Visually, it looks almost right...
Try using the memoir document class. That has a ton of options for doing exactly this kind of thing, and it's much neater...
There's a hangnum style and for sections, there's a \hangsecnum option, but that only puts the number in the margin: it doesn't make it bigger. Memoir is also fabulously documented. So I expect all everything you need will be there. The code for hangnum is on p.88 of the fantastic memoir manual. So from there and from later examples you should get all the pointers you need to get what you want...

Is there unresizable space in latex? Pictures in good looking grid

I've created latex macro to typeset guitar chords diagrams(using picture environment).
Now I want to make diagrams of different appear in good looking grid when typeset one next to each other as the picture shows:
The picture.
(on the picture: Labeled "First" bad layout of diagrams, labeled "Second" correct layout when equal number of diagrams in line)
I'm using \hspace to make some skips between diagrams, otherwise they would be too near to each other. As you can see in second case when latex arrange pictures in so that there is same number of them in each line it works. However if there is less pictures in the last line they become "shifted" to the right. I don't want this.
I guess is because latex makes the space between diagrams in first line a little longer for the line to exactly fit the page width. How do I tell latex not to resize spaces created by \hspace ? Or is there any other way ?
I guess I cannot use tables because I don't know how many diagrams will fit in one line...
This is current state of code:
\newcommand{\spaceForChord}{1.7cm}
\newcommnad{\chordChart}[1]{%
%calculate dimensions xdim and ydim according to settings
\begin{picture}(xdim, ydim){%
%draw the diagram inside defined area
}%
\hspace*{\spaceForChord}%
\hspace*{-\xdim}%
}%
%end preambule and begin document
\begin{document}
First:\\*
\\*
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
\chordChart{...some arguments to change diagram look...}
%...above line is repeated 12 more times to produce result shown at the picture
\end{document}
Thanks for any help.
A long shot, since I can't easily recreate your situation: would wrapping a flushleft environment around your \chordCart be of any help?
I.e.,
First:\\*
\begin{flushleft}
\chordChart{...some arguments to change diagram look...}
...
\end{flushleft}
Second:\\*
If your hypothesis is correct and LaTeX is indeed trying to stretch spaces to justify lines, then the above should solve your problem by turning off justification on the right.

How to align "pages of floats" to the top margin?

If I include [p] in the placement specifier of a \begin{figure} environment, figure floats may be placed on a dedicated page. However, at least in the "book" document class, floats are centered vertically on those pages.
How do I force all "pages-o-floats" to be aligned to the top margin (just like normal text pages)?
I believe your answer is in the UK TeX FAQ:
\#fptop defines the distance from the top of the page to the top of the first float
The simple fix is to reset \#fptop in your preamble:
\makeatletter
\setlength{\#fptop}{0pt}
\makeatother
However, you might find that this is a bit too high, so you might want something like 5pt instead. (Anyway, the FAQ entry is well worth reading; it explains in more depth what's going on than I am here.)
can you not use the [t] specifier instead of [p]?

Footnote spacing in LaTeX

I'm writing my dissertation and the grad school says I need a space between multiple footnotes and also the space between the text and the start of the footnotes is too small. Is there a way to do this?
Any help is greatly appreciated.
\footnotesep is the space between footnotes:
\setlength{\footnotesep}{0.5cm}
\footins is the space between the text body and the footnotes:
\setlength{\skip\footins}{2cm}
You might want to play around with the actual numbers, I've just chosen some values where you will actually see the difference.
There's also a LaTeX package, footmisc, that's useful for manipulating footnote formatting.

How do I prevent LaTeX from padding spaces between paragraphs so that next section begins at top of next page?

I have a two-column paper where space restrictions are very tight.
I just looked at my last version of the manuscript and saw that the upper half contains a figure (as expected), but in the lower half there is a lot of vertical space between paragraphs (enough to squeeze 10 more lines), and that LaTeX probably added it so that in the beginning of the next page a new numbered section will begin at the top of the page.
I know there's a way to adjust this so LaTeX doesn't try so hard, but I'm not sure how. any help? Thanks!
The parameter that controls inter-paragraph spacing is called \parskip(See Paragraph Spacing ). You set it (with "rubber" values) using something like:
\setlength{\parskip}{1cm plus4mm minus3mm}
The defualt value of \parskip is class dependent. The "plus" and "minus" parts tell TeX how much it can adjust the value to improve the layout (that is they make the spacing elastic, thus the "rubber" designation). Reducing (or eliminating) the "plus" part of the rubber might help.
Watch out though, you can cause other layout artifacts if you constrain TeX too much.
Other things to think about:
The widow and club penalties probably apply section headings, and may be affecting TeX's layout choices (see https://stackoverflow.com/questions/512967/how-can-one-keep-a-section-from-being-at-the-end-of-a-page-in-latex for a discussion).
You may also want to consider messing with \baselineskip which controls the allowed spacing between lines of text and can also have rubber values.
This is a common problem, and there are probably some fairly sophisticated treatments already prepared on CTAN.
\vfill before the new section worked perfectly for me.

Resources