Browse Source
Je ještě potřeba zařídit, že půjde generovat obálky i klasicky, změnit odkazy apod. Ale jako PoC by to použít jít mělo…okenkove_obalky
Pavel "LEdoian" Turinsky
2 years ago
2 changed files with 125 additions and 1 deletions
@ -0,0 +1,124 @@ |
|||
{% autoescape off %} |
|||
{% load static %} |
|||
{% load tex %} |
|||
\documentclass[11pt,a4paper,landscape]{article} |
|||
\usepackage[top=3.75cm,left=8cm]{geometry} |
|||
\usepackage[T1]{fontenc} |
|||
\usepackage[utf8]{inputenc} |
|||
\usepackage[czech]{babel} |
|||
\usepackage{graphicx} |
|||
\begin{document} |
|||
|
|||
% Nechceme číslování stránek |
|||
\pagenumbering{gobble} |
|||
|
|||
% Různé fonty na obálce |
|||
\def\adrfonta#1{% |
|||
\fontsize{14pt}{14.5pt}\selectfont \textbf{\textsf{#1}}%Časopis M&M |
|||
} |
|||
\def\adrfontb#1{% |
|||
\fontsize{12pt}{13pt}\selectfont \textbf{\textsf{#1}}%OPMK UK MFF |
|||
} |
|||
\def\adrfontc#1{% |
|||
\fontsize{12pt}{13pt}\selectfont \textsf{#1}%Adresa, telefon, e-mail |
|||
} |
|||
\def\tofont#1{% |
|||
\fontsize{16pt}{18pt}\selectfont #1%Adresa řešitele |
|||
} |
|||
|
|||
%Podtržítko je znak |
|||
\catcode`_=13 |
|||
\def_{$\_$} |
|||
|
|||
% Odsazení různých adres |
|||
\parindent=0pt |
|||
%\newdimen\fromskip |
|||
\newdimen\toskip |
|||
%\fromskip=4.35cm |
|||
\toskip=11.8cm |
|||
|
|||
% Předsunutí -- na PSČ |
|||
\def\predsunout#1{% |
|||
\setbox0=\hbox{#1\,}% |
|||
\hskip -\wd0\relax% |
|||
\box0 |
|||
} |
|||
|
|||
% Makro na TeXáni naší adresy |
|||
\def\adresaMaM{% |
|||
\hbox{\adrfonta{Časopis M\&M,}} |
|||
\vskip 3 pt |
|||
\hbox{\adrfontb{OPMK UK MFF}} |
|||
\vskip 3 pt |
|||
\hbox{\adrfontc{Ke Karlovu 3, 121 16 Praha 2}} |
|||
\hbox{\adrfontc{Tel.: +420 221 911 235}} |
|||
\hbox{\adrfontc{mam@matfyz.cz}} |
|||
} |
|||
|
|||
% Makro na TeXání adresátovy adresy |
|||
\def\adresat#1#2#3#4#5#6#7{% |
|||
\def\jmeno{#1}% |
|||
\def\prijm{#2}% |
|||
\def\skola{#3}% |
|||
%\def\popis{} |
|||
%\def\first{} |
|||
\def\ulice{#4}% |
|||
\def\PSC{#5}% |
|||
\def\mesto{#6}% |
|||
\def\stat{#7}% |
|||
|
|||
\hbox{\tofont{\jmeno\ \prijm}} |
|||
\vskip .2 em |
|||
\ifx \skola \empty |
|||
{} |
|||
\else |
|||
\hbox{\tofont{\skola}} |
|||
\fi |
|||
\vskip .2 em |
|||
\hbox{\tofont{\ulice}} |
|||
\vskip .2 em |
|||
\vskip .2 em |
|||
\hbox to 18pt{\tofont{\PSC\ \mesto}} |
|||
\vskip 5 pt |
|||
\tofont{\stat} |
|||
} |
|||
|
|||
% Tohle makro vysází samotnou obálku |
|||
\def\obalka#1#2#3#4#5#6#7{ |
|||
% Horní a pravý okraj je zároveň okraj stránky, resetujeme odsazení |
|||
\includegraphics[height=2.55cm]{lisak.pdf} |
|||
%\vbox{% |
|||
%\adresaMaM} |
|||
\vskip 4.8 cm % Od oka |
|||
\hskip\toskip minus \toskip% |
|||
\vbox{\adresat{#1}{#2}{#3}{#4}{#5}{#6}{#7}} |
|||
\vfill\eject |
|||
} |
|||
|
|||
|
|||
{% for r in resitele %} |
|||
{% with o=r.osoba %} |
|||
{% with s=r.skola %} |
|||
{% spaceless %} |
|||
{% if r.zasilat == "do_skoly" %} |
|||
{% if o.stat == "CZ" %} |
|||
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{''|sloz}} |
|||
{% else %} |
|||
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{o.stat.name|sloz}} |
|||
{% endif %} |
|||
|
|||
{% elif r.zasilat == "domu" %} |
|||
{% if o.stat == "CZ" %} |
|||
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{''|sloz}} |
|||
{% else %} |
|||
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{o.stat.name|sloz}} |
|||
{% endif %} |
|||
{% else %} |
|||
{% endif %} |
|||
{% endspaceless %} |
|||
{% endwith %} |
|||
{% endwith %} |
|||
{% endfor %} |
|||
\end{document} |
|||
|
|||
{% endautoescape %} |
Loading…
Reference in new issue