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