preislister: Adjust LaTeX/PDF output

- Improve page margin appraoch
- .. and set margin to 1cm everywhere
- Set font style to sans-serif
- Move date on top
- Alternate row color
- Increase font size
- Bold table header
This commit is contained in:
Sebastian Pipping 2012-02-02 01:26:37 +01:00
parent 551c8641d3
commit bb13e1fcc3
1 changed files with 13 additions and 18 deletions

View File

@ -53,19 +53,14 @@ if __name__ == '__main__':
f = open(preisliste_tex, 'w') f = open(preisliste_tex, 'w')
f.write(r""" f.write(r"""
\documentclass[a4paper,10pt]{scrartcl} \documentclass[a4paper,12pt]{scrartcl}
\usepackage[ngerman]{babel} \usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{fullpage} \usepackage{fullpage}
\usepackage{booktabs}
\usepackage{eurosym} \usepackage{eurosym}
\usepackage[table]{xcolor}
% Reduce vertical offset \usepackage[hmargin=1cm,vmargin=1cm]{geometry}
\addtolength{\textheight}{\voffset}
\setlength{\voffset}{0cm}
\setlength{\voffset}{-1cm}
\addtolength{\textheight}{1cm}
% No footskip % No footskip
\addtolength{\textheight}{\footskip} \addtolength{\textheight}{\footskip}
@ -78,14 +73,15 @@ if __name__ == '__main__':
% No page number % No page number
\pagestyle{empty} \pagestyle{empty}
\begin{document} \definecolor{mygray}{RGB}{224,224,224}
\begin{flushright}Stand \today\end{flushright} \renewcommand{\arraystretch}{1.2}
\vspace*{-4.6ex}
% \begin{document}\sffamily
\noindent
Stand \today\\[\baselineskip]
\rowcolors{2}{white}{mygray}
\begin{tabular}{l@{\quad}rr} \begin{tabular}{l@{\quad}rr}
\toprule \textbf{Artikel} & \multicolumn{1}{c}{\textbf{Preis}} & \multicolumn{1}{c}{\textbf{Pfand}} \\
Artikel & \multicolumn{1}{c}{Preis} & \multicolumn{1}{c}{Pfand} \\
\midrule
""") """)
first = True first = True
@ -98,12 +94,11 @@ Artikel & \multicolumn{1}{c}{Preis} & \multicolumn{1}{c}{Pfand} \\
latex_price = german('\\textbf{%.2f} \\euro', i.price) latex_price = german('\\textbf{%.2f} \\euro', i.price)
latex_deposit = '~' if i.deposit == 0 else german('+ %.2f \\euro', i.deposit) latex_deposit = '~' if i.deposit == 0 else german('+ %.2f \\euro', i.deposit)
write_utf8(f, '%s%s & %s & %s \\\\\n' % ( write_utf8(f, '%s & %s & %s \\\\\n' % (
'' if first else '\\midrule\n',
latex_name, latex_price, latex_deposit)) latex_name, latex_price, latex_deposit))
first = False first = False
f.write(r"""\bottomrule f.write(r"""
\end{tabular} \end{tabular}
\end{document} \end{document}
""") """)