diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-18 20:51:24 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-18 20:51:24 +0100 |
commit | 947eb7b8b8200e5151b91f8be1a95c1dd466732a (patch) | |
tree | 67bbd3e65c1c3711887949e1b424a2a0da618d1a /tmpl/tex_funcs.tt2 | |
parent | 428ac342deed279d18fd6ab9d1c7ac39d0d2f03d (diff) | |
parent | 32aa8b091f439043ec2a4c7807366cb26eb9de19 (diff) |
Merge branch 'master' of /home/argggh/git/lxrng/
Diffstat (limited to 'tmpl/tex_funcs.tt2')
-rw-r--r-- | tmpl/tex_funcs.tt2 | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tmpl/tex_funcs.tt2 b/tmpl/tex_funcs.tt2 new file mode 100644 index 0000000..36fee92 --- /dev/null +++ b/tmpl/tex_funcs.tt2 @@ -0,0 +1,39 @@ +% -*- latex -*- + +% LXRng formatting functions +\makeatletter +\newbox\lx@box +\newdimen\lx@charwd\advance\lx@charwd 6.4pt +\newdimen\lx@wrapped +\renewcommand\\{\newline\advance\lx@used-\lx@used\advance\lx@wrapped-\lx@wrapped} +\newdimen\lx@used +\newdimen\lx@linewd\advance\lx@linewd\textwidth\advance\lx@linewd-1em + +% Words +\def\lxlt#1{\setbox\lx@box\hbox{#1}% +\advance\lx@used\wd\lx@box% +\ifdim\lx@used>\lx@linewd% +\hspace*{-\lx@used}\hspace{\wd\lx@box}\hspace*{\lx@linewd}% +\raisebox{-2pt}{\ArrowBoldRightStrobe}\\% +\raisebox{-2pt}{\ArrowBoldDownRight} % +\advance\lx@wrapped\lx@linewd +\advance\lx@used-\lx@used% +\advance\lx@used 3\lx@charwd% +\advance\lx@used\wd\lx@box% +\else\fi% +\usebox\lx@box} + +% Alignment +\def\lxalign#1{\hspace*{#1\lx@charwd}\hspace*{-\lx@wrapped}\hspace*{-\lx@used}% +\advance\lx@used-\lx@used\advance\lx@used #1\lx@charwd} + +% Fixed-width chars +\def\lxgr#1{\lxlt{\makebox[\lx@charwd][l]{#1}}} + +% Whitespace +\def\lxws#1{\setbox\lx@box\hbox{#1}\hspace*{\wd\lx@box}\advance\lx@used\wd\lx@box} + +\newcommand\lxrln[1]{\tiny\hspace*{-4em}\makebox[4em][r]{#1\hspace{1.5ex}}\small} +\def\dash{\raise2.1pt\hbox{\rule{5pt}{0.3pt}}\hspace{1pt}} + +\makeatother |