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.
 
 
 
 
 
 

126 lines
2.9 KiB

{% autoescape off %}
{% load staticfiles %}
{% 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.7cm
% 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{\predsunout{\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 7.3 cm % Od oka
\hskip\toskip%
\vbox{\adresat{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
\vfill\eject
}
{% for r in resitele %}
{% with o=r.osoba %}
{% with s=r.osoba.skola %}
{% spaceless %}
{% if r.zasilat == "do_skoly" %}
{% if r.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 r.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 %}
% zasilat: {{r.zasilat}}
%\obalka{{r.jmeno|sloz}}{{r.prijmeni|sloz}}{{''|sloz}}{{r.ulice|sloz}}{{r.psc|sloz}}{{r.mesto|sloz}}{{r.stat.name|sloz}}
{% endif %}
{% endspaceless %}
{% endwith %}
{% endwith %}
{% endfor %}
\end{document}
{% endautoescape %}