summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-13 22:57:24 +0000
committerKarl Berry <karl@freefriends.org>2009-09-13 22:57:24 +0000
commit65ba9929b1e0745a4fc83154e7c8d226b6e9c1d6 (patch)
tree2c1f1b0de054e2e7a03a45156491d715b1fceb9f /Master/texmf-dist/tex/generic
parent9ac8b08c93d6b47a5fef35454a531779fa6df983 (diff)
tabto-generic, not tabto
git-svn-id: svn://tug.org/texlive/trunk@15267 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/tabto-generic/tabto.tex39
1 files changed, 39 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/tabto-generic/tabto.tex b/Master/texmf-dist/tex/generic/tabto-generic/tabto.tex
new file mode 100644
index 00000000000..457bd9e4edc
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/tabto-generic/tabto.tex
@@ -0,0 +1,39 @@
+%-------------- tabto.tex ------------
+% Donald Arseneau <asnd@triumf.ca>
+%
+% This software is contributed to the public domain.
+% See tabto.sty for more useful definitions for LaTeX.
+%
+% Tab to a position relative to the left margin in a paragraph:
+% some text \tabto{1in} more text, and \tabto 3in final text.
+% If the text on the line already goes past the desired position,
+% the tab starts a new line.
+% Note that braces are allowed, but not required.
+%
+
+\newdimen \scratchdim % or use \@tempdima in LaTeX
+\newdimen \scratchDIM % or use \@tempdimb in LaTeX
+
+% this preliminary mess is just TeX's awful way of reading a parameter
+% with or without braces.
+
+\def\tabto{\futurelet\nExt\tabtO}
+\def\tabtO{\ifx\nExt\bgroup\let\nExt\TabTo\else\let\nExt\tabtOO\fi\nExt}
+\def\tabtOO{\afterassignment\tabTOO\scratchDIM }
+\def\tabTOO{\TabTo\scratchDIM}
+
+\def\TabTo#1{\begingroup\leavevmode
+\ifinner\scratchdim=0pt\relax % in a \hbox, so ignore
+\else % unrestricted horizontal mode
+ \parfillskip=0pt plus 1fill % must swamp the -1fil glue
+ \hfil\null\penalty20 \hskip0ptplus-1fil
+ \hbox{\mathstrut\kern\hsize\kern-#1}\vadjust{\nobreak}\par
+ \scratchdim=\prevdepth
+ \prevdepth=-999pt % make sure I get an exact \baselineskip
+ \parskip=-999pt % but cancel the extra space
+ \advance\parskip-\baselineskip % cancel the \baselineskip
+ \advance\parskip-\scratchdim
+ \noindent
+\fi \hbox to#1{\vrule depth\scratchdim width0pt\hss}\endgroup
+\ignorespaces}
+