diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/zigaretten |
Initial commit
Diffstat (limited to 'graphics/zigaretten')
-rw-r--r-- | graphics/zigaretten/README | 33 | ||||
-rw-r--r-- | graphics/zigaretten/example.pdf | bin | 0 -> 33759 bytes | |||
-rw-r--r-- | graphics/zigaretten/example.tex | 169 | ||||
-rw-r--r-- | graphics/zigaretten/zigarettenschachtelhuellenzeichnung.dtx | 376 | ||||
-rw-r--r-- | graphics/zigaretten/zigarettenschachtelhuellenzeichnung.ins | 28 | ||||
-rw-r--r-- | graphics/zigaretten/zigarettenschachtelhuellenzeichnung.pdf | bin | 0 -> 75602 bytes | |||
-rw-r--r-- | graphics/zigaretten/zigarettenschachtelhuellenzeichnung.sty | 245 |
7 files changed, 851 insertions, 0 deletions
diff --git a/graphics/zigaretten/README b/graphics/zigaretten/README new file mode 100644 index 0000000000..8325223643 --- /dev/null +++ b/graphics/zigaretten/README @@ -0,0 +1,33 @@ +INSTALL PROCEDURE + + Move the package (.sty file) to a latex search directory if + you want to be able to use it from any directory. Ask you + system administrator if you need help. + +NOTE + + The distribution contains a documentation, a package file and + and an example file. They don't need further processing, thoug + they can be re-derived from the .ins, .dtx, and .tex files. + + * Build the package file + (pdf)latex zigarettenschachtelhuellenzeichnung.ins + * Build the documentation + (pdf)latex zigarettenschachtelhuellenzeichnung.dtx + * Build the example + (pdf)latex example.tex + +REQUIREMENTS + +The package zigarettenschachtelhuellenzeichnung requires the following +standard packages + * ifthen - LaTeX-style booleans; + * calc - dimension calculus; + * pgf - portable graphics; +and LaTeX2e. + +The example file uses a few additional packages + * inputenc - to yield UTF8 input + * aeguill - better T1 fonts + * eurosym - euro currency symbol + diff --git a/graphics/zigaretten/example.pdf b/graphics/zigaretten/example.pdf Binary files differnew file mode 100644 index 0000000000..9950bd35c7 --- /dev/null +++ b/graphics/zigaretten/example.pdf diff --git a/graphics/zigaretten/example.tex b/graphics/zigaretten/example.tex new file mode 100644 index 0000000000..8a9a882665 --- /dev/null +++ b/graphics/zigaretten/example.tex @@ -0,0 +1,169 @@ +\documentclass[a4paper]{article} + +\hoffset=-1in\oddsidemargin=1cm\textwidth=19cm +\voffset=-1in\topmargin=1cm\headheight=0pt\headsep=0pt\textheight=27.7cm +\pagestyle{empty} + +\usepackage[ec]{aeguill} +\usepackage{eurosym} +\usepackage[utf8]{inputenc} + +\usepackage{zigarettenschachtelhuellenzeichnung} +\renewcommand\section[1]{\centerline{\textbf{#1}}\vskip 1ex} + +\begin{document} + +\begin{zigarettenschachtelhuelle} + \background{blue!30!white} + \frontwarning[26pt]{ + Voter oui\\ + tue + } + \backwarning[14pt]{ + La constitution\\ + peut diminuer\\ + la coopération\\ + et provoque\\ + l'impuissance + } + \ingredients[6.5pt]{ + Paix:\\ + 0.8\,mg\\[1ex] + Uranium:\\ + 15\,t + } + \fronttext{ + \section{Art. I-41.3, alinéa 2} + Les États membres s'engagent à améliorer progressivement leurs capacités + militaires. (...) + } + \backtext[8pt]{ + \section{Art. I-41.2, alinéa 2} + La politique de l'Union au sens du présent article n'affecte pas le caractère + spécifique de la politique de sécurité et de défense de certains États + membres, elle respecte les obligations découlant du traité de l'Atlantique Nord + pour certains États membres (...) + } +\end{zigarettenschachtelhuelle} +\\[1cm] + +\begin{zigarettenschachtelhuelle} + \background{blue!30!white} + \frontwarning[12.5pt]{ + La constitution\\ + peut provoquer une\\ + mort économique\\ + lente et douloureuse + } + \backwarning[12pt]{ + La constitution\\ + contient\\ + des territoires\\ + d'exception,\\ + des no man's lands,\\ + des paradis fiscaux. + } + \ingredients[6.5pt]{ + Prix:\\ + +2\,\%\\[1ex] + Chômage:\\ + 15\,\% + } + \fronttext{ + \section{Art. III-185.1} + L'objectif principal du Système européen de banques centrales + est de maintenir la stabilité des prix. + } + \backtext[8pt]{ + \section{Art. IV-440.6} + Le présent traité ne s'applique pas aux îles Féroé [paradis fiscal + sous souveraineté danoise] (...) le présent traité ne s'applique + aux îles anglo-normandes et à l'île de Man [paradis fiscaux sous + souveraineté britannique] que dans la mesure nécessaire pour assurer + le régime prévu pour ces îles (...) + } +\end{zigarettenschachtelhuelle} + +\newpage~\newpage + +\begin{zigarettenschachtelhuelle} + \background{blue!30!white} + \backwarning[15pt]{ + La constitution\\ + peut provoquer\\ + une mort\\ + politique lente\\ + et douloureuse + } + \frontwarning[12pt]{ + Protégez les enfants\\ + ne leur laisser pas\\ + avaler\\ + votre constitution + } + \ingredients[6pt]{ + Dé\-mo\-cra\-tie:\\ + 0,1\,mg\\[1ex] + Bourse:\\ + +50\,\% + } + \fronttext[7pt]{ + \section{Art. III-131} + Les États membres se consultent en vue de prendre en commun les + disposition nécessaires pour éviter que le fonctionnement du + marché intérieur ne soit affecté par les mesures qu'un État + membre peut être appelé à prendre en cas de troubles intérieurs + graves affectant l'ordre public, en cas de guerre (...) + } + \backtext[7pt]{ + \section{Art. III-332} + Le Parlement européen peut, à la majorité des membres qui le + composent, demander à la Commission de soumettre toute proposition + appropriée sur les questions qui lui paraissent nécessiter + l'élaboration d'un acte de l'Union pour la mise en œuvre de + la constitution. Si la Commission ne soumet pas de proposition, + elle en communique les raisons au Parlement. + } +\end{zigarettenschachtelhuelle} +\\[1cm] + +\begin{zigarettenschachtelhuelle} + \background{blue!30!white} + \backwarning[15.5pt]{ + Votre syndicaliste\\ + peut vous aider\\ + à arrêter\\ + la constitution + } + \frontwarning[12pt]{ + Voter oui nuit + gravement + à votre santé + et à celle de + votre entourage + } + \ingredients[6pt]{ + Santé:\\ + 0.3\,mg\\[1ex] + Salaire:\\ + 100\,\euro + } + \fronttext[8pt]{ + \section{Art. III-210.2 a} + La loi ou loi-cadre européenne [sur la politique sociale] peut établir + des mesures destinées à encourager la coopération entre États membres + (...) à l'exclusion de toute harmonisation des + dispositions législatives et réglementaires des États membres. + } + \backtext[7.5pt]{ + \section{Art. III-210.2.b} + dans les domaines visés au paragraphe 1 [politique sociale] + la loi-cadre européenne peut établir des prescriptions minimales + applicables progressivement (...). Elle évite d'imposer des + contraintes administratives, financières et juridiques telles qu'elles + contrarieraient la création et le développement de petites et + moyennes entreprises. + } +\end{zigarettenschachtelhuelle} +\end{document} + diff --git a/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.dtx b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.dtx new file mode 100644 index 0000000000..aba9f9f766 --- /dev/null +++ b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.dtx @@ -0,0 +1,376 @@ +% \iffalse meta-comment +% +% Copyright (C) 2005 by Régis Lachaume. +% +% Released in the public domain. +% +% \fi +% +% \iffalse +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesPackage{zigarettenschachtelhuellenzeichnung} +%<package> [2005/04/29 Zigarettenschachtelhuellenzeichnung mit LaTeX - Drawing of cigarette pack covers with LaTeX] +%<*driver> +\documentclass{ltxdoc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\begin{document} +\DocInput{zigarettenschachtelhuellenzeichnung.dtx} +\end{document} +%</driver> +% \fi +% +% +% +% \GetFileInfo{zigarettenschachtelhuellenzeichnung.dtx} +% \CheckSum{0} +% \OnlyDescription +% +% \CharacterTable +% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% +% +% \title{Zigarettenschachtelhuellenzeichnung\\Drawing of cigarette pack covers.} +% +% \author{R\'egis Lachaume\\ +% Max-Planck-Institut f\"ur Radioastronomie\\ +% Auf dem H\"ugel 69\\ +% D-53121 Bonn\\ +% \texttt{lachaume@mpifr-bonn.mpg.de}} +% +% +% \date{Printed \today} +% +% \maketitle +% +% \section{To start with} +% +% This package is meant to design cigarette pack covers that hide the +% death warnings and the advertising present on most packs. It imitates +% the original look of packs in the European Union by allowing the +% placement of fancy warnings (e.g. Caution: inflammable device). +% +% An example file example.tex is included in the distribution. +% +% The package is loaded with |\usepackage{zigarettenschachtelhuellenzeichnung}| +% between the |\documentclass{...}| and the |\begin{document}|. +% +% A cigarette pack is then obtained with +% \begin{verbatim} +% \begin{zigarettenschachtelhuelle}[<pack>] +% \frontwarning{Text of the warning on the front side} +% \fronttext{Text on the front side, above the warning frame} +% \ingredients{Text in the left side frame} +% \background{<pgfcolor>} +% \backwarning{Text of the warning on the back side} +% \backtext{Text on the back side, above the warning frame} +% \end{zigarettenschachtelhuelle} +% \end{verbatim} +% +% The default pack is |<pack>=normalpack|. It corresponds to a standard +% hard pack. It is possible to define new pack styles by specifying all +% dimensions: +% +% \begin{verbatim} +% \definepack{<packname>}{ +% \width=<pack width> +% \depth=<pack depth> +% \frontheight=<cover height on the front side> +% \backheight=<cover height on the back side> +% \frontwarningheight=<height of the warning framebox on the front side> +% \backwarningheight=<height of the warning framebox on the back side> +% \ingrendientsheight=<height of the ingredients framebox> +% \framewidth=<thickness of the frame in warning boxes> +% \framesep=<distance between warning text and frame> +% \flapsize=<width of the flaps used to glue the pattern> +% \frontwarningbottommargin= +% \backwarningsidemargin= +% \ingrendientsbottommargin= +% \ingrendientssidemargin= +% \frontwarningsidemargin= +% \backwarningbottommargin= +% \sidemargin=<margin for normal text written on the pack cover> +% \verticalmargin=<top margin for normal text on the pack cover> +% } +% \end{verbatim} +% +% \section{Description of commands} +% +% TBW. +% +% \section{\LaTeX source} +% +% \begin{macrocode} +% Needed packages: calc for dimension calculus, pgf for portable graphics +% and ifthen to use latex-style booleans. +\RequirePackage{calc} +\RequirePackage{pgf} +\RequirePackage{ifthen} +% width of the pack +\newlength\width +% depth of the pack +\newlength\depth +% height of the cover on the front side of the pack +\newlength\frontheight +% height of the cover on the back side of the pack +\newlength\backheight +% flap width +\newlength\flapsize +% width of the black frame of warnings +\newlength\framewidth +% separation between warning text and the black frame +\newlength\framesep +% height, side-margin and bottom margin of the front warning frame +\newlength\frontwarningheight +\newlength\frontwarningsidemargin +\newlength\frontwarningbottommargin +% idem for the back warning frame +\newlength\backwarningheight +\newlength\backwarningsidemargin +\newlength\backwarningbottommargin +% idem for the side frame used as a ingredients listing +\newlength\ingrendientsheight +\newlength\ingrendientssidemargin +\newlength\ingrendientsbottommargin +% side-margin and top margin for displaying text or images on the cover +\newlength\sidemargin +\newlength\verticalmargin +% define a packstyle \definepack{packname}{\width=... \depth=...} +% can be used later with \begin{zigarettenschachtelhuelle}[packname] +\def\@listofpacks{} +\newcommand\definepack[2]{ + \ifthenelse{\equal{\@listofpacks}{}}{\def\@comma{}}{\def{\@comma{,}}} + \edef\@listofpacks{\@listofpacks\@comma#1}% + \expandafter\def\csname #1\endcsname{#2}% +} +% the default pack style is normalpack (20 hard pack) +\definepack{normalpack}{ + \newcommand\warningfont{\sffamily\bfseries} + \renewcommand\textfont{\sffamily} + \ingrendientssidemargin=2mm + \ingrendientsbottommargin=5mm + \ingrendientsheight=22mm + \frontwarningbottommargin=1mm + \frontwarningsidemargin=1mm + \backwarningheight=38mm + \backwarningsidemargin=1mm + \backwarningbottommargin=1mm + \depth=24mm + \width=56mm + \frontheight=62mm + \backheight=76mm + \flapsize=10mm + \framewidth=3mm + \framesep=2.5mm + \sidemargin=3mm + \frontwarningheight=28mm + \verticalmargin=3mm +} +% pack cover is created by an environment +% \begin{zigarettenschachtelhuelle}[packstyle] +% <some dimension and/or font settings> +% <setting of warning messages> +% \end{zigarettenschachtelhuelle} +\newenvironment{zigarettenschachtelhuelle}[1][normalpack]{% + % \frontwarning[fontsize]{text}: set the front warning (and its font size) + \newcommand\frontwarning[2][20pt]{% + \setlength\@frontwarningfs{##1} + \setlength\@frontwarningls{1.14\@frontwarningfs} + \def\@frontwarningtext{##2}% + }\frontwarning{}% + % \fronttext[fontsize]{text}: set the front text (and its font size) + \newcommand\fronttext[2][10pt]{% + \setlength\@fronttextfs{##1} + \setlength\@fronttextls{1.14\@fronttextfs} + \def\@fronttext{##2}% + }\fronttext{}% + % \backwarning[fontsize]{text}: set the back warning (and its font size) + \newcommand\backwarning[2][15pt]{% + \setlength{\@backwarningfs}{##1} + \setlength\@backwarningls{1.14\@backwarningfs} + \def\@backwarningtext{##2}% + }\backwarning{}% + % \backtext[fontsize]{text}: set the back text (and its font size) + \newcommand\backtext[2][10pt]{% + \setlength\@backtextfs{##1} + \setlength\@backtextls{1.14\@backtextfs} + \def\@backtext{##2}% + }\backtext{}% + % \ingredients[fontsize]{text}: set the ingredient list (and its font size) + \newcommand\ingredients[2][5pt]{% + \setlength{\@ingrendientsfs}{##1} + \setlength\@ingrendientsls{1.14\@ingrendientsfs} + \def\@ingredientstext{##2}% + }\ingredients{}% + % \background{pgfcolor}: set the background color + \newcommand\background[1]{\def\@background{##1}}\background{white}% + % look for the pack style in the list of defined ones and + % set the corresponding dimensions + \setboolean{@validpack}{false} + \@for\@packstyle:=\@listofpacks\do{% + \typeout{\@packstyle - #1} + \ifthenelse{\equal{#1}{\@packstyle}}{% + \typeout{ -> OK!} + \csname\@packstyle\endcsname + \setboolean{@validpack}{true} + }{}% + } + \ifthenelse{\boolean{@validpack}}{}{% + \@latexerr{Not a valid pack type: #1}% + } +}{% + % coordinates of template vertices. (see template below) + % N________N + % /| |\ + % / | | \ + % P________O/r | | \L__ + % | | i | | l | f\K + % | back | g | front | e | l | + % | | h | | f | a | + % | | t | | t | p J + % A--------B---C--------H---I--/ + % | bottom | + % D--------G + % | flap | + % \E------F/ + \parindent=0pt + \setlength\@xA{0cm}\setlength\@yA{0cm} + \setlength\@xB{\width}\setlength\@yB{0cm} + \setlength\@xC{\width+\depth}\setlength\@yC{0cm} + \setlength\@xD{\width+\depth}\setlength\@yD{-\depth} + \setlength\@xE{\width+\depth+0.5\flapsize}\setlength\@yE{-\depth-\flapsize} + \setlength\@xF{2\width+\depth-0.5\flapsize}\setlength\@yF{-\depth-\flapsize} + \setlength\@xG{2\width+\depth}\setlength\@yG{-\depth} + \setlength\@xH{2\width+\depth}\setlength\@yH{0cm} + \setlength\@xI{2\width+2\depth}\setlength\@yI{0cm} + \setlength\@xJ{2\width+2\depth+\flapsize}\setlength\@yJ{0.5\flapsize} + \setlength\@xK{2\width+2\depth+\flapsize}\setlength\@yK{\backheight-0.5\flapsize} + \setlength\@xL{2\width+2\depth}\setlength\@yL{\backheight} + \setlength\@xM{2\width+\depth}\setlength\@yM{\frontheight} + \setlength\@xN{\width+\depth}\setlength\@yN{\frontheight} + \setlength\@xO{\width}\setlength\@yO{\backheight} + \setlength\@xP{0cm}\setlength\@yP{\backheight} + % drawing + \begin{pgfpicture}{0cm}{\@yE}{\@xK}{\@yO} + % draw template outline + \begin{pgfscope} + \color{\@background} + \pgfmoveto{\pgfpoint\@xA\@yA}\pgflineto{\pgfpoint\@xB\@yB} + \pgflineto{\pgfpoint\@xD\@yC}\pgflineto{\pgfpoint\@xD\@yD} + \pgflineto{\pgfpoint\@xE\@yE}\pgflineto{\pgfpoint\@xF\@yF} + \pgflineto{\pgfpoint\@xG\@yG}\pgflineto{\pgfpoint\@xH\@yH} + \pgflineto{\pgfpoint\@xI\@yI}\pgflineto{\pgfpoint\@xJ\@yJ} + \pgflineto{\pgfpoint\@xK\@yK}\pgflineto{\pgfpoint\@xL\@yL} + \pgflineto{\pgfpoint\@xM\@yM}\pgflineto{\pgfpoint\@xN\@yN} + \pgflineto{\pgfpoint\@xO\@yO}\pgflineto{\pgfpoint\@xP\@yP} + \pgffillstroke + \end{pgfscope} + % draw folding lines + \color{black} + \pgfline{\pgfpoint\@xB\@yB}{\pgfpoint\@xO\@yO} + \pgfline{\pgfpoint\@xC\@yC}{\pgfpoint\@xN\@yN} + \pgfline{\pgfpoint\@xH\@yH}{\pgfpoint\@xM\@yM} + \pgfline{\pgfpoint\@xI\@yI}{\pgfpoint\@xL\@yL} + \pgfline{\pgfpoint\@xC\@yC}{\pgfpoint\@xH\@yH} + \pgfline{\pgfpoint\@xD\@yD}{\pgfpoint\@xG\@yG} + % position warning frames + \begin{pgfscope} + \fontsize{\@frontwarningfs}{\@frontwarningls} + \@smashbox\@xC\@yC\frontwarningsidemargin\frontwarningbottommargin\width\frontwarningheight\@frontwarningtext + \fontsize{\@ingrendientsfs}{\@ingrendientsls} + \@smashbox\@xB\@yB\ingrendientssidemargin\ingrendientsbottommargin\depth\ingrendientsheight\@ingredientstext + \fontsize{\@backwarningfs}{\@backwarningls} + \@smashbox\@xA\@yA\backwarningsidemargin\backwarningbottommargin\width\backwarningheight\@backwarningtext + \end{pgfscope} + % position additional text + \fontsize{\@fronttextfs}{\@fronttextls} + \@smashtext\@xN\@yN\sidemargin\verticalmargin\width\@fronttext + \fontsize{\@backtextfs}{\@backtextls} + \@smashtext\@xP\@yP\sidemargin\verticalmargin\width\@backtext + \end{pgfpicture} +} +% internal use +\newlength\@tmplen +\newlength\@fronttextls +\newlength\@backtextls +\newlength\@fronttextfs +\newlength\@backtextfs +\newlength\@frontwarningfs +\newlength\@backwarningfs +\newlength\@ingrendientsfs +\newlength\@frontwarningls +\newlength\@backwarningls +\newlength\@ingrendientsls +\newlength\@xA\newlength\@yA +\newlength\@xB\newlength\@yB +\newlength\@xC\newlength\@yC +\newlength\@xD\newlength\@yD +\newlength\@xE\newlength\@yE +\newlength\@xF\newlength\@yF +\newlength\@xG\newlength\@yG +\newlength\@xH\newlength\@yH +\newlength\@xI\newlength\@yI +\newlength\@xJ\newlength\@yJ +\newlength\@xK\newlength\@yK +\newlength\@xL\newlength\@yL +\newlength\@xM\newlength\@yM +\newlength\@xN\newlength\@yN +\newlength\@xO\newlength\@yO +\newlength\@xP\newlength\@yP +\newlength\@xbl\newlength\@ybl +\newlength\@xtl\newlength\@ytl +\newlength\@xwd\newlength\@yht +\newlength\@wd\newlength\@ht +% smash a text around top-left corner (#1, #2) with margin (#3, #4) +% and dimensions #5x#6. Text is #7 +\def\@smashtext#1#2#3#4#5#6{ + \@tmplen=#3 + \setlength\@xbl{#1+#3}\setlength\@ybl{#2-#4} + \setlength\@xwd{#5-2\@tmplen} + \pgfputat{\pgfpoint{\@xbl}{\@ybl}}{% + \pgfbox[top,left]{\parbox[t]{\@xwd}{\vglue 0pt\textfont #6}}% + }% +} +% smash a frame box around bottom-left corner (#1,#2) with offset (#3,#4) +% and width #5. The text is #6. +\def\@smashbox#1#2#3#4#5#6#7{% + % black frame + \color{black} + \@tmplen=#3 + \setlength\@xbl{#1+#3}\setlength\@ybl{#2+#4} + \setlength\@xwd{#5-2\@tmplen}\setlength\@yht{#6} + \pgfrect[fill]{\pgfpoint\@xbl\@ybl}{\pgfpoint\@xwd\@yht} + % white bg in frame + \color{white} + \setlength\@xbl{\@xbl+\framewidth}\setlength\@ybl{\@ybl+\framewidth}% + \setlength\@xwd{\@xwd-2\framewidth}\setlength\@yht{\@yht-2\framewidth}% + \pgfrect[fill]{\pgfpoint\@xbl\@ybl}{\pgfpoint\@xwd\@yht}% + % text + \color{black} + \setlength\@xbl{\@xbl+\framesep}\setlength\@ybl{\@ybl+\framesep}% + \setlength\@xwd{\@xwd-2\framesep}% + \pgfputat{\pgfpoint{\@xbl}{\@ybl}}{% + \pgfbox[left,bottom]{\parbox[b]{\@xwd}{\centering\warningfont #7\vglue 0pt}}% + }% +} +% +\newboolean{@validpack} +% \end{macrocode} +% +%\Finale +\endinput diff --git a/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.ins b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.ins new file mode 100644 index 0000000000..5822f70657 --- /dev/null +++ b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.ins @@ -0,0 +1,28 @@ +%% +%% Copyright (C) 2005 by Regis Lachaume +%% +%% Released in the public domain +\input docstrip.tex +\keepsilent +\preamble +This is a generated file + +Copyright (C) 2005 by Regis Lachaume + +Released in the public domain. +\endpreamble +\generate{\file{zigarettenschachtelhuellenzeichnung.sty}{\from{zigarettenschachtelhuellenzeichnung.dtx}{package}}} +\obeyspaces +\Msg{**************************************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the following file into a *} +\Msg{* a directory looked for by LaTeX: *} +\Msg{* *} +\Msg{* zigarettenschachtelhuellenzeichnung.sty *} +\Msg{* *} +\Msg{* To produce the documentation file run *} +\Msg{* *} +\Msg{* pdflatex zigarettenschachtelhuellenzeichnung.dtx *} +\Msg{* *} +\Msg{**************************************************************************} +\endbatchfile diff --git a/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.pdf b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.pdf Binary files differnew file mode 100644 index 0000000000..9992b26a2f --- /dev/null +++ b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.pdf diff --git a/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.sty b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.sty new file mode 100644 index 0000000000..b5e0da4caf --- /dev/null +++ b/graphics/zigaretten/zigarettenschachtelhuellenzeichnung.sty @@ -0,0 +1,245 @@ +%% +%% This is file `zigarettenschachtelhuellenzeichnung.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% zigarettenschachtelhuellenzeichnung.dtx (with options: `package') +%% This is a generated file +%% +%% Copyright (C) 2005 by Regis Lachaume +%% +%% Released in the public domain. +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{zigarettenschachtelhuellenzeichnung} + [2005/04/29 Zigarettenschachtelhuellenzeichnung mit LaTeX - Drawing of cigarette pack covers with LaTeX] +\RequirePackage{calc} +\RequirePackage{pgf} +\RequirePackage{ifthen} +\newlength\width +\newlength\depth +\newlength\frontheight +\newlength\backheight +\newlength\flapsize +\newlength\framewidth +\newlength\framesep +\newlength\frontwarningheight +\newlength\frontwarningsidemargin +\newlength\frontwarningbottommargin +\newlength\backwarningheight +\newlength\backwarningsidemargin +\newlength\backwarningbottommargin +\newlength\ingrendientsheight +\newlength\ingrendientssidemargin +\newlength\ingrendientsbottommargin +\newlength\sidemargin +\newlength\verticalmargin +\def\@listofpacks{} +\newcommand\definepack[2]{ + \ifthenelse{\equal{\@listofpacks}{}}{\def\@comma{}}{\def{\@comma{,}}} + \edef\@listofpacks{\@listofpacks\@comma#1}% + \expandafter\def\csname #1\endcsname{#2}% +} +\definepack{normalpack}{ + \newcommand\warningfont{\sffamily\bfseries} + \renewcommand\textfont{\sffamily} + \ingrendientssidemargin=2mm + \ingrendientsbottommargin=5mm + \ingrendientsheight=22mm + \frontwarningbottommargin=1mm + \frontwarningsidemargin=1mm + \backwarningheight=38mm + \backwarningsidemargin=1mm + \backwarningbottommargin=1mm + \depth=24mm + \width=56mm + \frontheight=62mm + \backheight=76mm + \flapsize=10mm + \framewidth=3mm + \framesep=2.5mm + \sidemargin=3mm + \frontwarningheight=28mm + \verticalmargin=3mm +} +\newenvironment{zigarettenschachtelhuelle}[1][normalpack]{% + % \frontwarning[fontsize]{text}: set the front warning (and its font size) + \newcommand\frontwarning[2][20pt]{% + \setlength\@frontwarningfs{##1} + \setlength\@frontwarningls{1.14\@frontwarningfs} + \def\@frontwarningtext{##2}% + }\frontwarning{}% + % \fronttext[fontsize]{text}: set the front text (and its font size) + \newcommand\fronttext[2][10pt]{% + \setlength\@fronttextfs{##1} + \setlength\@fronttextls{1.14\@fronttextfs} + \def\@fronttext{##2}% + }\fronttext{}% + % \backwarning[fontsize]{text}: set the back warning (and its font size) + \newcommand\backwarning[2][15pt]{% + \setlength{\@backwarningfs}{##1} + \setlength\@backwarningls{1.14\@backwarningfs} + \def\@backwarningtext{##2}% + }\backwarning{}% + % \backtext[fontsize]{text}: set the back text (and its font size) + \newcommand\backtext[2][10pt]{% + \setlength\@backtextfs{##1} + \setlength\@backtextls{1.14\@backtextfs} + \def\@backtext{##2}% + }\backtext{}% + % \ingredients[fontsize]{text}: set the ingredient list (and its font size) + \newcommand\ingredients[2][5pt]{% + \setlength{\@ingrendientsfs}{##1} + \setlength\@ingrendientsls{1.14\@ingrendientsfs} + \def\@ingredientstext{##2}% + }\ingredients{}% + % \background{pgfcolor}: set the background color + \newcommand\background[1]{\def\@background{##1}}\background{white}% + % look for the pack style in the list of defined ones and + % set the corresponding dimensions + \setboolean{@validpack}{false} + \@for\@packstyle:=\@listofpacks\do{% + \typeout{\@packstyle - #1} + \ifthenelse{\equal{#1}{\@packstyle}}{% + \typeout{ -> OK!} + \csname\@packstyle\endcsname + \setboolean{@validpack}{true} + }{}% + } + \ifthenelse{\boolean{@validpack}}{}{% + \@latexerr{Not a valid pack type: #1}% + } +}{% + % coordinates of template vertices. (see template below) + % N________N + % /| |\ + % / | | \ + % P________O/r | | \L__ + % | | i | | l | f\K + % | back | g | front | e | l | + % | | h | | f | a | + % | | t | | t | p J + % A--------B---C--------H---I--/ + % | bottom | + % D--------G + % | flap | + % \E------F/ + \parindent=0pt + \setlength\@xA{0cm}\setlength\@yA{0cm} + \setlength\@xB{\width}\setlength\@yB{0cm} + \setlength\@xC{\width+\depth}\setlength\@yC{0cm} + \setlength\@xD{\width+\depth}\setlength\@yD{-\depth} + \setlength\@xE{\width+\depth+0.5\flapsize}\setlength\@yE{-\depth-\flapsize} + \setlength\@xF{2\width+\depth-0.5\flapsize}\setlength\@yF{-\depth-\flapsize} + \setlength\@xG{2\width+\depth}\setlength\@yG{-\depth} + \setlength\@xH{2\width+\depth}\setlength\@yH{0cm} + \setlength\@xI{2\width+2\depth}\setlength\@yI{0cm} + \setlength\@xJ{2\width+2\depth+\flapsize}\setlength\@yJ{0.5\flapsize} + \setlength\@xK{2\width+2\depth+\flapsize}\setlength\@yK{\backheight-0.5\flapsize} + \setlength\@xL{2\width+2\depth}\setlength\@yL{\backheight} + \setlength\@xM{2\width+\depth}\setlength\@yM{\frontheight} + \setlength\@xN{\width+\depth}\setlength\@yN{\frontheight} + \setlength\@xO{\width}\setlength\@yO{\backheight} + \setlength\@xP{0cm}\setlength\@yP{\backheight} + % drawing + \begin{pgfpicture}{0cm}{\@yE}{\@xK}{\@yO} + % draw template outline + \begin{pgfscope} + \color{\@background} + \pgfmoveto{\pgfpoint\@xA\@yA}\pgflineto{\pgfpoint\@xB\@yB} + \pgflineto{\pgfpoint\@xD\@yC}\pgflineto{\pgfpoint\@xD\@yD} + \pgflineto{\pgfpoint\@xE\@yE}\pgflineto{\pgfpoint\@xF\@yF} + \pgflineto{\pgfpoint\@xG\@yG}\pgflineto{\pgfpoint\@xH\@yH} + \pgflineto{\pgfpoint\@xI\@yI}\pgflineto{\pgfpoint\@xJ\@yJ} + \pgflineto{\pgfpoint\@xK\@yK}\pgflineto{\pgfpoint\@xL\@yL} + \pgflineto{\pgfpoint\@xM\@yM}\pgflineto{\pgfpoint\@xN\@yN} + \pgflineto{\pgfpoint\@xO\@yO}\pgflineto{\pgfpoint\@xP\@yP} + \pgffillstroke + \end{pgfscope} + % draw folding lines + \color{black} + \pgfline{\pgfpoint\@xB\@yB}{\pgfpoint\@xO\@yO} + \pgfline{\pgfpoint\@xC\@yC}{\pgfpoint\@xN\@yN} + \pgfline{\pgfpoint\@xH\@yH}{\pgfpoint\@xM\@yM} + \pgfline{\pgfpoint\@xI\@yI}{\pgfpoint\@xL\@yL} + \pgfline{\pgfpoint\@xC\@yC}{\pgfpoint\@xH\@yH} + \pgfline{\pgfpoint\@xD\@yD}{\pgfpoint\@xG\@yG} + % position warning frames + \begin{pgfscope} + \fontsize{\@frontwarningfs}{\@frontwarningls} + \@smashbox\@xC\@yC\frontwarningsidemargin\frontwarningbottommargin\width\frontwarningheight\@frontwarningtext + \fontsize{\@ingrendientsfs}{\@ingrendientsls} + \@smashbox\@xB\@yB\ingrendientssidemargin\ingrendientsbottommargin\depth\ingrendientsheight\@ingredientstext + \fontsize{\@backwarningfs}{\@backwarningls} + \@smashbox\@xA\@yA\backwarningsidemargin\backwarningbottommargin\width\backwarningheight\@backwarningtext + \end{pgfscope} + % position additional text + \fontsize{\@fronttextfs}{\@fronttextls} + \@smashtext\@xN\@yN\sidemargin\verticalmargin\width\@fronttext + \fontsize{\@backtextfs}{\@backtextls} + \@smashtext\@xP\@yP\sidemargin\verticalmargin\width\@backtext + \end{pgfpicture} +} +\newlength\@tmplen +\newlength\@fronttextls +\newlength\@backtextls +\newlength\@fronttextfs +\newlength\@backtextfs +\newlength\@frontwarningfs +\newlength\@backwarningfs +\newlength\@ingrendientsfs +\newlength\@frontwarningls +\newlength\@backwarningls +\newlength\@ingrendientsls +\newlength\@xA\newlength\@yA +\newlength\@xB\newlength\@yB +\newlength\@xC\newlength\@yC +\newlength\@xD\newlength\@yD +\newlength\@xE\newlength\@yE +\newlength\@xF\newlength\@yF +\newlength\@xG\newlength\@yG +\newlength\@xH\newlength\@yH +\newlength\@xI\newlength\@yI +\newlength\@xJ\newlength\@yJ +\newlength\@xK\newlength\@yK +\newlength\@xL\newlength\@yL +\newlength\@xM\newlength\@yM +\newlength\@xN\newlength\@yN +\newlength\@xO\newlength\@yO +\newlength\@xP\newlength\@yP +\newlength\@xbl\newlength\@ybl +\newlength\@xtl\newlength\@ytl +\newlength\@xwd\newlength\@yht +\newlength\@wd\newlength\@ht +\def\@smashtext#1#2#3#4#5#6{ + \@tmplen=#3 + \setlength\@xbl{#1+#3}\setlength\@ybl{#2-#4} + \setlength\@xwd{#5-2\@tmplen} + \pgfputat{\pgfpoint{\@xbl}{\@ybl}}{% + \pgfbox[top,left]{\parbox[t]{\@xwd}{\vglue 0pt\textfont #6}}% + }% +} +\def\@smashbox#1#2#3#4#5#6#7{% + % black frame + \color{black} + \@tmplen=#3 + \setlength\@xbl{#1+#3}\setlength\@ybl{#2+#4} + \setlength\@xwd{#5-2\@tmplen}\setlength\@yht{#6} + \pgfrect[fill]{\pgfpoint\@xbl\@ybl}{\pgfpoint\@xwd\@yht} + % white bg in frame + \color{white} + \setlength\@xbl{\@xbl+\framewidth}\setlength\@ybl{\@ybl+\framewidth}% + \setlength\@xwd{\@xwd-2\framewidth}\setlength\@yht{\@yht-2\framewidth}% + \pgfrect[fill]{\pgfpoint\@xbl\@ybl}{\pgfpoint\@xwd\@yht}% + % text + \color{black} + \setlength\@xbl{\@xbl+\framesep}\setlength\@ybl{\@ybl+\framesep}% + \setlength\@xwd{\@xwd-2\framesep}% + \pgfputat{\pgfpoint{\@xbl}{\@ybl}}{% + \pgfbox[left,bottom]{\parbox[b]{\@xwd}{\centering\warningfont #7\vglue 0pt}}% + }% +} +\newboolean{@validpack} +\endinput +%% +%% End of file `zigarettenschachtelhuellenzeichnung.sty'. |