diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/elzcards')
-rw-r--r-- | Master/texmf-dist/source/latex/elzcards/elzcards.dtx | 770 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/elzcards/elzcards.ins | 16 |
2 files changed, 555 insertions, 231 deletions
diff --git a/Master/texmf-dist/source/latex/elzcards/elzcards.dtx b/Master/texmf-dist/source/latex/elzcards/elzcards.dtx index 7bc378f59eb..36910448114 100644 --- a/Master/texmf-dist/source/latex/elzcards/elzcards.dtx +++ b/Master/texmf-dist/source/latex/elzcards/elzcards.dtx @@ -18,11 +18,15 @@ % The Current Maintainer of this work is Emilio Lazo Zaia. % % This work consists of the files README and elzcards.dtx with -% its derived files elzcards.ins, elzcards.cls and +% its derived files elzcards.ins, elzcards.sty and % elzcards-example.tex. % %<*internalbatchfile> -\begingroup +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX +\else + \expandafter\begingroup +\fi %</internalbatchfile> %<*batchfile> \input docstrip.tex @@ -45,7 +49,7 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Emilio Lazo Zaia. This work consists of the files README and elzcards.dtx with -its derived files elzcards.ins, elzcards.cls and +its derived files elzcards.ins, elzcards.sty and elzcards-example.tex. \endpreamble @@ -55,10 +59,13 @@ elzcards-example.tex. \Msg{************************************************************} \Msg{************************* \jobname *************************} \Msg{************************************************************} -\generate{\file{\jobname.cls}{\from{\jobname.dtx}{class}}} -\Msg{\jobname.cls written.} +\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}} +\Msg{\jobname.sty written.} +\Msg{} \immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx} \immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo} +\Msg{} +\Msg{Change history and index updated.} \postamble \endpostamble %</batchfile> @@ -72,34 +79,32 @@ elzcards-example.tex. \Msg{************************************************************} \Msg{To produce the documentation, compile \jobname.dtx file with} \Msg{ pdflatex \jobname.dtx} -\Msg{To update the index and changelog, type} +\Msg{If write18 is not enabled, type} \Msg{ makeindex -s gind.ist -o \jobname.ind \jobname.idx} \Msg{ makeindex -s gglo.ist -o \jobname.gls \jobname.glo} -\Msg{respectively, and recompile the documentation.} +\Msg{to update index and changelog respectively.} +\Msg{In either case, compile again.} \Msg{************************************************************} \Msg{} %</batchfile> %<batchfile>\endbatchfile %<*internalbatchfile> -\endgroup +\ifx\fmtname\nameofplainTeX + \expandafter\endbatchfile +\else + \expandafter\endgroup +\fi %</internalbatchfile> -%<*driver> -\ProvidesFile{elzcards.dtx} -%</driver> -%<class>\NeedsTeXFormat{LaTeX2e}[1995/12/01] -%<class>\ProvidesClass{elzcards} -%<*class> -[2015/03/05 v1.00 ELZ cards] -%</class> % %<*driver> \documentclass{ltxdoc} \usepackage[letterpaper,vmargin={3cm,2cm},hmargin={3cm,2cm}]{geometry} -\usepackage{paralist,calc} \usepackage[usenames,dvipsnames]{color} +\usepackage[english]{babel} +\usepackage{paralist,calc,array} +\usepackage{elzcards} \EnableCrossrefs \CodelineIndex -% \OnlyDescription \RecordChanges \setlength{\parskip}{5pt} \begin{document} @@ -108,7 +113,7 @@ elzcards-example.tex. %</driver> % \fi % -% \CheckSum{534} +% \CheckSum{922} % % \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 @@ -126,113 +131,245 @@ elzcards-example.tex. % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % +% \changes{v1.00}{2015/03/05}{First release as a class.} +% \changes{v1.20}{2015/04/26}{01. Changes in \texttt{.dtx} header and spaces on embedded \texttt{.ins} file. Now it should compile with pdf\TeX{} to produce only package files.} +% \changes{v1.20}{2015/04/26}{02. It isn't a class anymore. Now is a package.} +% \changes{v1.20}{2015/04/26}{03. Supports adjustable gaps between cards.} +% \changes{v1.20}{2015/04/26}{04. Added commands to control default values of optional arguments of {\slshape make} commands.} +% \changes{v1.20}{2015/04/26}{05. \cs{unitlength} is handled transparently.} +% \changes{v1.20}{2015/04/26}{06. Added key-val package to drop positional parameters and stars on {\slshape make} commands.} +% \changes{v1.20}{2015/04/26}{07. Added \cs{BusinessCard} command instead of defining the card's design with \cs{MakeBC}.} +% \changes{v1.20}{2015/04/26}{08. Added optional stars on {\slshape make} commands to allow not clearing the cards in order to have the possibility of being processed again.} +% \changes{v1.20}{2015/04/26}{09. Added informational output to log and console about what is being processed.} +% \changes{v1.20}{2015/04/26}{10. Added macros to change default crop behavior.} % -% \changes{v1.00}{2015/03/05}{First release.} +% \GetFileInfo{\jobname.sty} % -% \GetFileInfo{\jobname.dtx} +% \DoNotIndex{\\, \addtocounter, \advance, \arabic, \@auxout, \begin, \BusinessCard, \circle, \cleardoublepage, \clearpage, \CropMarksSize, \csname, \def, \define@key, \documentclass, \else, \@elzc@conreversofalse, \@elzc@conreversotrue, \elzc@DefArista, \elzc@DefFichaXdim, \elzc@DefFichaYdim, \elzc@DefLinea, \elzc@DefPunto, \elzc@DefSeparaX, \elzc@DefSeparaY, \elzc@DefTPXdim, \elzc@DefTPYdim, \@elzc@fichaconreversofalse, \@elzc@fichaconreversotrue, \@elzc@guiasfalse, \@elzc@guiastrue, \@elzc@lineasfalse, \@elzc@lineastrue, \@elzc@puntosfalse, \@elzc@puntostrue, \@elzc@reversofalse, \@elzc@reversotrue, \elzc@SeparaX, \elzc@SeparaY, \@elzc@TarjetaAnverso, \@elzc@tarjetaconreversofalse, \@elzc@tarjetaconreversotrue, \@elzc@tarjetafalse, \@elzc@TarjetaReverso, \@elzc@tarjetatrue, \elzc@TarjXdim, \elzc@TarjYdim, \elzc@TempLen, \elzc@TempUnitLength, \end, \endcsname, \expandafter, \fi, \hfill, \if@elzc@conreverso, \if@elzc@fichaconreverso, \if@elzc@guias, \if@elzc@lineas, \if@elzc@puntos, \if@elzc@reverso, \if@elzc@tarjeta, \if@elzc@tarjetaconreverso, \InputIfFileExists, \ifnum, \IfBooleanF, \IfBooleanTF, \IfValueT, \IfValueTF, \ifx, \immediate, \input, \jobname, \LARGE, \let, \line, \linethickness, \LineThickness, \loop, \makebox, \mbox, \@mparswitchtrue, \message, \mycenter, \NeedsTeXFormat, \newcommand, \newcounter, \NewDocumentCommand, \newif, \newlength, \PackageError, \parbox, \parindent, \ProvidesPackage, \put, \relax, \repeat, \RequirePackage, \romannumeral, \setcounter, \setkeys, \setlength, \string, \textheight, \textwidth, \the, \thispagestyle, \TotalFC, \TotalIC, \@twosidetrue, \undefined, \unitlength, \usepackage, \value, \vfill, \@wholewidth, \write} % -% \DoNotIndex{\addtocounter, \arabic, \@auxout, \advance, \begin, \circle, \cleardoublepage, \csname, \CurrentOption, \def, \DeclareOption, \else, \end, \endcsname, \endinput, \expandafter, \fi, \forloop, \FPupn, \elzc@DefFichaXdim, \elzc@DefFichaYdim, \elzc@DefTPXdim, \elzc@DefTPYdim, elzc@DefPunto, elzc@DefArista, \elzc@DefLinea, \@elzc@guiasfalse, \@elzc@guiastrue, \@elzc@fichaconreversofalse, \@elzc@fichaconreversotrue, \@elzc@reversofichafalse, \@elzc@reversofichatrue, \IfBooleanTF, \IfFileExists, \if@elzc@guias, \if@elzc@lineas, \ifnum, \if@elzc@reversoficha, \if@elzc@fichaconreverso, \if@elzc@puntos, \IfValueTF, \IfValueT, \immediate, \input, \jobname, \line, \@elzc@lineasfalse, \@elzc@lineastrue, \linethickness, \LoadClass, \loop, \makebox, \@mparswitchtrue, \multiput, \newcommand, \newcounter, \NewDocumentCommand, \newif, \newlength, \newpage, \not, \numexpr, \pagestyle, \parbox, \parindent, \PassOptionsToClass, \ProcessOptions, \@elzc@puntosfalse, \@elzc@puntostrue, \put, \relax, \repeat, \RequirePackage, \romannumeral, \setcounter, \setlength, \string, \elzc@TarjXdim, \elzc@TarjYdim, \elzc@TempLen, \textheight, \textwidth, \@twosidetrue, \unitlength, \value, \write, \example, \hfill, \vfill, \LARGE, \mbox, \usepackage, \documentclass, \mycenter, \\} -% -% \title{The \textsf{\jobname} class\thanks{This document +% \title{The \textsf{\jobname} package\thanks{This document % corresponds to \textsf{\jobname}~\fileversion, dated \filedate.}} % \author{Emilio Lazo Zaia\\ \texttt{< emiliolazozaia at gmail.com >}} % % \maketitle % +% \tableofcontents +% % \section{Introduction} % -% |elzcards| is a class meant to be an easy and flexible way to typeset business cards, index cards and flash cards, with its back side as an option. You must bother only by setting the paper size, margins and the design of your card\footnote{No predefined design is given; you must typeset your card.}. Everything else is done by |elzcards|. +% |elzcards| is a package meant to be an easy and flexible way to typeset business cards, index cards and flash cards, with -optional- back side. You must bother only by setting the paper size, margins and the design of your cards\footnote{No predefined design is given; you must typeset your cards.}. Everything else is done by |elzcards|. +% +% It uses the printable area of the paper to print the cards, so it relies on |\textwidth| and |\textheight| (not on |\paperwidth| and |\paperheight|) to calculate how many cards fits in a page. +% +% You should typeset the design of the cards with one macro the package provides, followed by another macro to write them on paper. Macros used to manage business cards are not the same as for index/flash cards. Business cards are all equal, one design is repeated many times in a page, but index/flash cards are all different, so the macro to typeset index/flash cards manages a stack of cards. You should execute it many times as cards you have and all them will be stored to be processed when you have finished adding them. However, index cards and flash cards are in essence the same; the package provides macros for ``both'' cases but they behave the same. Macros aliases for flash cards were added for completeness. % -% \section{Writing business cards} +% \section{Usage} % -% Please load the class. It hasn't options. Any option you specify will be passed to |article| class, in which |elzcards| is based on. +% Please load your class (i.e. |article|) and load the package. {\itshape It does not have options.} % -% \noindent {\color{RoyalBlue}|\documentclass{elzcards}|} +% \noindent {\color{RoyalBlue}|\documentclass{article}|} +% +% \noindent {\color{RoyalBlue}|\usepackage{elzcards}|} % % \noindent Now I'll recommend you inserting the |geometry| package and setting the margins according to % % \noindent \hspace*{2em}\parbox{\textwidth-2em}{\begin{enumerate}[\bfseries 1.] -% \item the desired size of your card, +% \item the desired size of your cards, % \item the paper you'll use, % \item the printable area of your printer. % \end{enumerate}} % -% \noindent For example, for the default business card size (3.5 inches x 2 inches) in a letter paper, you may use: +% \noindent For example, for the default business card size (3.5 inches x 2 inches) in a letter paper, you would use: % % \noindent {\color{RoyalBlue}|\usepackage[letterpaper,landscape,vmargin={0.25in,0.25in},hmargin={0.25in,0.25in}]| % % \hfill |{geometry}|} % -% \noindent After beginning your document, the only command you would use to produce the cards is |\MakeBC|, described below. +% After |\begin|ning your |{document}|, you have four principal macros to produce the cards you want. These macros are: +% \begin{itemize} +% \item |\BusinessCard| and |\MakeBC| to typeset business cards, and +% \item |\IndexCard| and |\MakeIC| to typeset index cards and flash cards\footnote{Also the package provides the aliases \cs{FlashCard} and \cs{MakeFC} for your convenience when writing flash cards but they are the same as its corresponding index cards macros.}. +% \end{itemize} +% +% \subsection{Typesetting the cards} +% +% \noindent \DescribeMacro{\BusinessCard}{\color{RoyalBlue}|\BusinessCard|\marg{front side design}\oarg{back side design}} +% +% To produce a business card, you should issue the command |\BusinessCard|. What you write as the first argument (with braces) will be the card's front face design, and its second -optional- argument (with square brackets) is the card's back side\footnote{There is no need to specify the |twoside| option when loading the class even if you are writing twosided cards, but you must compile your document twice.}. Everything you put inside |{ }| and inside |[ ]| will be stored in a box and repeated in a grid until the page has been filled. +% +% \noindent \DescribeMacro{\IndexCard}{\color{RoyalBlue}|\IndexCard|\marg{front side design}\oarg{back side design}} +% +% \noindent \DescribeMacro{\FlashCard}{\color{RoyalBlue}|\FlashCard|\marg{front side design}\oarg{back side design}} +% +% To produce an index/flash card you have |\IndexCard|\footnote{or \cs{FlashCard}, which is the same command.}. This command has the same syntax as |\BusinessCard|, but it manages a stack of index/flash cards. You should execute it many times as cards you have to add all them into the stack. You can add the number of cards you want with many instances of |\IndexCard|. All these cards will be processed when you issue the {\slshape make} command, no matter how many pages are needed to print all them. +% +% \noindent \DescribeMacro{\CurrentIC}{\color{RoyalBlue}|\CurrentIC|} +% \noindent \DescribeMacro{\CurrentFC}{\color{RoyalBlue}|\CurrentFC|} +% +% \noindent \DescribeMacro{\TotalIC}{\color{RoyalBlue}|\TotalIC|} +% \noindent \DescribeMacro{\TotalFC}{\color{RoyalBlue}|\TotalFC|} +% +% With |\CurrentIC| and |\TotalIC| you can access the counters associated with index/flash cards. |\CurrentIC| prints the number of the current index/flash card and |\TotalIC| print the total of card. For example, you can add something like |Card: \CurrentIC{} of \TotalIC| somewhere on the content of your cards. +% +% \subsection{Writing cards on paper} +% +% At this time, nothing has been written yet on the paper. The commands described on previous section only define contents of the cards; to write them on paper you should issue |\MakeBC| for business cards or |\MakeIC|\footnote{or \cs{MakeFC}, which is also an alias.} for index/flash cards. +% +% \noindent \DescribeMacro{\MakeBC}{\color{RoyalBlue}|\MakeBC[*]|\oarg{key-val comma separated list of options}} +% +% \noindent \DescribeMacro{\MakeIC}{\color{RoyalBlue}|\MakeIC[*]|\oarg{key-val comma separated list of options}} +% +% \noindent \DescribeMacro{\MakeFC}{\color{RoyalBlue}|\MakeFC[*]|\oarg{key-val comma separated list of options}} +% +% They have a possible star and a key-val list of options, both optional with square brackets. The key-val options are intented to change sizes, gaps and crop options (as described on next section). The star means that the {\slshape make} command won't clear all cards it has processed. Normally, when you execute any of these {\slshape make} commands, a later execution of it will have no cards to process. If you issue a {\slshape make} command with a star |*| you may later use the same {\slshape make} command every time you want without adding again the same set of cards. Otherwise, without |*| all cards are purged. +% +% \subsection{key-val options: defining sizes, gaps, crop options} +% +% Both {\slshape make} commands accepts a key-val list of comma-separated options. These options are: +% +% {\tabcolsep4pt +% \begin{tabular}{lll} +% Option & What changes? & \rmfamily Default value \\ \hline +% hsize= & horizontal size of each card & |3.5in| in business cards, |5in| on index/flash cards \\ +% vsize= & vertical size of each card & |2in| in business cards, |3in| on index/flash cards \\ +% hgap= & horizontal gap between cards & 0pt \\ +% vgap= & vertical gap between cards & |0pt| \\ +% segment length= & segment (arista) of crop crosses & |1mm| \\ +% dot size= & diameter of crop dots & |1pt| \\ +% line thickness= & thickness of crop line & |0.1mm| \\ +% crosses & use crosses as crop marks & true \\ +% dots & use dots as crop marks & false \\ +% lines & use lines as crop marks & false \\ +% \end{tabular}} +% +% You may change whatever length on this list\footnote{All these key-val options except the latter three are \LaTeX{} length.}. Everything you don't specify will be taken from its default value. As you can see, business cards and index/flash cards have different default sizes, but both can be changed with |hsize| and |vsize| in the {\slshape make} command. Both gaps are set by default to zero, meaning no distance between cards. The default crop mark is the cross (which really are segments and crosses); if you want dots or lines you must specify it. Using lines you'll have lines between all cards, like a grill. This may be useful also if you want the line as the border of the card, part of the design itself of the card. {\itshape Back side cards will have no crop marks.} +% +% \subsection{Changing default values and options} +% +% You can change all the default behavior and values; it may be convenient instead of issuing {\slshape make} commands with parameters, specially if you typeset more than one set of cards in the same document, which uses the same lengths and are different than default values. Changing default values at some point of the document may be preferred than calling these {\slshape make} commands with optional arguments over and over. This package provides commands to change all default values in whatever place of the document and that will apply to every card onwards: % -% \DescribeMacro{\MakeBC}{\color{RoyalBlue}|\MakeBC[*][*]|\oarg{xlen}\oarg{ylen}\oarg{zlen}\marg{front side design}\oarg{back side design}} -% The only mandatory argument is the design of the card's front face. Everything you put inside |{}| will be stored in a box of size \meta{xlen} x \meta{ylen} and repeated in a grid until the page was filled. +% \newpage +% \noindent \DescribeMacro{\BCdim}{\color{RoyalBlue}|\BCdim|\marg{h-size}\marg{v-size}} % -% After closing the braces of the front side design of the card you can specify its back side design, if desired, as the last optional argument of |\MakeBC|\footnote{There is no need to specify the |twoside| option when loading the class even if you are writing twosided cards, but you must compile it twice.} (with square brackets). +% This command |\BCdim| takes two arguments, the horizontal and vertical default size of business cards. {\slshape Key-val options: |hsize=| and |vsize=|.} % -% Both \meta{xlen} and \meta{ylen} are optional parameters to |\MakeBC|, and are \LaTeX{} lenghts; you can change the size of your cards specifying these lengths. Default values are, as stated before: 3.5 inches x 2 inches. +% \noindent \DescribeMacro{\ICdim}{\color{RoyalBlue}|\ICdim|\marg{h-size}\marg{v-size}} +% \DescribeMacro{\FCdim} % -% The third optional parameter \meta{zlen} is also a length and has different meanings, depending on how you execute |\MakeBC|, i.e. starred or not starred. This will be explained just after clarifying what starred versions of |\MakeBC| are. +% With |\ICdim| or |\FCdim| you can change default size of index/flash cards, like with |\BCdim|. {\slshape Key-val options: |hsize=| and |vsize=|.} % -% Looking at the usage of |\MakeBC| we see the two optional stars, so we have three possible behaviors. Issuing |\MakeBC| without stars will print a grid of cards with segments and crosses as crop marks. The starred version |\MakeBC*| will print dots as crop marks, and the double starred version |\MakeBC**| will print lines between all the cards, like a grill. This may be useful also if you want the line as the border of the card, part of the design itself of the card\footnote{None of these crop marks will be added to the back side of a twosided document.}. +% \noindent \DescribeMacro{\BCgap}{\color{RoyalBlue}|\BCgap|\marg{h-gap}\marg{v-gap}} +% \DescribeMacro{\ICgap} +% \DescribeMacro{\FCgap} % -% Finally, the \meta{zlen} dimension represents the length of the segments when the standard cutting marks applies (no stars); also it represents the diameter of the dots (with one star), and the width of the line (with two stars). Its defaults values are: \meta{0.1mm}, \meta{1pt} and \meta{0.1mm} respectively. +% With |\BCgap|, |\ICgap| or |\FCgap| you can change the gap between cards. |elzcards| doesn't manages gaps differently between business cards and index/flash cards, like in the case of the above commands representing sizes. {\itshape If you specify only one parameter, this will be taken as the gap in both directions.} {\slshape Key-val options: |hgap=| and |vgap=|.} % -%^^A Regarding the card's design, it's important to know that the |\unitlength| dimension, used in |picture| environment is defaulted to \meta{1mm}. This class relies on defining this length to \meta{1sp} to make its calculations, but it was set to \meta{1mm} inside the card to be used in |picture|, if you wish. +% \noindent \DescribeMacro{\CrossSegment}{\color{RoyalBlue}|\CrossSegment|\marg{segment length}} % -% \section{Writing index and flash cards} +% This macro can be used to change the length of segments used as crop marks. {\slshape Key-val option: |segment length=|.} % -% When writing other type of cards, like index cards and flash cards, you need to store all your cards in a stack and run the macro used to process them, that is |\MakeIC| (or |\MakeFC|, which is an alias to |\MakeIC|). +% {\parindent0pt +% \DescribeMacro{\DotSize}{\color{RoyalBlue}|\DotSize|\marg{dot size}} % -% \DescribeMacro{\Card}{\color{RoyalBlue}|\Card|\marg{front side design}\oarg{back side design}} -% With this macro your add a card into the stack. You can add the number of cards you want with more instances of |\Card|. All these cards will be processed when you issue |\MakeIC| with the following syntax: +% With |\DotSize| you can change the diameter of the dots. {\slshape Key-val option: |dot size=|} % -% \DescribeMacro{\MakeIC} -% \DescribeMacro{\MakeFC}{\color{RoyalBlue}|\MakeIC[*][*]|\oarg{xlen}\oarg{ylen}\oarg{zlen}} -% The syntax is the same as for business cards but without the business card's specific arguments because you've added all cards into the stack before. It accepts two optional stars and three optional lengths as parameters\footnote{Exactly the same as \cs{MakeBC} except there are no mandatory arguments.}. +% \DescribeMacro{\LineThickness}{\color{RoyalBlue}|\LineThickness|\marg{thickness}} +% +% |\LineThickness| changes the default value of the thickness of the line. {\slshape Key-val option: |line thickness=|.} +% +% \DescribeMacro{\CropCrosses}{\color{RoyalBlue}|\CropCrosses|} +% +% This command make default drawing crosses and segments as crop marks. {\itshape That's the default, but you may change it with the followind two macros.} {\slshape Key-val option: |crosses|.} +% +% \DescribeMacro{\CropDots}{\color{RoyalBlue}|\CropDots|} +% +% This command make default drawing dots as crop marks. {\slshape Key-val option: |dots|.} +% +% \DescribeMacro{\CropCrosses}{\color{RoyalBlue}|\CropLines|} +% +% This command make default drawing lines as crop marks. {\slshape Key-val option: |lines|.} +% } % % \section{Final words} % -% In the same document you can write many different sets of cards. You can combine business cards with index cards in the order you want; also using different sizes of cards, different designs, cropping options and even changing the paper geometry with |\geometry|. +% In the same document you can typeset many different sets of cards. You can combine business cards with index cards in the order you want; also using different sizes of cards, different gaps, designs, cropping options, and even changing the paper geometry with |\geometry|. +% +% If only one card has back side, the whole document behaves like a twosided document, i.e. it will swap horizontal margins and will have interleaved blank pages when a set of cards has only front side; this is the behavior of |twoside| option but you don't have to specify it by hand in |\documentclass|. % -% If only one card has back side, the whole document behaves like a twosided document, i.e. it will swap horizontal margins and will have interleaved blank pages when a set of cards has only front side; this is the behavior of |twoside| option but you don't have to specify it by hand when loading the class. +% Take into account that this is \LaTeX, so you can define your own commands and use them inside the |\BusinessCard| and |\IndexCard| macros, like in examples with macro |\mycenter|. % -% Take into account that this is \LaTeX, so you can define your own command and use it inside the |\MakeIC| and |\MakeBC|, like in the following example with |\mycenter|. +% \section{Sample output of a business card} % -% \section{All-in-one example} +% In the following page you'll see the first set of business cards of the all-in-one included example: +% \savegeometry{migeo} +% \newgeometry{vmargin={0.5in,0.5in},hmargin={0.75in,0.75in}} +% \newcommand{\mycenter}[1]{top left corner\vfill\mbox{}% +% \begin{center}\LARGE#1\end{center}\mbox{}\vfill \hfill bottom right corner} +% \BusinessCard{\mycenter{Business card \\ only front side \\ default options}}% +% \MakeBC +% \newpage +% \loadgeometry{migeo} +% +% \section{Code of the all-in-one example included} % % The following example is included as |elzcards-example.tex|. % -% \StopEventually{\clearpage\PrintIndex} +% \StopEventually{\clearpage\PrintIndex\PrintChanges} % % \begin{macrocode} %<*ejemplo> -\documentclass{elzcards} +\documentclass{article} +\usepackage{elzcards} \usepackage[landscape,letterpaper,vmargin={0.25in,0.25in},hmargin={0.25in,0.25in}]{geometry} -\newcommand{\mycenter}[1]{\vfill\mbox{}\begin{center}\LARGE#1\end{center}\mbox{}\vfill} +\newcommand{\mycenter}[1]{% + top left corner\vfill\mbox{}% + \begin{center}\LARGE#1\end{center}% + \mbox{}\vfill \hfill bottom right corner} \begin{document} - \MakeBC{\mycenter{Business card \\ only front side \\ default options}}% - \MakeBC*{\mycenter{Business card \\ front side \\ with dots}}% - [\mycenter{Business card \\ back side}] - \MakeBC**{\mycenter{Business card \\ front side \\ with lines}}% - [\mycenter{Business card \\ back side}] - \MakeBC*[2in][3.5in][1mm]{\mycenter{Business card \\ vertical \\ front side \\ with 1mm dots}}% - [\mycenter{Business card \\ vertical \\ back side}] - \Card{\mycenter{Index/flash card \\ front card 1}}[\mycenter{Index/flash card \\ back card 1}] - \Card{\mycenter{Index/flash card \\ front card 2}}[\mycenter{Index/flash card \\ back card 2}] - \Card{\mycenter{Index/flash card \\ front card 3}}[\mycenter{Index/flash card \\ back card 3}] - \Card{\mycenter{Index/flash card \\ front card 4}}[\mycenter{Index/flash card \\ back card 4}] - \Card{\mycenter{Index/flash card \\ front card 5}}[\mycenter{Index/flash card \\ back card 5}] - \Card{\mycenter{Index/flash card \\ front card 6}}[\mycenter{Index/flash card \\ back card 6}] - \Card{\mycenter{Index/flash card \\ front card 7}}[\mycenter{Index/flash card \\ back card 7}] - \MakeIC - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 1}} - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 2}} - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 3}} - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 4}} - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 5}} - \Card{\mycenter{Index/flash card \\ 3x3in \\ with 2mm dots \\ card 6}} - \MakeFC*[3in][3in][2mm] + \BusinessCard{\mycenter{Business card \\ only front side \\ default options}} + \MakeBC + \BusinessCard{\mycenter{Business card \\ front side \\ other size: vertical \\ + with thicker and longer crosses}}% + [\mycenter{Business card \\ front side \\ other size: vertical}] + \MakeBC[hsize=2in, vsize=3.5in, line thickness=1pt, segment length=0.5cm] + \BusinessCard{\mycenter{Business card \\ only front side \\ with dots}} + \MakeBC[dots] + \BusinessCard{\mycenter{Business card \\ only front side \\ with big dots and gaps}} + \MakeBC[dots, dot size=4pt, hgap=1.666cm, vgap=0.666cm] + \BusinessCard{\mycenter{Business card \\ only front side \\ with lines}} + \MakeBC[lines] + \BusinessCard{\mycenter{Business card \\ only front side \\ with thicker lines}} + \MakeBC[lines, line thickness=2pt] + \BusinessCard{\mycenter{Business card \\ front side \\ other size \\ with gaps}}% + [\mycenter{Business card \\ other size \\ back side}] + %% We can specify size also with \BCdim command, outsize of \MakeBC command: + \BCdim{74mm}{52mm} + \MakeBC[hgap=1.666cm, vgap=0.666cm] + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}}% + [\mycenter{Index/flash card \CurrentIC{} of \TotalIC \\ back side}] + %% Note that not all cards has back side. + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}} + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}} + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}}% + [\mycenter{Index/flash card \CurrentIC{} of \TotalIC \\ back side}] + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}} + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}} + \IndexCard{\mycenter{Index/flash card \\ front side \CurrentIC{} of \TotalIC}} + %% Now \MakeIC* instead of \MakeIC, so we can process them again with \MakeIC or \MakeIC*. + \MakeIC* + %% We define some default parameters instead of giving options to \MakeIC: + \ICgap{0.5cm}{0.5cm} + \CrossSegment{10pt} + \LineThickness{1pt} + %% \MakeIC* again because we did use \MakeIC* before: + \MakeIC* + \FCgap{0pt}{0pt}% \FCgap is an alias to \ICgap. + \ICdim{6in}{4in} + \DotSize{1mm} + \CropDots + %% \CropCrosses + %% \CropLines + \MakeFC*% \MakeFC is an alias to \MakeIC. \end{document} %</ejemplo> % \end{macrocode} @@ -240,23 +377,38 @@ elzcards-example.tex. % \section{Implementation} % % \begin{macrocode} -%<*class> +%<*package> +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{elzcards}[2015/04/26 v1.20 ELZ cards] + \RequirePackage{calc} \RequirePackage{xparse} +\RequirePackage{keyval} -\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} -\ProcessOptions\relax -\LoadClass{article} - +\newif\if@elzc@guias \newif\if@elzc@puntos \newif\if@elzc@lineas -\newif\if@elzc@guias +\newif\if@elzc@tarjeta +\newif\if@elzc@tarjetaconreverso \newif\if@elzc@fichaconreverso -\newif\if@elzc@reversoficha +\newif\if@elzc@conreverso +\newif\if@elzc@reverso \newlength{\elzc@TarjXdim} \newlength{\elzc@TarjYdim} +\newlength{\elzc@SeparaX} +\newlength{\elzc@SeparaY} \newlength{\elzc@TempLen} +\newlength{\elzc@TempUnitLength} +\newlength{\elzc@DefTPXdim} +\newlength{\elzc@DefTPYdim} +\newlength{\elzc@DefFichaXdim} +\newlength{\elzc@DefFichaYdim} +\newlength{\elzc@DefSeparaX} +\newlength{\elzc@DefSeparaY} +\newlength{\elzc@DefArista} +\newlength{\elzc@DefPunto} +\newlength{\elzc@DefLinea} \newcounter{elzc@TarjXdim} \newcounter{elzc@TarjYdim} @@ -264,183 +416,351 @@ elzcards-example.tex. \newcounter{elzc@PapelY} \newcounter{elzc@NumX} \newcounter{elzc@NumY} +\newcounter{elzc@NumXY} \newcounter{elzc@ContX} \newcounter{elzc@ContY} \newcounter{elzc@PosX} \newcounter{elzc@PosY} -\newcounter{elzc@RestoX} +\newcounter{elzc@SeparaX} +\newcounter{elzc@SeparaY} \newcounter{elzc@XInicial} +\newcounter{elzc@RestoX} \newcounter{elzc@Punto} \newcounter{elzc@Arista} \newcounter{elzc@Fichas} -\newcounter{elzc@TempFichaActual} -\newcounter{elzc@TempFichaActualII} +\newcounter{elzc@FichaActual} +\newcounter{elzc@TempNumX} +\newcounter{elzc@TempNumY} +\newcounter{elzc@TempMarcaX} +\newcounter{elzc@TempMarcaY} +\newcounter{elzc@TempFichaActualRev} +\newcounter{elzc@TempInfo} -\setlength{\parindent}{0pt} -\setlength{\unitlength}{1sp} -\pagestyle{empty} +\define@key{ELZc}{hsize}{\setlength{\elzc@TarjXdim}{#1}} +\define@key{ELZc}{vsize}{\setlength{\elzc@TarjYdim}{#1}} +\define@key{ELZc}{hgap}{\setlength{\elzc@SeparaX}{#1}} +\define@key{ELZc}{vgap}{\setlength{\elzc@SeparaY}{#1}} +\define@key{ELZc}{segment length}{% + \setlength{\elzc@TempLen}{#1}\setcounter{elzc@Arista}{\elzc@TempLen}} +\define@key{ELZc}{dot size}{\setlength{\elzc@TempLen}{#1}\setcounter{elzc@Punto}{\elzc@TempLen}} +\define@key{ELZc}{line thickness}{\linethickness{#1}} +\define@key{ELZc}{crosses}[true]{\@elzc@guiastrue\@elzc@puntosfalse\@elzc@lineasfalse} +\define@key{ELZc}{dots}[true]{\@elzc@guiasfalse\@elzc@puntostrue\@elzc@lineasfalse} +\define@key{ELZc}{lines}[true]{\@elzc@guiasfalse\@elzc@puntosfalse\@elzc@lineastrue} -\newlength{\elzc@DefTPXdim} -\newlength{\elzc@DefTPYdim} -\newlength{\elzc@DefFichaXdim} -\newlength{\elzc@DefFichaYdim} -\newlength{\elzc@DefLinea} -\newcounter{elzc@DefArista} -\newcounter{elzc@DefPunto} +\newcommand*{\CurrentIC}{\arabic{elzc@FichaActual}} +\let\CurrentFC\CurrentIC -\setlength{\elzc@DefTPXdim}{3.5in} -\setlength{\elzc@DefTPYdim}{2in} -\setlength{\elzc@DefFichaXdim}{5in} -\setlength{\elzc@DefFichaYdim}{3in} -\setlength{\elzc@DefLinea}{0.1mm} -\setcounter{elzc@DefArista}{186468} -\setcounter{elzc@DefPunto}{65536} +\newcommand*{\TotalIC}{\arabic{elzc@Fichas}} +\let\TotalFC\TotalIC + +\newcommand*{\BCdim}[2]{\setlength{\elzc@DefTPXdim}{#1}\setlength{\elzc@DefTPYdim}{#2}} + +\newcommand*{\ICdim}[2]{\setlength{\elzc@DefFichaXdim}{#1}\setlength{\elzc@DefFichaYdim}{#2}} +\let\FCdim\ICdim + +\NewDocumentCommand{\BCgap}{m g}{% + \setlength{\elzc@DefSeparaX}{#1}% + \IfValueTF{#2}{\setlength{\elzc@DefSeparaY}{#2}}{\setlength{\elzc@DefSeparaY}{#1}}}% +\let\ICgap\BCgap +\let\FCgap\BCgap + +\newcommand*{\CrossSegment}[1]{\setlength{\elzc@DefArista}{#1}} + +\newcommand*{\DotSize}[1]{\setlength{\elzc@DefPunto}{#1}} + +\newcommand*{\LineThickness}[1]{\setlength{\elzc@DefLinea}{#1}} + +\newcommand*{\CropDots}{% + \def\elzc@DefMarcasCorte{\@elzc@guiasfalse\@elzc@puntostrue\@elzc@lineasfalse}} + +\newcommand*{\CropCrosses}{% + \def\elzc@DefMarcasCorte{\@elzc@guiastrue\@elzc@puntosfalse\@elzc@lineasfalse}} + +\newcommand*{\CropLines}{% + \def\elzc@DefMarcasCorte{\@elzc@guiasfalse\@elzc@puntosfalse\@elzc@lineastrue}} + +\NewDocumentCommand{\MakeBC}{s o}{% + \ifx\undefined\@elzc@TarjetaAnverso + \PackageError{elzcards}{There are no business cards defined}{}% + \else + \@elzc@tarjetatrue + \if@elzc@tarjetaconreverso \@elzc@conreversotrue \else \@elzc@conreversofalse \fi + \elzc@Predeterminados + \setlength{\elzc@TarjXdim}{\elzc@DefTPXdim}% + \setlength{\elzc@TarjYdim}{\elzc@DefTPYdim}% + \IfValueT{#2}{\setkeys{ELZc}{#2}}% + \elzc@Tarjetas + \IfBooleanF{#1}{\elzc@TodoCero}% + \fi} + +\NewDocumentCommand{\MakeIC}{s o}{% + \ifnum \value{elzc@Fichas} = 0 + \PackageError{elzcards}{There are no index/flash cards in stack}{}% + \else + \@elzc@tarjetafalse + \if@elzc@fichaconreverso \@elzc@conreversotrue \else \@elzc@conreversofalse \fi + \elzc@Predeterminados + \setlength{\elzc@TarjXdim}{\elzc@DefFichaXdim}% + \setlength{\elzc@TarjYdim}{\elzc@DefFichaYdim}% + \IfValueT{#2}{\setkeys{ELZc}{#2}}% + \elzc@Tarjetas + \IfBooleanF{#1}{\elzc@TodoCero*}% + \fi} +\let\MakeFC\MakeIC -\newcommand{\elzc@Cuadricula}[1]{% +\NewDocumentCommand{\BusinessCard}{+m +o}{% + \def\@elzc@TarjetaAnverso{#1}% + \IfValueTF{#2}{% + \@elzc@tarjetaconreversotrue + \def\@elzc@TarjetaReverso{#2}% + \immediate\write\@auxout{\string\@twosidetrue\string\@mparswitchtrue}} + {\def\@elzc@TarjetaReverso{}}} + +\NewDocumentCommand{\IndexCard}{+m +o}{% + \addtocounter{elzc@Fichas}{1}% + \expandafter\def\csname @elzc@FichaAnverso\romannumeral\value{elzc@Fichas}\endcsname{#1}% + \IfValueTF{#2}{% + \@elzc@fichaconreversotrue + \expandafter\def\csname @elzc@FichaReverso\romannumeral\value{elzc@Fichas}\endcsname{#2}% + \immediate\write\@auxout{\string\@twosidetrue\string\@mparswitchtrue}} + {\expandafter\def\csname @elzc@FichaReverso\romannumeral\value{elzc@Fichas}\endcsname{}}} +\let\FlashCard\IndexCard + +\newcommand*{\elzc@Cuadricula}{% + \setlength{\elzc@TempUnitLength}{\unitlength}% + \setlength{\unitlength}{1sp}% + \setlength{\parindent}{0pt}% + \thispagestyle{empty}% + \setcounter{elzc@NumX}{0}% + \setcounter{elzc@NumY}{0}% + \setcounter{elzc@TempNumX}{0}% + \setcounter{elzc@TempNumY}{0}% \setcounter{elzc@TarjXdim}{\elzc@TarjXdim}% \setcounter{elzc@TarjYdim}{\elzc@TarjYdim}% + \setcounter{elzc@SeparaX}{\elzc@SeparaX}% + \setcounter{elzc@SeparaY}{\elzc@SeparaY}% \setcounter{elzc@PapelX}{\textwidth}% \setcounter{elzc@PapelY}{\textheight}% - \setcounter{elzc@NumX}{\value{elzc@PapelX} / \value{elzc@TarjXdim}}% - \setcounter{elzc@NumY}{\value{elzc@PapelY} / \value{elzc@TarjYdim}}% + \loop \ifnum\value{elzc@TempNumX} < \value{elzc@PapelX}% + \advance\value{elzc@TempNumX} by \value{elzc@TarjXdim}{% + \addtocounter{elzc@NumX}{1}% + \addtocounter{elzc@TempNumX}{\value{elzc@SeparaX}}}% + \repeat + \loop \ifnum\value{elzc@TempNumY} < \value{elzc@PapelY}% + \advance\value{elzc@TempNumY} by \value{elzc@TarjYdim}{% + \addtocounter{elzc@NumY}{1}% + \addtocounter{elzc@TempNumY}{\value{elzc@SeparaY}}}% + \repeat + \addtocounter{elzc@TempNumX}{-\value{elzc@SeparaX}}% + \addtocounter{elzc@TempNumY}{-\value{elzc@SeparaY}}% + \ifnum\value{elzc@TempNumX} > \value{elzc@PapelX}% + \addtocounter{elzc@NumX}{-1}% + \fi + \ifnum\value{elzc@TempNumY} > \value{elzc@PapelY}% + \addtocounter{elzc@NumY}{-1}% + \fi + \setcounter{elzc@NumXY}{\value{elzc@NumX} * \value{elzc@NumY}}% \setcounter{elzc@ContX}{-1}% \setcounter{elzc@ContY}{-1}% - \setcounter{elzc@RestoX}{- \value{elzc@PapelX} + \value{elzc@NumX} * \value{elzc@TarjXdim}}% - \begin{picture}(\value{elzc@PapelX},\value{elzc@PapelY})(\value{elzc@XInicial},0)% + \setcounter{elzc@RestoX}{- \value{elzc@PapelX} + \value{elzc@NumX} * + (\value{elzc@TarjXdim} + \value{elzc@SeparaX}) - \value{elzc@SeparaX}}% + \elzc@Informacion + \begin{picture}(\value{elzc@PapelX}, \value{elzc@PapelY})(\value{elzc@XInicial}, 0)% \loop \ifnum\value{elzc@ContY} < \value{elzc@NumY} \advance\value{elzc@ContY} by 1{% \loop \ifnum\value{elzc@ContX} < \value{elzc@NumX} \advance\value{elzc@ContX} by 1{% - \if@elzc@reversoficha - \setcounter{elzc@PosX}{\value{elzc@NumX} * \value{elzc@TarjXdim} - % - \value{elzc@ContX} * \value{elzc@TarjXdim} - \value{elzc@TarjXdim}}% + \if@elzc@reverso + \setcounter{elzc@PosX}{(\value{elzc@NumX} - \value{elzc@ContX} - 1) * \value{elzc@TarjXdim}% + + (\value{elzc@NumX} - \value{elzc@ContX} - 1) * \value{elzc@SeparaX}}% \else - \setcounter{elzc@PosX}{\value{elzc@ContX} * \value{elzc@TarjXdim}}% + \setcounter{elzc@PosX}{\value{elzc@ContX} * (\value{elzc@TarjXdim} + \value{elzc@SeparaX})}% \fi - \setcounter{elzc@PosY}{\value{elzc@ContY} * \value{elzc@TarjYdim}}% + \setcounter{elzc@PosY}{\value{elzc@ContY} * (\value{elzc@TarjYdim} + \value{elzc@SeparaY})}% \ifnum \value{elzc@ContX} < \value{elzc@NumX}% \ifnum \value{elzc@ContY} < \value{elzc@NumY}% - \put(\value{elzc@PosX},\value{elzc@PosY}){% - \makebox(\value{elzc@TarjXdim}, \value{elzc@TarjYdim}){% - \ifnum\value{elzc@TempFichaActual} < \value{elzc@Fichas}% - \addtocounter{elzc@TempFichaActual}{1}% - \addtocounter{elzc@TempFichaActualII}{1}% + \put(\value{elzc@PosX}, \value{elzc@PosY}){% + \makebox(\value{elzc@TarjXdim}, \value{elzc@TarjYdim}){% + \setlength{\unitlength}{\elzc@TempUnitLength}% \parbox[t][\elzc@TarjYdim]{\elzc@TarjXdim}{% - \if@elzc@reversoficha - \expandafter\csname FichaReverso\romannumeral\value{elzc@TempFichaActual}\endcsname + \if@elzc@tarjeta + \if@elzc@reverso \@elzc@TarjetaReverso \else \@elzc@TarjetaAnverso \fi \else - \expandafter\csname Ficha\romannumeral\value{elzc@TempFichaActual}\endcsname - \fi}% - \else - \parbox[t][\elzc@TarjYdim]{\elzc@TarjXdim}{#1}% - \fi}}% + \ifnum\value{elzc@FichaActual} < \value{elzc@Fichas}% + \addtocounter{elzc@FichaActual}{1}% + \addtocounter{elzc@TempFichaActualRev}{1}% + \if@elzc@reverso + \expandafter\csname @elzc@FichaReverso\romannumeral\value{elzc@FichaActual}\endcsname + \else + \expandafter\csname @elzc@FichaAnverso\romannumeral\value{elzc@FichaActual}\endcsname + \fi + \fi + \fi}}}% \fi \fi - \if@elzc@guias - \ifnum \value{elzc@ContX} = 0 - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(-1,0){\value{elzc@Arista}}}% - \else - \ifnum \value{elzc@ContX} = \value{elzc@NumX}% - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(2,0){\value{elzc@Arista}}}% - \else - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(-1,0){\value{elzc@Arista}}}% - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(2,0){\value{elzc@Arista}}}% - \fi - \fi - \ifnum \value{elzc@ContY} = 0 - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(0,-1){\value{elzc@Arista}}}% - \else - \ifnum \value{elzc@ContY} = \value{elzc@NumY}% - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(0,0){\value{elzc@Arista}}}% - \else - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(0,0){\value{elzc@Arista}}}% - \put(\value{elzc@PosX},\value{elzc@PosY}){\line(0,-1){\value{elzc@Arista}}}% - \fi - \fi - \fi - \if@elzc@lineas - \multiput(\value{elzc@PosX}, 0)(0, \value{elzc@TarjYdim})% - {\value{elzc@NumY}}{\line(0,1){\value{elzc@TarjYdim}}}% - \multiput(0, \value{elzc@PosY})(\value{elzc@TarjXdim}, 0)% - {\value{elzc@NumX}}{\line(1,0){\value{elzc@TarjXdim}}}% - \fi - \if@elzc@puntos - \put(\value{elzc@PosX}, \value{elzc@PosY}){\circle*{\value{elzc@Punto}}} - \fi}% - \repeat}% - \repeat - \end{picture}% - \@elzc@lineasfalse\@elzc@puntosfalse\@elzc@guiasfalse\@elzc@reversofichafalse} - -\NewDocumentCommand{\elzc@Tarjetas}{s s o o o m o}{% - \IfBooleanTF{#2}{\@elzc@lineastrue}{\IfBooleanTF{#1}{\@elzc@puntostrue}{\@elzc@guiastrue}}% - \setlength{\elzc@TarjXdim}{#3}% - \setlength{\elzc@TarjYdim}{#4}% - \IfValueTF{#5}{% - \IfBooleanTF{#2} - {\linethickness{#5}} - {\IfBooleanTF{#1} - {\setlength{\elzc@TempLen}{#5}\setcounter{elzc@Punto}{\elzc@TempLen}} - {\setlength{\elzc@TempLen}{#5}\setcounter{elzc@Arista}{\elzc@TempLen}% - \linethickness{\elzc@DefLinea}}}% - }{% - \IfBooleanTF{#2} - {\linethickness{\elzc@DefLinea}} - {\IfBooleanTF{#1} - {\setcounter{elzc@Punto}{\value{elzc@DefPunto}}} - {\setcounter{elzc@Arista}{\value{elzc@DefArista}}\linethickness{\elzc@DefLinea}}% - }% - }% - \elzc@Cuadricula{\setlength{\unitlength}{1mm}#6}% - \if@elzc@fichaconreverso - \addtocounter{elzc@TempFichaActual}{-\value{elzc@TempFichaActualII}}% - \newpage + \if@elzc@reverso \else \elzc@CalculaMarcas \fi + }\repeat + }\repeat + \end{picture}} + +\newcommand*{\elzc@Tarjetas}{% + {\pagestyle{empty}\cleardoublepage}% + \elzc@Cuadricula + \if@elzc@conreverso + \@elzc@reversotrue + \if@elzc@tarjeta \else \addtocounter{elzc@FichaActual}{-\value{elzc@TempFichaActualRev}}\fi \setcounter{elzc@XInicial}{\value{elzc@RestoX}}% - \@elzc@reversofichatrue - \elzc@Cuadricula{\setlength{\unitlength}{1mm}}% + \clearpage + \elzc@Cuadricula + \setcounter{elzc@XInicial}{0}% + \@elzc@reversofalse + \fi + \if@elzc@tarjeta + \else + \setcounter{elzc@TempFichaActualRev}{0}% + \ifnum\value{elzc@FichaActual} < \value{elzc@Fichas}% + \elzc@Tarjetas% + \fi + \setcounter{elzc@FichaActual}{0}% + \fi + \clearpage} + +\NewDocumentCommand{\elzc@TodoCero}{s}{% + \IfBooleanTF{#1}{% + \setcounter{elzc@Fichas}{0}% + \@elzc@fichaconreversofalse} + {\let\@elzc@TarjetaAnverso\undefined + \let\@elzc@TarjetaReverso\undefined + \@elzc@tarjetaconreversofalse}} + +\newcommand*{\elzc@Predeterminados}{% + \elzc@DefMarcasCorte + \setlength{\elzc@SeparaX}{\elzc@DefSeparaX}% + \setlength{\elzc@SeparaY}{\elzc@DefSeparaY}% + \setlength{\elzc@TempLen}{\elzc@DefArista}\setcounter{elzc@Arista}{\elzc@TempLen}% + \setlength{\elzc@TempLen}{\elzc@DefPunto}\setcounter{elzc@Punto}{\elzc@TempLen}% + \linethickness{\elzc@DefLinea}} + +\newcommand*{\elzc@CalculaMarcas}{% + \setcounter{elzc@TempMarcaX}{\value{elzc@PosX}}% + \setcounter{elzc@TempMarcaY}{\value{elzc@PosY}}% + \ifnum \value{elzc@ContX} = \value{elzc@NumX}% \else - \IfValueT{#7}{% - \immediate\write\@auxout{\string\@twosidetrue\string\@mparswitchtrue}% - \newpage - \setcounter{elzc@XInicial}{\value{elzc@RestoX}}% - \elzc@Cuadricula{\setlength{\unitlength}{1mm}#7}}% + \ifnum \value{elzc@ContY} = \value{elzc@NumY}% + \else + \elzc@DibujaMarcas{\value{elzc@TempMarcaX}}{\value{elzc@TempMarcaY}}% + \fi \fi - \cleardoublepage - \setcounter{elzc@TempFichaActualII}{0}% - \setcounter{elzc@XInicial}{0}% - \ifnum\value{elzc@TempFichaActual} < \value{elzc@Fichas}% - \IfBooleanTF{#2}{\MakeIC**[#3][#4][#5]}{\IfBooleanTF{#1}{% - \MakeIC*[#3][#4][#5]}{\MakeIC[#3][#4][#5]}}% + \addtocounter{elzc@TempMarcaX}{-\value{elzc@SeparaX}}% + \ifnum \value{elzc@ContX} = 0% + \else + \ifnum \value{elzc@ContY} = \value{elzc@NumY}% + \else + \elzc@DibujaMarcas{\value{elzc@TempMarcaX}}{\value{elzc@TempMarcaY}}% + \fi \fi - \setcounter{elzc@Fichas}{0}% - \setcounter{elzc@TempFichaActual}{0}% - \@elzc@fichaconreversofalse} - -\NewDocumentCommand{\MakeBC}{s s O{\elzc@DefTPXdim} O{\elzc@DefTPYdim} o m o}{% - \IfBooleanTF{#2} - {\elzc@Tarjetas**[#3][#4][#5]{#6}[#7]} - {\IfBooleanTF{#1} - {\elzc@Tarjetas*[#3][#4][#5]{#6}[#7]} - {\elzc@Tarjetas[#3][#4][#5]{#6}[#7]}}} - -\NewDocumentCommand{\MakeIC}{s s O{\elzc@DefFichaXdim} O{\elzc@DefFichaYdim} o}{% - \IfBooleanTF{#2} - {\elzc@Tarjetas**[#3][#4][#5]{}} - {\IfBooleanTF{#1} - {\elzc@Tarjetas*[#3][#4][#5]{}} - {\elzc@Tarjetas[#3][#4][#5]{}}}} - -\let\MakeFC\MakeIC + \addtocounter{elzc@TempMarcaY}{-\value{elzc@SeparaY}}% + \ifnum \value{elzc@ContX} = 0% + \else + \ifnum \value{elzc@ContY} = 0% + \else + \elzc@DibujaMarcas{\value{elzc@TempMarcaX}}{\value{elzc@TempMarcaY}}% + \fi + \fi + \addtocounter{elzc@TempMarcaX}{\value{elzc@SeparaX}}% + \ifnum \value{elzc@ContY} = 0% + \else + \ifnum \value{elzc@ContX} = \value{elzc@NumX}% + \else + \elzc@DibujaMarcas{\value{elzc@TempMarcaX}}{\value{elzc@TempMarcaY}}% + \fi + \fi} -\NewDocumentCommand{\Card}{m o}{% - \addtocounter{elzc@Fichas}{1}% - \expandafter\def\csname Ficha\romannumeral\value{elzc@Fichas}\endcsname{#1}% - \IfValueTF{#2}{% - \@elzc@fichaconreversotrue - \expandafter\def\csname FichaReverso\romannumeral\value{elzc@Fichas}\endcsname{#2}% - \immediate\write\@auxout{\string\@twosidetrue\string\@mparswitchtrue}} - {\expandafter\def\csname FichaReverso\romannumeral\value{elzc@Fichas}\endcsname{}}} +\newcommand*{\elzc@DibujaMarcas}[2]{% + \ifnum \value{elzc@ContX} = 0% + \if@elzc@guias\put(#1,#2){\line(-1,0){\value{elzc@Arista}}}\fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \else + \ifnum \value{elzc@ContX} = \value{elzc@NumX}% + \if@elzc@guias\put(#1,#2){\line(2,0){\value{elzc@Arista}}}\fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \else + \if@elzc@guias + \put(#1,#2){\line(-1,0){\value{elzc@Arista}}}% + \put(#1,#2){\line(2,0){\value{elzc@Arista}}}% + \fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \if@elzc@lineas + \put(#1,#2){\line(-1,0){\value{elzc@TarjXdim}}}% + \put(#1,#2){\line(2,0){\value{elzc@TarjXdim}}}% + \fi + \fi + \fi + \ifnum \value{elzc@ContY} = 0% + \if@elzc@guias\put(#1,#2){\line(0,-1){\value{elzc@Arista}}}\fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \else + \ifnum \value{elzc@ContY} = \value{elzc@NumY}% + \if@elzc@guias\put(#1,#2){\line(0,0){\value{elzc@Arista}}}\fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \else + \if@elzc@guias + \put(#1,#2){\line(0,0){\value{elzc@Arista}}}% + \put(#1,#2){\line(0,-1){\value{elzc@Arista}}}% + \fi + \if@elzc@puntos\put(#1,#2){\circle*{\value{elzc@Punto}}}\fi + \if@elzc@lineas + \put(#1,#2){\line(0,0){\value{elzc@TarjYdim}}}% + \put(#1,#2){\line(0,-1){\value{elzc@TarjYdim}}}% + \fi + \fi + \fi} + +\newcommand*{\elzc@Informacion}{% + \message{^^JProcessing}% + \if@elzc@tarjeta + \message{business cards,}% + \else + \message{index/flash cards,}% + \setcounter{elzc@TempInfo}{\value{elzc@NumXY} + \value{elzc@FichaActual}}% + \ifnum \value{elzc@TempInfo} > \value{elzc@Fichas}% + \setcounter{elzc@TempInfo}{\value{elzc@Fichas}}% + \fi + \addtocounter{elzc@FichaActual}{1}% + \message{current=\arabic{elzc@FichaActual}-\arabic{elzc@TempInfo}, + total=\arabic{elzc@Fichas},}% + \addtocounter{elzc@FichaActual}{-1}% + \fi + \if@elzc@reverso\message{back side,^^J}\else\message{front side,^^J}\fi + \message{ per page: \arabic{elzc@NumXY} (\arabic{elzc@NumX}x\arabic{elzc@NumY}),}% + \message{ hsize=\the\elzc@TarjXdim, vsize=\the\elzc@TarjYdim, + hgap=\the\elzc@SeparaX, vgap=\the\elzc@SeparaY,^^J}% + \if@elzc@guias + \message{ with crosses,}% + \setlength{\elzc@TempLen}{\value{elzc@Arista}sp}% + \message{segment length=\the\elzc@TempLen, line thickness=\the\@wholewidth.^^J}% + \fi + \if@elzc@puntos + \message{ with dots,}% + \setlength{\elzc@TempLen}{\value{elzc@Punto}sp}% + \message{dot size=\the\elzc@TempLen.^^J}% + \fi + \if@elzc@lineas + \message{ with lines, line thickness=\the\@wholewidth.^^J}% + \fi} + +\setlength{\elzc@DefTPXdim}{3.5in} +\setlength{\elzc@DefTPYdim}{2in} +\setlength{\elzc@DefFichaXdim}{5in} +\setlength{\elzc@DefFichaYdim}{3in} +\setlength{\elzc@DefSeparaX}{0cm} +\setlength{\elzc@DefSeparaY}{0cm} +\setlength{\elzc@DefArista}{1mm} +\setlength{\elzc@DefPunto}{1pt} +\setlength{\elzc@DefLinea}{0.1mm} +\CropCrosses -\IfFileExists{\jobname.aux}{\input\jobname.aux} +\InputIfFileExists{\jobname.aux}{}\relax -%</class> +%</package> % \end{macrocode} % \Finale diff --git a/Master/texmf-dist/source/latex/elzcards/elzcards.ins b/Master/texmf-dist/source/latex/elzcards/elzcards.ins index 10df143862c..fdf48937156 100644 --- a/Master/texmf-dist/source/latex/elzcards/elzcards.ins +++ b/Master/texmf-dist/source/latex/elzcards/elzcards.ins @@ -23,7 +23,7 @@ %% The Current Maintainer of this work is Emilio Lazo Zaia. %% %% This work consists of the files README and elzcards.dtx with -%% its derived files elzcards.ins, elzcards.cls and +%% its derived files elzcards.ins, elzcards.sty and %% elzcards-example.tex. %% \input docstrip.tex @@ -46,7 +46,7 @@ This work has the LPPL maintenance status `maintained'. The Current Maintainer of this work is Emilio Lazo Zaia. This work consists of the files README and elzcards.dtx with -its derived files elzcards.ins, elzcards.cls and +its derived files elzcards.ins, elzcards.sty and elzcards-example.tex. \endpreamble @@ -56,10 +56,13 @@ elzcards-example.tex. \Msg{************************************************************} \Msg{************************* \jobname *************************} \Msg{************************************************************} -\generate{\file{\jobname.cls}{\from{\jobname.dtx}{class}}} -\Msg{\jobname.cls written.} +\generate{\file{\jobname.sty}{\from{\jobname.dtx}{package}}} +\Msg{\jobname.sty written.} +\Msg{} \immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx} \immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo} +\Msg{} +\Msg{Change history and index updated.} \postamble \endpostamble \generate{\file{\jobname-example.tex}{\from{\jobname.dtx}{ejemplo}}} @@ -67,10 +70,11 @@ elzcards-example.tex. \Msg{************************************************************} \Msg{To produce the documentation, compile \jobname.dtx file with} \Msg{ pdflatex \jobname.dtx} -\Msg{To update the index and changelog, type} +\Msg{If write18 is not enabled, type} \Msg{ makeindex -s gind.ist -o \jobname.ind \jobname.idx} \Msg{ makeindex -s gglo.ist -o \jobname.gls \jobname.glo} -\Msg{respectively, and recompile the documentation.} +\Msg{to update index and changelog respectively.} +\Msg{In either case, compile again.} \Msg{************************************************************} \Msg{} \endbatchfile |