Merge branch 'test' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into test
This commit is contained in:
commit
b1cc6df91e
2 changed files with 75 additions and 61 deletions
|
@ -1,79 +1,94 @@
|
|||
{% autoescape off %}
|
||||
{% load staticfiles %}
|
||||
{% load tex %}
|
||||
\input czech.sty
|
||||
\input epsf
|
||||
\special{landscape}
|
||||
\nopagenumbers
|
||||
\hoffset=-1in
|
||||
\voffset=-1in
|
||||
\advance\voffset by 0.9cm
|
||||
%nove pridano, aby to fungovalo...
|
||||
\advance\hoffset by 6.5cm
|
||||
\hsize=22cm
|
||||
\vsize=16cm
|
||||
\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}
|
||||
|
||||
\font\adrfonta=csssbx10 at 14pt
|
||||
\font\adrfontb=csssbx10 at 12pt
|
||||
\font\adrfontc=csss12
|
||||
\font\tofont=csr12 at 16pt
|
||||
% Nechceme číslování stránek
|
||||
\pagenumbering{gobble}
|
||||
|
||||
\newdimen\fromskip
|
||||
\newdimen\toskip
|
||||
\fromskip=4.35cm
|
||||
\toskip=13.2cm
|
||||
|
||||
\def\first{\relax}
|
||||
% 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
|
||||
%\catcode`_=12
|
||||
|
||||
\def_{$\_$}
|
||||
|
||||
\advance\voffset by 2.5cm
|
||||
% 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
|
||||
}
|
||||
|
||||
\def\obalka#1#2#3#4#5#6#7{
|
||||
% 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}}
|
||||
}
|
||||
|
||||
\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}
|
||||
\vskip-4mm\vbox to 0pt{\hbox to 0pt{\hskip1.4cm\epsfysize=2.55cm\epsfbox{lisak.eps}\hss}\vss}
|
||||
% 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}%
|
||||
|
||||
\baselineskip=13pt
|
||||
\parindent=\fromskip
|
||||
\line{\indent\adrfonta Časopis M\&M,\hfil}
|
||||
\vskip3pt
|
||||
\line{\indent\adrfontb OPMK UK MFF\hfil}
|
||||
\vskip3pt
|
||||
\line{\indent\adrfontc Ke Karlovu 3, 121 16 Praha 2\hfil}
|
||||
\line{\indent\adrfontc Tel.: +420 221 911 235\hss}
|
||||
\line{\indent\adrfontc mam@atrey.karlin.mff.cuni.cz\hfil}
|
||||
|
||||
\vskip6.15cm
|
||||
\vbox to 0pt{\parindent=1.4cm\hsize=\toskip\advance\hsize by -1cm
|
||||
\vbox to 60pt{\vfil} \popis\vss}
|
||||
\parindent=\toskip
|
||||
\baselineskip=18pt
|
||||
\line{\indent\tofont\first\hfil}
|
||||
\line{\indent\tofont\jmeno\ \prijm\hfil}
|
||||
\hbox{\tofont{\jmeno\ \prijm}}
|
||||
\ifx \skola \empty
|
||||
{}
|
||||
\else
|
||||
\line{\indent\tofont\skola\hfil}
|
||||
\hbox{\tofont{\skola}}
|
||||
\fi
|
||||
\line{\indent\tofont\ulice\hfil}
|
||||
\line{\tofont\item{\PSC} \mesto\hfil}
|
||||
\vskip5pt
|
||||
\line{\indent\tofont\stat\hfil}
|
||||
\hbox{\tofont{\ulice}}
|
||||
|
||||
\vfil\eject
|
||||
\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.eps}\hskip 1 em\vbox{%
|
||||
\adresaMaM}
|
||||
\vskip 7.3 cm % Od oka
|
||||
\hskip\toskip%
|
||||
\vbox{\adresat{#1}{#2}{#3}{#4}{#5}{#6}{#7}}
|
||||
\vfill\eject
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,6 +113,6 @@
|
|||
{% endif %}
|
||||
{% endspaceless %}
|
||||
{% endfor %}
|
||||
\bye
|
||||
\end{document}
|
||||
|
||||
{% endautoescape %}
|
||||
|
|
|
@ -568,8 +568,7 @@ def obalkyView(request,resitele):
|
|||
with open(tempdir+"/obalky.tex","w") as texfile:
|
||||
texfile.write(tex)
|
||||
shutil.copy(os.path.join(settings.STATIC_ROOT, 'seminar/lisak.eps'),tempdir)
|
||||
subprocess.call(["csplain","obalky.tex"],cwd = tempdir)
|
||||
subprocess.call(["dvipdf","obalky.dvi"],cwd = tempdir)
|
||||
subprocess.call(["pdflatex","obalky.tex"],cwd = tempdir)
|
||||
|
||||
with open(tempdir+"/obalky.pdf","rb") as pdffile:
|
||||
response = HttpResponse(pdffile.read(),content_type='application/pdf')
|
||||
|
|
Loading…
Reference in a new issue