What I mean by Tab spacing is when you put tab spacing "→" (like in some WYSIWYG editor) so the space is flexible but also align text into some kind of measurement. I already know that I can replicate such thing with tabular environment but that's not quite practical since I need to call it repeatedly in many places scattered within document and I'd like to put that into a convenient macros. Is it possible to do such thing in LaTeX? Below is shown my replication in InDesign, tab space shown as "»".
[Tex/LaTex] How to replicate Tab spacing in latex
spacing
Related Solutions
So, if anyone can explain what is happenning here - and is there a possibility for "smooth" vertical positioning of overflown paragraphs, please post back...
As Stephan remarked this is a wonderful question to look at, but I think with all the animation and the coding around it you have fairly effectively hidden the problem.
The culprit is the center
environment just in front of the space that you modify. The problem is that this environment surrounds itself with flexible glue (ie with a stretch and shrink component). The exact values in your case are
10pt plus 3pt minus 5pt
So in the place where you have your space you really have
\mylength + 10pt plus 3pt minus 5pt
As it was remarked in other answers TeX attempts to find a page break with minimal badness. So, if we assume that the page break TeX found just naturally fits (ie no shrink or stretch is necessary) then you just get \mylength + 10pt
at this point. Now if you add 1pt to \mylength
then the last line wouldn't fit any more on the page, except that your extra point can be absorbed by the shrink on the page.
Now if the only shrink available is in this very place (which it is in your example) then your extra point will just be swallowed and the space remains the same. Same story for adding another pt and another one. (If there are several places with shrink on the page then the shrink gets distributed evening across those places, so in that cases you might see a small increase but less than your step value.)
But the moment you have added 4pt it can't be compensated by the shrink available in your example. Thus the last line now really doesn't fit any more on the page and thus TeX needs to use "stretch" to fill the missing line (minus your 4pt), i.e., 8pt or so depending on the \baselineskip
setting.
So no more shrink and instead a stretch and your space makes a jump. Adding further pts will increase your space while the need for stretch gets less until you reach the point where the page again is "natural" without a need for stretch and then everything repeats.
Now the \raggedbottom
setting only effects how the final page is typeset (after breaking it). Basically, the cut-off page is put into a bot of \textheight
and in case of \raggedbottom
a \vfill
is added to the bottom (more or less). Now in the "shrink" situation this doesn't really make a difference as the page is already overfull. And in the stretch situation it means that the stretch in the end is only applied to the bottom and not to the stretchable parts in the middle of the page.
So in summary: to avoid your mystery you need to ensure that the space you are trying to adjust has no shrink or stretch component either as part of your adjustment or as part of space visually next to it. Only then you can ensure that the space actually behaves as you expect
It's easier. :) Set a length to the width of two digits in the current type size
(I've also added a small space just in order that the figures don't touch the vertical lines) and the parameter \tabcolsep
to zero; then use p
columns of the specified width and with \centering
alignment:
\documentclass{article}
\usepackage{array}
\newlength{\twodigits}
\begin{document}
\begin{table}
\centering
\small
\settowidth{\twodigits}{00}
\addtolength{\twodigits}{.4pt}
\setlength{\tabcolsep}{0pt}
\begin{tabular}{|*{32}{>{\centering}p{\twodigits}|}}
\hline
\multicolumn{8}{|c|}{0}
&\multicolumn{8}{c|}{1}
&\multicolumn{8}{c|}{2}
&\multicolumn{8}{c|}{3}\\
\hline
0&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26&27&28&29&30&31 \tabularnewline
\hline
\end{tabular}
\end{table}
\end{document}
If you don't want to use \tabularnewline
, then add the magic \arraybackslash
:
\begin{tabular}{|*{32}{>{\centering\arraybackslash}p{\twodigits}|}}
\hline
\multicolumn{8}{|c|}{0}
&\multicolumn{8}{c|}{1}
&\multicolumn{8}{c|}{2}
&\multicolumn{8}{c|}{3}\\
\hline
0&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23&24&25&26&27&28&29&30&31 \\
\hline
\end{tabular}
Best Answer
While perhaps not ideal for use throughout the document, the built in
tabbing
environment is something I often use for this purpose. Within the environment you can use\=
to set a tab stop and then on another line you can move through the tab stops using\>
. This allows you to create what you're looking for, but you have to manually set the tab stops in your first line.Short example: