summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-11 22:25:57 +0000
committerKarl Berry <karl@freefriends.org>2012-04-11 22:25:57 +0000
commit8ae03ae44ffe043b5be56d464456c3960b5789d1 (patch)
treeb6c87473af1b2363d8a708052d47ef09cd8ee798
parent6111dcd8a191624e4f2757cb6f844b124b658965 (diff)
petiteannonce 1.0001 (11apr12)
git-svn-id: svn://tug.org/texlive/trunk@25915 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdfbin111514 -> 174545 bytes
-rw-r--r--Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex41
-rw-r--r--Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdfbin60734 -> 79209 bytes
-rw-r--r--Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex21
-rw-r--r--Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls85
5 files changed, 94 insertions, 53 deletions
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf
index 189a0be1b96..1ab73120f26 100644
--- a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.pdf
+++ 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
index effea976752..40ded62732f 100644
--- a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonce.doc.tex
@@ -1,5 +1,6 @@
\documentclass{article}
\usepackage{pdfpages,fancyvrb}
+\usepackage{siunitx}
\title{Petiteannonce package documentation}
\author{Vincent Bela\"\i che}
\begin{document}
@@ -13,10 +14,19 @@ 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{Package options}
+
+There is one single class option \verb!margin!, this is used to set the margin value, by default this is
+\SI{1}{\milli\metre}. For instance use:
+
+\verb!\documentclass[margin=3mm]{petiteannonce}!
+
+\noindent if you want it to be \SI{3}{\milli\metre} instead of \SI{1}{\milli\metre}.
+
\section{Commands}
-There are two commands the \verb!\petiteannonce! command and the \verb!\petiteannoncewidth!
-command.
+There are three commands the \verb!\petiteannonce! command, the \verb!\petiteannoncewidth!
+command, and the \verb!\petiteannonceaddtowidth! command.
\subsection{The \textbackslash petiteannonce command}
@@ -39,16 +49,16 @@ mandatory arguments and one optional argument.
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
+ \item [skip] non negative integer 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
+ \item [textvspace] 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
+ specify the separation between two 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.
@@ -57,17 +67,28 @@ mandatory arguments and one optional argument.
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.
+ width\/} argument after the {\em cols\/} argument. This specifies the advert total width, including the
+ frame rule width, rule separator, and all the internal spaces.
\end{list}
\end{itemize}
-\subsection{The \textbackslash petiteannoncewidth command}
+\subsection{The \textbackslash petiteannoncewidth and \textbackslash petiteannonceaddtowidth commands}
+
+The \verb!\petiteannoncewidth! command takes one argument \#1 and expands into \#1 \(\times\) the width of the
+advert text. This is useful when you use a tabular to make the text of the advert like in the example given in
+\S~\ref{sec:sample-code}.
+
+The \verb!\petiteannonceaddtowidth! command takes one argument that is some offset to add to the advert
+textwidth. A use of that is given in example of \S~\ref{sec:sample-code}, where the advert text is within an
+array, and one wants to take into account the \verb!\tabcolsep! half column separation.
+
+\subsection{Changing the outside frame}
-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.
+The frame around the advert is generated with a standard \verb!\framebox! command, so you can play with it by
+changing \verb!\fboxsep! and \verb!\fboxrule!.
\section{Sample code}
+\label{sec:sample-code}
The following sample code will expand into the advertisement page at the page
this sample code.
diff --git a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf
index 1ff5b4025c3..38b472971a4 100644
--- a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.pdf
+++ 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
index 4cc2aa8f977..15b2ba6eee1 100644
--- a/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex
+++ b/Master/texmf-dist/doc/latex/petiteannonce/petiteannonceexample.tex
@@ -1,24 +1,25 @@
-\documentclass{petiteannonce}
-\usepackage{SIunits}
+\documentclass[margin=3mm]{petiteannonce}
+\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{array}
\usepackage{eurosym}
\begin{document}
-
-\petiteannonce[count=4,cols=2]%
+\petiteannonce[cols=2, count=4]%
{02 99 yy yy yy}
{%
+ \tabcolsep=10pt\relax
+ \petiteannonceaddtowidth{-2\tabcolsep}%
\begin{tabular}%
-{m{\petiteannoncewidth{0.48}}m{\petiteannoncewidth{0.02}}m{\petiteannoncewidth{0.5}}}
- \multicolumn{3}{c}{\Large \dotfill Vend Baignoire enfant \dotfill }\\
+ {@{}m{\petiteannoncewidth{0.5}}m{\petiteannoncewidth{0.5}}@{}}
+ \multicolumn{2}{@{}c@{}}{\Large \dotfill Vend Baignoire enfant \dotfill }\\
\hline\\
Vend baignoire enfant.\newline
- Dimensions \(\unit {80}{\centi \metre }\times \unit
+ Dimensions \(\SI {80}{\centi \metre }\times \SI
{30}{\centi \metre }\)\newline
- Prix 20~\euro
- &&
- \includegraphics{baignoire.jpg}
+ Prix 20\si{~}\euro
+ &
+ \includegraphics[width=\petiteannoncewidth{0.5}]{baignoire.jpg}
\end{tabular}
}
diff --git a/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls b/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls
index 32c46e6bac7..28a20d4ce93 100644
--- a/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls
+++ b/Master/texmf-dist/tex/latex/petiteannonce/petiteannonce.cls
@@ -1,7 +1,7 @@
% %NAME% : Petiteannonce
% %AUTHOR% : Vincent Bela\"\i che
% %EMAIL% : vincent.b.1@hotmail.fr
-% %VERSION% : v0.001
+% %VERSION% : v1.001
%%
%% This is file `petiteannonce.cls'.
%%
@@ -24,7 +24,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{graphicx}
\RequirePackage{keyval}
-\ProvidesClass{petiteannonce}[2008/0/22 v0.001]
+\ProvidesClass{petiteannonce}[2012/04/10 v1.001]
% Get font sizes
\makeatletter
\newcommand\@ptsize{}
@@ -32,10 +32,20 @@
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+
%\typeout{}
%% petiteannonce options
%\DeclareOption{someoption}{do something}
\ExecuteOptions{10pt}
+
+\newdimen\petiteannonce@margin
+\petiteannonce@margin=1mm
+\define@key{petiteannonce@args}{margin}{\petiteannonce@margin=#1}
+
+\DeclareOption*{%
+ \def\@tempa#1{\setkeys{petiteannonce@args}{#1}}%
+ \expandafter\@tempa\expandafter{\CurrentOption}%
+}
\ProcessOptions
\input{size1\@ptsize.clo}
%
@@ -59,8 +69,6 @@
% * MISE-EN-PAGE : parametres *
% ****************************************
%
-\newdimen\petiteannonce@margin
-\petiteannonce@margin=1mm
\topmargin =\petiteannonce@margin% marge sup.
% suppression de l'offset vertical
\advance\topmargin by -1in
@@ -101,14 +109,19 @@
\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@frame@width
\newdimen \petiteannonce@width
+\newdimen \petiteannonce@this@textwidth
% ============================================================================
% Define keys and their default values
% ============================================================================
\define@key{petiteannonce}{cols}[1]{%
- \petiteannonce@cols=#1%
- \petiteannonce@width=\textwidth%
- \divide\petiteannonce@width by \petiteannonce@cols%
+ \petiteannonce@cols=#1\relax
+ \petiteannonce@frame@width=\textwidth
+ \divide\petiteannonce@frame@width by \petiteannonce@cols
+ \petiteannonce@width=\petiteannonce@frame@width
+ \advance\petiteannonce@width by -2\fboxrule
+ \advance\petiteannonce@width by -2\fboxsep
}
\define@key{petiteannonce}{count}[1]{\petiteannonce@count=#1}
\define@key{petiteannonce}{cutvspace}[10pt]{\petiteannonce@cutvspace=#1}
@@ -118,14 +131,14 @@
\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}
+\define@key{petiteannonce}{width}[\textwidth]{\petiteannonce@frame@width=#1\relax
+ \petiteannonce@width=\petiteannonce@frame@width
+ \advance\petiteannonce@width by -2\fboxrule
+ \advance\petiteannonce@width by -2\fboxsep
+}
% 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
@@ -177,25 +190,16 @@
% 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%
+ \petiteannonce@half@colsep@worule=0.5\petiteannonce@telcolsep%
\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}%
+ \hspace{0.5\petiteannonce@texthspace}%
\begin{minipage}{\petiteannonce@textwidth}%
#3%
\end{minipage}%
- \hspace{\petiteannonce@half@texthspace}%
+ \hspace{0.5\petiteannonce@texthspace}%
}%
% compute tel dimension
% ------------------------------
@@ -226,7 +230,7 @@
% save the telephone into a box
\savebox{\petiteannonce@telbox}[\petiteannonce@telwidth]{%
\rotatebox{90}{%
- \hspace\petiteannonce@half@telvspace\usebox{\petiteannonce@tel}\hspace\petiteannonce@half@telvspace%
+ \hspace{0.5\petiteannonce@telvspace}\usebox{\petiteannonce@tel}\hspace{0.5\petiteannonce@telvspace}%
}%
}
% define the row of repeated telephone number
@@ -234,7 +238,7 @@
\def\petiteannonce@telrow
{%
\makebox[\petiteannonce@width]{%
- \hspace\petiteannonce@half@colsep%
+ \hspace{0.5\petiteannonce@telcolsep}%
\usebox{\petiteannonce@telbox}%
\petiteannonce@telcount@temp=\petiteannonce@telcount%
\loop%
@@ -244,18 +248,19 @@
\usebox{\petiteannonce@telbox}%
\advance\petiteannonce@telcount@temp by -1%
\ifnum\petiteannonce@telcount@temp>2\repeat\relax%
- \hspace\petiteannonce@half@colsep%
+ \hspace{0.5\petiteannonce@telcolsep}%
}%
}%
% now make one petiteannonce
- \savebox{\petiteannonce@box}[\petiteannonce@width]{%
- \framebox[\petiteannonce@width]{%
+ \savebox{\petiteannonce@box}[\petiteannonce@frame@width]{%
+ \framebox[\petiteannonce@frame@width]{%
\begin{minipage}{\petiteannonce@width}%
- \vspace{\petiteannonce@half@textvspace}%
+ \vspace{0.5\petiteannonce@textvspace}%
+ \petiteannonce@this@textwidth=\petiteannonce@textwidth
\noindent\petiteannonce@text%
- \vspace{\petiteannonce@half@textvspace}%
+ \vspace{0.5\petiteannonce@textvspace}%
\noindent \hbox to\petiteannonce@width{\dotfill}%
@@ -281,8 +286,22 @@
\repeat%
}%
-% The advertwidth command
-\def\petiteannoncewidth#1{#1\petiteannonce@width}
+\@ifundefined{petiteannoncewidth}{%
+ \def\petiteannoncewidth#1{#1\petiteannonce@this@textwidth}%
+}{%
+ \ClassError{petiteannonce}%
+ {Already defined command petiteannoncewidth}%
+ {Already defined command petiteannoncewidth}%
+}
+
+\@ifundefined{petiteannonceaddtowidth}{%
+ \def\petiteannonceaddtowidth#1{\advance \petiteannonce@this@textwidth by #1\relax}%
+}{%
+ \ClassError{petiteannonce}%
+ {Already defined command petiteannonceaddtowidth}%
+ {Already defined command petiteannonceaddtowidth}%
+}
+
\makeatother
%
%%