diff options
author | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-17 23:02:22 +0100 |
---|---|---|
committer | Arne Georg Gleditsch <argggh@lxr.linpro.no> | 2008-02-17 23:02:22 +0100 |
commit | 2d684362a152e9407ae143536fec2c33ffd48e6d (patch) | |
tree | e4653c9af0a6fd2c4f10e1deaf4781feb2f2c965 /tmpl | |
parent | db9049079b4a34b270283512941cfa19ac8d20aa (diff) |
Better PDF generation, improved line split handling.
Diffstat (limited to 'tmpl')
-rw-r--r-- | tmpl/print_pdf.tt2 | 3 | ||||
-rw-r--r-- | tmpl/tex_funcs.tt2 | 39 |
2 files changed, 40 insertions, 2 deletions
diff --git a/tmpl/print_pdf.tt2 b/tmpl/print_pdf.tt2 index 0577159..29aca7c 100644 --- a/tmpl/print_pdf.tt2 +++ b/tmpl/print_pdf.tt2 @@ -10,6 +10,7 @@ \usepackage{fancyhdr} \usepackage{bbding} \pagestyle{fancy} +[% INCLUDE tex_funcs.tt2 %] \begin{document} \setlength\baselineskip{7pt} \setlength\parskip{.3\baselineskip} @@ -17,8 +18,6 @@ \renewcommand{\headrulewidth}{0pt} \fancyhead{} \fancyfoot{} -\def\dash{\raise2.1pt\hbox{\rule{5pt}{0.3pt}}\hspace{1pt}} -\newcommand\lxrln[1]{\tiny\hspace*{-4em}\makebox[4em][r]{#1\hspace{1.5ex}}\small} \sffamily\small %% I kinda like the proportional fonts, but expect they won't be %% everyone's cup of tea. Uncomment next line to use monospace font. 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 |