You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
2.8 KiB

9 years ago
{% autoescape off %}
{% load static %}
9 years ago
{% 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
}
9 years ago
%Podtržítko je znak
9 years ago
\catcode`_=13
\def_{$\_$}
% Odsazení různých adres
\parindent=0pt
%\newdimen\fromskip
\newdimen\toskip
%\fromskip=4.35cm
\toskip=11.7cm
% Předsunutí -- na PSČ
\def\predsunout#1{%
\setbox0=\hbox{#1\,}%
\hskip -\wd0\relax%
\box0
}
9 years ago
% 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}}
}
9 years ago
% 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
9 years ago
\ifx \skola \empty
{}
\else
\hbox{\tofont{\skola}}
9 years ago
\fi
\vskip .2 em
\hbox{\tofont{\ulice}}
\vskip .2 em
\vskip .2 em
\hbox to 18pt{\tofont{\predsunout{\PSC\ }\mesto}}
\vskip 5 pt
\tofont{\stat}
}
9 years ago
% 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 7.3 cm % Od oka
\hskip\toskip minus \toskip%
\vbox{\adresat{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
\vfill\eject
9 years ago
}
{% for r in resitele %}
{% with o=r.osoba %}
{% with s=r.skola %}
9 years ago
{% 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}}
9 years ago
{% else %}
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{s.nazev|sloz}}{{s.ulice|sloz}}{{s.psc|sloz}}{{s.mesto|sloz}}{{o.stat.name|sloz}}
9 years ago
{% 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}}
9 years ago
{% else %}
\obalka{{o.jmeno|sloz}}{{o.prijmeni|sloz}}{{''|sloz}}{{o.ulice|sloz}}{{o.psc|sloz}}{{o.mesto|sloz}}{{o.stat.name|sloz}}
9 years ago
{% endif %}
{% else %}
{% endif %}
{% endspaceless %}
{% endwith %}
{% endwith %}
9 years ago
{% endfor %}
\end{document}
9 years ago
{% endautoescape %}