summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-05-05 18:30:30 +0000
committerKarl Berry <karl@freefriends.org>2008-05-05 18:30:30 +0000
commitd3bc7c656ca1b93595bf7a5feb4f748914a47628 (patch)
treeeb62614420298b366175b242569a2f99202f1b49 /Master/texmf-dist
parent3e59d234a04a1e8b8301aa11de49208208eb4e9f (diff)
new latex package petiteannonce (3may08)
git-svn-id: svn://tug.org/texlive/trunk@7866 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rwxr-xr-xMaster/texmf-dist/doc/latex/petiteannonce/baignoire.JPGbin0 -> 36476 bytes
-rwxr-xr-xMaster/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdfbin0 -> 111514 bytes
-rwxr-xr-xMaster/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex88
-rwxr-xr-xMaster/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdfbin0 -> 60734 bytes
-rw-r--r--Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex34
-rwxr-xr-xMaster/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls289
6 files changed, 411 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/baignoire.JPG b/Master/texmf-dist/doc/latex/petiteannonce/baignoire.JPG
new file mode 100755
index 00000000000..95c9c7d3dda
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/petiteannonce/baignoire.JPG
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf
new file mode 100755
index 00000000000..189a0be1b96
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex
new file mode 100755
index 00000000000..effea976752
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex
@@ -0,0 +1,88 @@
+\documentclass{article}
+\usepackage{pdfpages,fancyvrb}
+\title{Petiteannonce package documentation}
+\author{Vincent Bela\"\i che}
+\begin{document}
+
+\maketitle
+\section{Introduction}
+This is the documentation of the petiteannonce package. The aim of this package is to
+make adverts that you would pin down on some notice board in a mall with your
+phone number repeated on strips. This practice is quite common in France as it
+is simple, cheap (no fee for intermediates like eBay\texttrademark),
+and allows you to reach people in the same neighbourhood (so no need for
+postal fee either).
+
+\section{Commands}
+
+There are two commands the \verb!\petiteannonce! command and the \verb!\petiteannoncewidth!
+command.
+
+\subsection{The \textbackslash petiteannonce command}
+
+The \verb!\petiteannonce! command is used to create the advertisement. It takes two
+mandatory arguments and one optional argument.
+\begin{itemize}
+\item The 1\textsuperscript{st} mandatory argument is the phone number or
+ email address where to reach the seller.
+\item The 2\textsuperscript{nd} mandatory argument is the text of the advert itself
+\item The optional argument is a list of comma separated \(<\textit
+ key\/>=<\textit{value\/}>\) arguments that allows to configure a number of
+ additional things. Absence of the key is equivalent to setting it to its
+ default value. The supported keys are the following:
+ \begin{list}{}{}
+ \item [cols] positive integer with default value 1. Specifies the
+ number of columns of the document that is used to compute the width of
+ the advert. When the advert is repeated, a new paragraph is generated
+ every {\em cols\/} columns.
+ \item [count] positive integer with default value 1. Tells the number of
+ times the advert is repeated.
+ \item [cutvspace] dimension with default value 10pt. Tell the vertical space
+ under to horizontal dotted line that is provided for cutting one strip.
+ \item [skip] non negative integers with default value 0. The value shall be
+ less than {\em cols\/}. Specifies that the first {\em skip\/}
+ advert are not generated. This may be useful when you want to make several
+ adverts in the same document.
+ \item [texthspace] dimension with default value 20pt. This key allows to
+ specify the space evenly placed before and after advert text.
+ \item [texthspace] dimension with default value 10pt. This key allows to
+ specify the space evenly placed above and below text.
+ \item [telcolsep] dimension with default value 10pt. This key allows to
+ specify the separation between to telephone strips, that is to say the
+ horizontal space between the telephone numbers.
+ \item [telrulewidth] dimension with default value 0.5pt. Width of the
+ vertical rule separating two telephone strips.
+ \item [telvspace] dimension with default value 10pt. Vertical space shared
+ equally above and below the telephone number in the strip (this space is
+ one the before and after the number if you look at the strip horizontally).
+ \item [width] dimension with default value \verb!\textwidth!. Overloads the value
+ computed with {\em cols\/}. In such a case take care to place the {\em
+ width\/} argument after the {\em cols\/} argument.
+ \end{list}
+\end{itemize}
+
+\subsection{The \textbackslash petiteannoncewidth command}
+
+The \verb!\petiteannoncewidth! command takes one argument \#1 and expands into
+\#1 \(\times\) the width of the advert. This is useful when you use a tabular
+to make the text of the advert.
+
+\section{Sample code}
+
+The following sample code will expand into the advertisement page at the page
+this sample code.
+
+
+\VerbatimInput{petiteannonceexample.tex}
+
+
+
+\includepdf{petiteannonceexample}
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-PDF-mode: t
+%%% TeX-master: t
+%%% End:
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf
new file mode 100755
index 00000000000..1ff5b4025c3
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex
new file mode 100644
index 00000000000..4cc2aa8f977
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex
@@ -0,0 +1,34 @@
+\documentclass{petiteannonce}
+\usepackage{SIunits}
+\usepackage{graphicx}
+\usepackage{array}
+\usepackage{eurosym}
+\begin{document}
+
+
+\petiteannonce[count=4,cols=2]%
+{02 99 yy yy yy}
+{%
+ \begin{tabular}%
+{m{\petiteannoncewidth{0.48}}m{\petiteannoncewidth{0.02}}m{\petiteannoncewidth{0.5}}}
+ \multicolumn{3}{c}{\Large \dotfill Vend Baignoire enfant \dotfill }\\
+ \hline\\
+ Vend baignoire enfant.\newline
+ Dimensions \(\unit {80}{\centi \metre }\times \unit
+ {30}{\centi \metre }\)\newline
+ Prix 20~\euro
+ &&
+ \includegraphics{baignoire.jpg}
+ \end{tabular}
+}
+
+
+
+
+\end{document}
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% TeX-PDF-mode: t
+%%% End:
diff --git a/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls b/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls
new file mode 100755
index 00000000000..32c46e6bac7
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls
@@ -0,0 +1,289 @@
+% %NAME% : Petiteannonce
+% %AUTHOR% : Vincent Bela\"\i che
+% %EMAIL% : vincent.b.1@hotmail.fr
+% %VERSION% : v0.001
+%%
+%% This is file `petiteannonce.cls'.
+%%
+%%
+%% IMPORTANT NOTICE:
+%%
+%% This file is part of the "petiteannonce" package.
+%% This package is distributed under the terms of the LaTeX Project
+%% Public License (LPPL) described in the file lppl.txt.
+%%
+%% Ce fichier fait partie de la distribution du paquetage "petiteannonce".
+%% Ce paquetage est distribué sous les termes de la License Publique
+%% du Projet LaTeX (LPPL) décrite dans le fichier lppl.txt.
+%%
+%
+% ****************************************
+% * PREAMBULE *
+% ****************************************
+%
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{graphicx}
+\RequirePackage{keyval}
+\ProvidesClass{petiteannonce}[2008/0/22 v0.001]
+% Get font sizes
+\makeatletter
+\newcommand\@ptsize{}
+\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+
+%\typeout{}
+%% petiteannonce options
+%\DeclareOption{someoption}{do something}
+\ExecuteOptions{10pt}
+\ProcessOptions
+\input{size1\@ptsize.clo}
+%
+% ****************************************
+% * POLICES *
+% ****************************************
+%
+\DeclareOldFontCommand{\rm}{\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sl}{\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\it}{\itshape}{\mathit}
+\DeclareOldFontCommand{\sc}{\scshape}{\@nomath\sc}
+\DeclareOldFontCommand{\bf}{\bfseries}{\mathbf}
+\DeclareOldFontCommand{\sf}{\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\ttfamily}{\mathtt}
+\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
+\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
+
+
+%
+% ****************************************
+% * MISE-EN-PAGE : parametres *
+% ****************************************
+%
+\newdimen\petiteannonce@margin
+\petiteannonce@margin=1mm
+\topmargin =\petiteannonce@margin% marge sup.
+% suppression de l'offset vertical
+\advance\topmargin by -1in
+\headheight 0pt% entete
+\headsep 0mm% sep. d'entete
+\textheight 297mm
+\advance\textheight by -2\petiteannonce@margin% hauteur texte
+\footskip 0mm% sep d'embase
+%
+% total vertical 1+0+295+0=296 mm, reste 1 mm sur A4 = 297 mm.
+%
+\footnotesep 0mm%
+\marginparpush 0mm%
+%
+% marge gauche
+\oddsidemargin =\petiteannonce@margin%
+\evensidemargin =\petiteannonce@margin%
+% suppression de l'offset horizontal
+\advance \oddsidemargin by -1in%
+\advance \evensidemargin by -1in%
+\textwidth 210mm
+\advance\textwidth by -2\petiteannonce@margin%largeur texte
+\marginparsep 0mm% separation note lat\'erale
+\marginparwidth 0mm% largeur note latérale
+%
+% total horizontal 1+208+0+0=209 mm, reste 1 mm sur A4 = 210 mm.
+%
+\skip\footins 4mm plus 2pt minus 4pt%
+\pagestyle{empty}
+
+% objects for keyval-ed arguments
+\newcount \petiteannonce@cols
+\newcount \petiteannonce@count
+\newcount \petiteannonce@skip
+\newdimen \petiteannonce@cutvspace
+\newdimen \petiteannonce@telcolsep % separation between telephone columns
+\newdimen \petiteannonce@telrulewidth
+\newdimen \petiteannonce@telvspace % space before and after telephone number
+\newdimen \petiteannonce@texthspace % space before and after text
+\newdimen \petiteannonce@textvspace % space above and below text
+\newdimen \petiteannonce@width
+% ============================================================================
+% Define keys and their default values
+% ============================================================================
+\define@key{petiteannonce}{cols}[1]{%
+ \petiteannonce@cols=#1%
+ \petiteannonce@width=\textwidth%
+ \divide\petiteannonce@width by \petiteannonce@cols%
+}
+\define@key{petiteannonce}{count}[1]{\petiteannonce@count=#1}
+\define@key{petiteannonce}{cutvspace}[10pt]{\petiteannonce@cutvspace=#1}
+\define@key{petiteannonce}{skip}[0]{\petiteannonce@skip=#1}
+\define@key{petiteannonce}{telcolsep}[10pt]{\petiteannonce@telcolsep=#1}
+\define@key{petiteannonce}{telrulewidth}[0.5pt]{\petiteannonce@telrulewidth=#1}
+\define@key{petiteannonce}{telvspace}[10pt]{\petiteannonce@telvspace=#1}
+\define@key{petiteannonce}{textvspace}[10pt]{\petiteannonce@textvspace=#1}
+\define@key{petiteannonce}{texthspace}[20pt]{\petiteannonce@texthspace=#1}
+\define@key{petiteannonce}{width}[\textwidth]{\petiteannonce@width=#1}
+% other objects for dimensions
+\newcount \petiteannonce@telcount@temp
+\newdimen \petiteannonce@half@colsep
+\newdimen \petiteannonce@half@colsep@worule % without rule
+\newdimen \petiteannonce@half@telvspace
+\newdimen \petiteannonce@half@texthspace
+\newdimen \petiteannonce@half@textvspace
+\newdimen \petiteannonce@telheight% width of telephone number when horizontal + hspace
+\newdimen \petiteannonce@telwidth % total = height + depth of telephone number when horizontal
+\newdimen \petiteannonce@telwidth@temp
+\newdimen \petiteannonce@textwidth
+\newdimen \petiteannonce@width@min@colsep % width reduced by column separator.
+% counters for counting telephone number strips
+\newcount \petiteannonce@telcount
+\newcount \petiteannonce@telcount@minone % same as above minus 1
+% counters for counting petiteannonce
+\newcount \petiteannonce@count@temp
+\newcount \petiteannonce@col@temp
+% boxes
+\newsavebox{\petiteannonce@telbox}
+\newsavebox{\petiteannonce@box}
+\newsavebox{\petiteannonce@tel}
+
+% ==============================================================================
+% The \petiteannonce command:
+%
+% Arg 1 = Telephone number
+% Arg 2 = Advertisement text
+% Arg 3 (optional) = Option keys
+% ==============================================================================
+\newcommand\petiteannonce[3][]{%
+ % Omitting keyed arguments is same as setting them to their default values
+ \KV@petiteannonce@cols@default{}%
+ \KV@petiteannonce@count@default{}%
+ \KV@petiteannonce@cutvspace@default{}%
+ \KV@petiteannonce@skip@default{}%
+ \KV@petiteannonce@telcolsep@default{}%
+ \KV@petiteannonce@telrulewidth@default{}%
+ \KV@petiteannonce@telvspace@default{}%
+ \KV@petiteannonce@texthspace@default{}%
+ \KV@petiteannonce@textvspace@default{}%
+ \KV@petiteannonce@width@default{}%
+ % parse keyed arguments
+ \setkeys{petiteannonce}{#1}%
+ % consistency checks
+ \ifnum\petiteannonce@cols<1\relax%
+ \ClassError{petiteannonce}%
+ {non positive cols key value}%
+ {The value of key cols shall be positive;\MessageBreak
+ cols value will be forced to 1.}%
+ \petiteannonce@cols=1
+ \fi%
+ % consistency check is To Be Compeleted
+ \petiteannonce@width@min@colsep=\petiteannonce@width%
+ \advance\petiteannonce@width@min@colsep by -\petiteannonce@telcolsep%
+ % compute half values and other temporary dimensions and counters
+ \petiteannonce@textwidth=\petiteannonce@width%
+ \advance\petiteannonce@textwidth by -\petiteannonce@texthspace%
+ \petiteannonce@half@texthspace=\petiteannonce@texthspace%
+ \divide\petiteannonce@half@texthspace by 2%
+ \petiteannonce@half@textvspace=\petiteannonce@textvspace%
+ \divide\petiteannonce@half@textvspace by 2%
+ \petiteannonce@half@colsep=\petiteannonce@telcolsep%
+ \divide\petiteannonce@half@colsep by 2%
+ \petiteannonce@half@colsep@worule=\petiteannonce@telcolsep%
+ \divide\petiteannonce@half@colsep@worule by 2%
+ \advance\petiteannonce@half@colsep@worule by -\petiteannonce@telrulewidth%
+ \petiteannonce@half@telvspace=\petiteannonce@telvspace%
+ \divide\petiteannonce@half@telvspace by 2%
+ %
+ \sbox{\petiteannonce@tel}{\mbox{#2}}%
+ \def\petiteannonce@text{%
+ \hspace{\petiteannonce@half@texthspace}%
+ \begin{minipage}{\petiteannonce@textwidth}%
+ #3%
+ \end{minipage}%
+ \hspace{\petiteannonce@half@texthspace}%
+ }%
+ % compute tel dimension
+ % ------------------------------
+ %
+ % tel-width = total height+depth when looked at horizontally
+ % this is a first approximate that is going to be refined later on
+ \settoheight{\petiteannonce@telwidth}{\usebox{\petiteannonce@tel}}%
+ \settodepth{\petiteannonce@telwidth@temp}{\usebox{\petiteannonce@tel}}%
+ \advance\petiteannonce@telwidth by \petiteannonce@telwidth@temp%
+ % tel-height = width when looked at horizontally + some vspace
+ \settowidth{\petiteannonce@telheight}{\usebox{\petiteannonce@tel}}
+ \advance\petiteannonce@telheight by \petiteannonce@telvspace
+ % compute into \petiteannonce@telwidth@temp the number of columns (as a real number)
+ \advance\petiteannonce@telwidth by \petiteannonce@telcolsep
+ \petiteannonce@telwidth@temp=\petiteannonce@width%
+ %\advance\petiteannonce@telwidth@temp by \petiteannonce@telcolsep
+ \divide\petiteannonce@telwidth@temp by \petiteannonce@telwidth
+ \petiteannonce@telcount=\petiteannonce@telwidth@temp % floor
+ % column count - 1
+ \petiteannonce@telcount@minone=\petiteannonce@telcount
+ \advance\petiteannonce@telcount@minone by -1
+ % refine tel width now
+ \petiteannonce@telwidth@temp=\petiteannonce@telcolsep
+ \multiply\petiteannonce@telwidth@temp by \petiteannonce@telcount
+ \petiteannonce@telwidth=\petiteannonce@width
+ \advance\petiteannonce@telwidth by - \petiteannonce@telwidth@temp
+ \divide\petiteannonce@telwidth by \petiteannonce@telcount
+ % save the telephone into a box
+ \savebox{\petiteannonce@telbox}[\petiteannonce@telwidth]{%
+ \rotatebox{90}{%
+ \hspace\petiteannonce@half@telvspace\usebox{\petiteannonce@tel}\hspace\petiteannonce@half@telvspace%
+ }%
+ }
+ % define the row of repeated telephone number
+ % -----------------------------------------------
+ \def\petiteannonce@telrow
+ {%
+ \makebox[\petiteannonce@width]{%
+ \hspace\petiteannonce@half@colsep%
+ \usebox{\petiteannonce@telbox}%
+ \petiteannonce@telcount@temp=\petiteannonce@telcount%
+ \loop%
+ \hspace\petiteannonce@half@colsep@worule%
+ \vrule width\petiteannonce@telrulewidth height\petiteannonce@telheight%
+ \hspace\petiteannonce@half@colsep@worule%
+ \usebox{\petiteannonce@telbox}%
+ \advance\petiteannonce@telcount@temp by -1%
+ \ifnum\petiteannonce@telcount@temp>2\repeat\relax%
+ \hspace\petiteannonce@half@colsep%
+ }%
+ }%
+ % now make one petiteannonce
+ \savebox{\petiteannonce@box}[\petiteannonce@width]{%
+ \framebox[\petiteannonce@width]{%
+ \begin{minipage}{\petiteannonce@width}%
+ \vspace{\petiteannonce@half@textvspace}%
+
+ \noindent\petiteannonce@text%
+
+ \vspace{\petiteannonce@half@textvspace}%
+
+ \noindent \hbox to\petiteannonce@width{\dotfill}%
+
+ \vspace{\petiteannonce@cutvspace}%
+
+ \noindent\petiteannonce@telrow%
+ \end{minipage}%
+ }%
+ }%
+ % now the petiteannonce main loop
+ \petiteannonce@count@temp=\petiteannonce@skip%
+ \petiteannonce@col@temp=1%
+ %
+ \noindent%
+ \loop\ifnum\petiteannonce@count@temp<\petiteannonce@count\relax%
+ \usebox{\petiteannonce@box}%
+ \advance\petiteannonce@count@temp by 1%
+ \advance\petiteannonce@col@temp by 1%
+ \ifnum\petiteannonce@col@temp=\petiteannonce@cols\relax%
+ \newline%
+ \petiteannonce@col@temp=1%
+ \fi%
+ \repeat%
+ }%
+
+% The advertwidth command
+\def\petiteannoncewidth#1{#1\petiteannonce@width}
+\makeatother
+%
+%%
+%% End of file `petiteannonce.cls.