Hello community, here is the log from the commit of package texlive-specs-t for openSUSE:Factory checked in at 2017-06-25 19:22:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/texlive-specs-t (Old) and /work/SRC/openSUSE:Factory/.texlive-specs-t.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "texlive-specs-t" Sun Jun 25 19:22:35 2017 rev:26 rq:504810 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/texlive-specs-t/texlive-specs-t.changes 2017-06-08 14:56:12.764523774 +0200 +++ /work/SRC/openSUSE:Factory/.texlive-specs-t.new/texlive-specs-t.changes 2017-06-25 19:28:43.160443979 +0200 @@ -1,0 +2,42 @@ +Mon Jun 19 13:31:54 UTC 2017 - werner@suse.de + +- Fix texlive-pdftex-def dependency as now texlive-graphics-def does + provide pdftex.def +- Fix texlive-rotating dependency as now texlive-graphics does + provide rotating.sty + +------------------------------------------------------------------- +Fri Jun 16 12:14:49 UTC 2017 - werner@suse.de + +- Notive: Some patches have been moved + * bbold_bbold11.dif from texlive-specs-b to texlive-specs-c + * context_fourier-map.dif from texlive-specs-e to texlive-specs-f + * dvips_config.dif from texlive-specs-g to texlive-specs-h + * jadetex_ini.dif from texlive-specs-l to texlive-specs-m + * texdoc_cnf.dif from texlive-specs-v to texlive-specs-w + * texdraw_info.dif from texlive-specs-v to texlive-specs-w + this entry exists only to silent the auto factory bot + +------------------------------------------------------------------- +Tue Jun 13 10:38:52 UTC 2017 - werner@suse.de + +- Final TeXLive 2017 20170520 +- Remove patch fontspec_emph.dif as now upstream +- Update patches + * kpathsea_cnf.dif + * latex2man_tmphandling.dif + * latexdiff_perl.dif + * latexpand_perl.dif + * luaotfload_varfonts.dif + * luatex_cnf.dif + * musixtex_various.dif + * tetex_scripts.dif + * tex4ht_env.dif + * texconfig_scripts.dif + +------------------------------------------------------------------- +Thu Jun 1 12:29:31 UTC 2017 - werner@suse.de + +- Update to TeXLive 2017 20170520 pretest + +------------------------------------------------------------------- Old: ---- rlepsf.doc.tar.xz rlepsf.tar.xz rmathbr.doc.tar.xz rmathbr.tar.xz rmpage.doc.tar.xz rmpage.tar.xz roboto.doc.tar.xz roboto.tar.xz robustcommand.doc.tar.xz robustcommand.tar.xz robustindex.doc.tar.xz robustindex.tar.xz roex.tar.xz romanbar.doc.tar.xz romanbar.tar.xz romanbarpagenumber.doc.tar.xz romanbarpagenumber.tar.xz romande.doc.tar.xz romande.tar.xz romanneg.doc.tar.xz romanneg.tar.xz romannum.doc.tar.xz romannum.tar.xz rosario.doc.tar.xz rosario.tar.xz rotating.doc.tar.xz rotating.tar.xz rotfloat.doc.tar.xz rotfloat.tar.xz rotpages.doc.tar.xz rotpages.tar.xz roundbox.doc.tar.xz roundbox.tar.xz roundrect.doc.tar.xz roundrect.tar.xz rrgtrees.doc.tar.xz rrgtrees.tar.xz rsc.doc.tar.xz rsc.tar.xz rsfs.doc.tar.xz rsfs.tar.xz rsfso.doc.tar.xz rsfso.tar.xz rterface.doc.tar.xz rterface.tar.xz rtkinenc.doc.tar.xz rtkinenc.tar.xz rtklage.doc.tar.xz rtklage.tar.xz rubik.doc.tar.xz rubik.tar.xz ruhyphen.tar.xz rulercompass.doc.tar.xz rulercompass.tar.xz russ.doc.tar.xz russ.tar.xz rviewport.doc.tar.xz rviewport.tar.xz rvwrite.doc.tar.xz rvwrite.tar.xz ryethesis.doc.tar.xz ryethesis.tar.xz sa-tikz.doc.tar.xz sa-tikz.tar.xz sageep.doc.tar.xz sageep.tar.xz sanskrit-t1.doc.tar.xz sanskrit-t1.tar.xz sanskrit.doc.tar.xz sanskrit.tar.xz sansmath.doc.tar.xz sansmath.tar.xz sansmathaccent.doc.tar.xz sansmathaccent.tar.xz sansmathfonts.doc.tar.xz sansmathfonts.tar.xz sapthesis.doc.tar.xz sapthesis.tar.xz sasnrdisplay.doc.tar.xz sasnrdisplay.tar.xz sauerj.doc.tar.xz sauerj.tar.xz sauter.tar.xz sauterfonts.doc.tar.xz sauterfonts.tar.xz savefnmark.doc.tar.xz savefnmark.tar.xz savesym.tar.xz savetrees.doc.tar.xz savetrees.tar.xz scale.doc.tar.xz scale.tar.xz scalebar.doc.tar.xz scalebar.tar.xz scalerel.doc.tar.xz scalerel.tar.xz scanpages.doc.tar.xz scanpages.tar.xz schemabloc.doc.tar.xz schemabloc.tar.xz schemata.doc.tar.xz schemata.tar.xz schule.doc.tar.xz schule.tar.xz schulschriften.doc.tar.xz schulschriften.tar.xz schwalbe-chess.doc.tar.xz schwalbe-chess.tar.xz sciposter.doc.tar.xz sciposter.tar.xz sclang-prettifier.doc.tar.xz sclang-prettifier.tar.xz screenplay-pkg.doc.tar.xz screenplay-pkg.tar.xz screenplay.doc.tar.xz screenplay.tar.xz scrjrnl.doc.tar.xz scrjrnl.tar.xz scrlttr2copy.doc.tar.xz scrlttr2copy.tar.xz sdrt.doc.tar.xz sdrt.tar.xz sduthesis.doc.tar.xz sduthesis.tar.xz New: ---- pst-ovl.doc.tar.xz pst-ovl.tar.xz pst-pad.doc.tar.xz pst-pad.tar.xz pst-pdf.doc.tar.xz pst-pdf.tar.xz pst-pdgr.doc.tar.xz pst-pdgr.tar.xz pst-perspective.doc.tar.xz pst-perspective.tar.xz pst-platon.doc.tar.xz pst-platon.tar.xz pst-plot.doc.tar.xz pst-plot.tar.xz pst-poly.doc.tar.xz pst-poly.tar.xz pst-pulley.doc.tar.xz pst-pulley.tar.xz pst-qtree.doc.tar.xz pst-qtree.tar.xz pst-rubans.doc.tar.xz pst-rubans.tar.xz pst-shell.doc.tar.xz pst-shell.tar.xz pst-sigsys.doc.tar.xz pst-sigsys.tar.xz pst-slpe.doc.tar.xz pst-slpe.tar.xz pst-solarsystem.doc.tar.xz pst-solarsystem.tar.xz pst-solides3d.doc.tar.xz pst-solides3d.tar.xz pst-soroban.doc.tar.xz pst-soroban.tar.xz pst-spectra.doc.tar.xz pst-spectra.tar.xz pst-spinner.doc.tar.xz pst-spinner.tar.xz pst-spirograph.doc.tar.xz pst-spirograph.tar.xz pst-stru.doc.tar.xz pst-stru.tar.xz pst-support.doc.tar.xz pst-text.doc.tar.xz pst-text.tar.xz pst-thick.doc.tar.xz pst-thick.tar.xz pst-tools.doc.tar.xz pst-tools.tar.xz pst-tree.doc.tar.xz pst-tree.tar.xz pst-tvz.doc.tar.xz pst-tvz.tar.xz pst-uml.doc.tar.xz pst-uml.tar.xz pst-vectorian.doc.tar.xz pst-vectorian.tar.xz pst-vehicle.doc.tar.xz pst-vehicle.tar.xz pst-vowel.doc.tar.xz pst-vowel.tar.xz pst-vue3d.doc.tar.xz pst-vue3d.tar.xz pst2pdf.doc.tar.xz pst2pdf.tar.xz pstool.doc.tar.xz pstool.tar.xz pstools.doc.tar.xz pstools.tar.xz pstricks-add.doc.tar.xz pstricks-add.tar.xz pstricks.doc.tar.xz pstricks.tar.xz pstricks_calcnotes.doc.tar.xz pstring.doc.tar.xz pstring.tar.xz psu-thesis.doc.tar.xz psu-thesis.tar.xz ptex-base.doc.tar.xz ptex-base.tar.xz ptex-fontmaps.doc.tar.xz ptex-fontmaps.tar.xz ptex-fonts.doc.tar.xz ptex-fonts.tar.xz ptex.doc.tar.xz ptex.tar.xz ptex2pdf.doc.tar.xz ptex2pdf.tar.xz ptext.doc.tar.xz ptext.tar.xz ptptex.doc.tar.xz ptptex.tar.xz punk-latex.doc.tar.xz punk-latex.tar.xz punk.doc.tar.xz punk.tar.xz punknova.doc.tar.xz punknova.tar.xz purifyeps.doc.tar.xz purifyeps.tar.xz pxbase.doc.tar.xz pxbase.tar.xz pxchfon.doc.tar.xz pxchfon.tar.xz pxcjkcat.doc.tar.xz pxcjkcat.tar.xz pxfonts.doc.tar.xz pxfonts.tar.xz pxgreeks.doc.tar.xz pxgreeks.tar.xz pxjahyper.doc.tar.xz pxjahyper.tar.xz pxpgfmark.doc.tar.xz pxpgfmark.tar.xz pxrubrica.doc.tar.xz pxrubrica.tar.xz pxtatescale.doc.tar.xz pxtatescale.tar.xz pxtxalfa.doc.tar.xz pxtxalfa.tar.xz pygmentex.doc.tar.xz pygmentex.tar.xz python.doc.tar.xz python.tar.xz pythonhighlight.doc.tar.xz pythonhighlight.tar.xz pythontex.doc.tar.xz pythontex.tar.xz quicktype.doc.tar.xz quicktype.tar.xz randomlist.doc.tar.xz randomlist.tar.xz revquantum.doc.tar.xz revquantum.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ texlive-specs-t.spec ++++++ ++++ 26890 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/texlive-specs-t/texlive-specs-t.spec ++++ and /work/SRC/openSUSE:Factory/.texlive-specs-t.new/texlive-specs-t.spec ++++++ qcircuit.doc.tar.xz ++++++ Binary files old/doc/latex/qcircuit/Qtutorial.pdf and new/doc/latex/qcircuit/Qtutorial.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/qcircuit/Qtutorial.tex new/doc/latex/qcircuit/Qtutorial.tex --- old/doc/latex/qcircuit/Qtutorial.tex 2016-04-07 22:47:22.000000000 +0200 +++ new/doc/latex/qcircuit/Qtutorial.tex 1970-01-01 01:00:00.000000000 +0100 @@ -1,722 +0,0 @@ -\documentclass[twocolumn,nofootinbib]{revtex4} -\usepackage[bookmarks = true, pdfpagemode = None, pdfstartview = FitH, colorlinks = true, urlcolor = blue]{hyperref} -\usepackage[braket, qm]{qcircuit} -\usepackage{amsmath} -\usepackage{listings} -\renewcommand{\arraystretch}{1.5} - -\begin{document} -\lstset{language=TeX} - -\title{qcircuit 2.5.2 Tutorial} - -\author{Original authors: Bryan Eastin, Steve T Flammia\\ Edits: Travis L Scholten} -\affiliation{Department of Physics and Astronomy, University of New -Mexico, Albuquerque, New Mexico 87131-0001, USA} - -\begin{abstract}qcircuit is a list of macros that greatly simplifies the construction of -quantum circuit diagrams (QCDs) in \LaTeX \ with the help of the \Xy-pic -package. This tutorial should help the reader acquire -the skill to render arbitrary QCDs in a matter of minutes. The source code for qcircuit is available for free\footnote{The qcircuit package is distributed under the GNU public license.} on the \href{CQuIC GitHub page}{https://github.com/CQuIC/qcircuit}. -\end{abstract} - -\maketitle - -\section{Introduction} -\setcounter{footnote}{1} -Ever tried to use \LaTeX\ to typeset something like this? -\[ -\Qcircuit @C=.5em @R=0em @!R { -& \ctrl{1} & \qw & & & \qw & \ctrl{1} & \qw & \ctrl{1} & \ctrl{2} & \qw\\ -& \ctrl{1} & \qw & \push{\rule{.3em}{0em}=\rule{.3em}{0em}} & & \ctrl{1} & \targ & \ctrl{1} & \targ & \qw & \qw\\ -& \gate{U} & \qw & & & \gate{V} & \qw & \gate{V^\dag} & \qw & \gate{V} & \qw -} -\] -\noindent Or maybe this? -\[ -\Qcircuit @C=.7em @R=.4em @! { -\lstick{\ket{\psi}} & \qw & \qw & \ctrl{1} & \gate{H} & \meter & \control \cw\\ -\lstick{\ket{0}} & \qw & \targ & \targ & \qw & \meter & \cwx\\ -\lstick{\ket{0}} & \gate{H} & \ctrl{-1} & \qw & \qw & \gate{X} \cwx & \gate{Z} \cwx & \rstick{\ket{\psi}} \qw -} -\] -\noindent Or how about\footnote{Code for these circuits is given in Appendix \ref{S:code}.} -\[ -\Qcircuit @C=1.3em @R=.6em { - & & & & & & \mbox{Syndrome Measurement} & & & & - \mbox{Recovery}\\ - & \qw & \qw & \ctrl{3} & \qw & \qw & \qw & - \ctrl{5} & \qw & \qw & - \multigate{2}{\ \mathcal{R}\ } & \qw\\ - & \qw & \qw & \qw & \ctrl{2} & \ctrl{3} & \qw & - \qw & \qw & \qw & \ghost{\ \mathcal{R}\ } \qw & - \qw\\ - & \qw & \qw & \qw & \qw & \qw & \ctrl{2} & \qw & - \ctrl{3} & \qw & \ghost{\ \mathcal{R}\ } \qw & - \qw\\ - & & \lstick{\ket{0}} & \targ \qw & \targ \qw & - \qw & \qw & \qw & \qw & \measure{M_a} & - \control \cw \cwx\\ - & & \lstick{\ket{0}} & \qw & \qw & \targ \qw & - \targ \qw & \qw & \qw & \measure{M_b} & - \control \cw \cwx\\ - & & \lstick{\ket{0}} & \qw & \qw & \qw & \qw & - \targ \qw & \targ \qw & \measure{M_c} - \gategroup{2}{2}{7}{10}{.8em}{--} & - \control \cw \cwx -} -\] - -Typesetting quantum circuit diagrams using standard \LaTeX\ graphics packages is a difficult and time consuming business. qcircuit is a high level macro package designed to change that. With qcircuit, drawing quantum circuit diagrams is as easy as constructing an array. In a matter of minutes you can learn the basic syntax and start producing circuits of your own. - -This tutorial teaches you to use qcircuit from the ground up. Many readers will find that they've learned everything they need to know by the end of \S\ref{S:basics}, but plenty of material is included for those that wish to typeset more complicated circuits. - -\section{Getting Started} - -To install qcircuit, place the file \verb=qcircuit.sty= somewhere your \TeX\ distribution can find it and run the appropriate command to update your \TeX\ tree. To use it, place the command -{\small \begin{verbatim}\usepackage[options]{qcircuit}\end{verbatim}} -\noindent in the preamble of your document. \verb=qcircuit.sty= loads the \verb=amsmath= and \verb=xy= packages and implements a set of circuit commands. If need be, you can obtain the necessary packages at \href{http://www.ctan.org/}{http://www.ctan.org/}. - -qcircuit comes with two options - \verb=braket= and \verb=qm= - which provide defined commands for bras, kets, inner and outer products, matrix elements, and expectation values. By default, these options are not enabled, allowing you to define your own commands if you wish. - -\section{Special Commands} -As mentioned above, qcircuit comes with predefined commands for some commonly used functions. We have chosen to use the \verb=ensuremath= command, meaning you do not need to put dollar signs around the calls to these commands. - -We demonstrate the commands below along with their respective outputs: - -\begin{center} -\begin{tabular}{l c l c} -\begin{lstlisting} -\ket{A} -\end{lstlisting} & \ket{A} & \begin{lstlisting} -\bra{B} -\end{lstlisting} & \bra{B}\\ -\begin{lstlisting} -\ip{A}{B} -\end{lstlisting} & \ip{A}{B} & \begin{lstlisting} -\op{A}{B} -\end{lstlisting} & \op{A}{B}\\ -\begin{lstlisting} -\melem{j}{B}{k} -\end{lstlisting} & \melem{j}{B}{k} & -\begin{lstlisting} -\expval{B} -\end{lstlisting} & \expval{B}\\ -\end{tabular} -\end{center} - -\section{Simple Quantum Circuits\label{S:basics}} - -To begin, suppose the reader would like to typeset the following -simple circuit: -\[ \Qcircuit @C=1em @R=.7em { - & \gate{X} & \qw -}\] - -This was typeset using -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \gate{X} & \qw -}\end{verbatim}} - -The command \verb=\Qcircuit= is simply a disguised \verb=\xymatrix= command -with a default parameter set. For readers unfamiliar with the \verb=xymatrix= environment, it suffices -to know that it behaves more or less like the \verb=array= environment. -That is, new columns are denoted by \verb=&= and new rows by \verb=\\=, -as in the following example: -\[ \Qcircuit @C=1.4em @R=1.2em { - a & i \\ - 1 & x -} \] -which was typeset using -{\small \begin{verbatim}\Qcircuit @C=1.4em @R=1.2em { - a & i \\ - 1 & x -} \end{verbatim}} -The parameters \verb?@C=1.4em? and \verb?@R=1.2em? that appear after \verb=\Qcircuit= specify the spacing between the columns and the rows of the circuit, respectively. They may take any length as an argument. Additional parameters are discussed in \S\ref{S:spaces}. - -\subsection{Wires and gates} - -The command \verb=\qw= draws a wire between two columns of -a QCD. The command derives its name from an abbreviation of `quantum wire'. -\[ \Qcircuit @C=1em @R=.7em { - & \gate{H} & \gate{Z} & \gate{H} & \qw \\ - & \qw & \gate{X} & \qw & \qw -} \] - -The diagram above was drawn using -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \gate{H} & \gate{Z} & \gate{H} & \qw \\ - & \qw & \gate{X} & \qw & \qw -}\end{verbatim}} -\noindent Note that \verb=\qw= is used to connect a wire {\it towards the left}. - -The \verb=\gate= command draws the argument of the function inside a -framed box and extends a wire {\it back to the previous column}. When using the -\verb=\gate= and \verb=\qw= commands, make sure there is another column -entry to the left of the current column entry in your QCD, otherwise the wire will not -connect to anything (and you'll get an error), as in the following example code: - -{\small \begin{verbatim} (**Wrong!**) -\Qcircuit @C=1em @R=.7em { - \gate{U} & \qw \\ - \gate{U^\dag} & \qw -} \end{verbatim}} - -The proper way to render this circuit would be to include space for the incoming -wires at the beginning by inserting the \verb=&= character at the start of each new line: -\[ \Qcircuit @C=1em @R=.7em { - & \gate{U} & \qw \\ - & \gate{U^\dag} & \qw -} \] - -{\small \begin{verbatim}\[ \Qcircuit @C=1em @R=.7em { - & \gate{U} & \qw \\ - & \gate{U^\dag} & \qw -} \]\end{verbatim}} - -The only difference between these two codes is that the correct code has an ampersand (\verb=&=) at the start of each new line.\\ - -To indicate the end of a circuit simply use the \verb=\qwa= command as the last wire. - -\[ \Qcircuit @C=1em @R=.7em { - & \gate{U} & \qwa \\ - & \gate{U^\dag} & \qwa -} \] - -{\small \begin{verbatim}\[ \Qcircuit @C=1em @R=.7em { - & \gate{U} & \qwa \\ - & \gate{U^\dag} & \qwa -} \]\end{verbatim}} - -\subsection{CNOT and other controlled single qubit gates \label{S:CNOT}} - -With just these few commands, one can already render a circuit with an arbitrary number of wires and single qubit gates. In this section, we'll learn how to draw CNOT -gates and controlled single qubit gates with an arbitrary number -of controls. - -A simple circuit with two CNOT gates in it is -\[ \Qcircuit @C=1em @R=.7em { - & \ctrl{1} & \targ & \qw \\ - & \targ & \ctrl{-1} & \qw -}\] -which was typeset by -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \ctrl{1} & \targ & \qw \\ - & \targ & \ctrl{-1} & \qw -}\end{verbatim}} -In this circuit, the command \verb=\targ= draws the target gate on the -wire, and the \verb=\ctrl{#1}= puts a bullet down, and connects to the -target which is \verb=#1= array elements \textit{below} the control. -Hence, to connect the second CNOT gate properly, we used -1. - -A more complicated circuit with multiple controls and arbitrary gates -might look like -\[ \Qcircuit @C=1em @R=.7em { - & \ctrl{2} & \targ & \gate{U} & \qw \\ - & \qw & \ctrl{-1} & \qw & \qw \\ - & \targ & \ctrl{-1} & \ctrl{-2} & \qw \\ - & \qw & \ctrl{-1} & \qw & \qw -}\] -which was drawn using -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \ctrl{2} & \targ & \gate{U} & \qw \\ - & \qw & \ctrl{-1} & \qw & \qw \\ - & \targ & \ctrl{-1} & \ctrl{-2} & \qw \\ - & \qw & \ctrl{-1} & \qw & \qw -}\end{verbatim}} - -In the first gate, the control bit connects to the -target on wire 3. In the second gate, each control connects to the object -directly above it. Finally, the third gate is an example of how to do -controls on arbitrary gates; simply place the desired gate where you would -normally put a target. - -\subsection{Vertical wires} - -Suppose we want to typeset the following circuit: -\[ \Qcircuit @C=1em @R=1.2em { - & \gate{U_1} & \qw \\ - & \ctrl{1} \qwx & \qw \\ - & \gate{U_2} & \qw \\ -}\] -so that the middle control has to connect to more than one gate. The way -to accomplish this is with the \verb=\qwx= command. The command -\verb=\qwx[#1]= takes an optional input, \verb=#1=, and connects from -the current position to a position \verb=#1= entries {\it below} -the current position. The default argument is -1. Thus, one way to -typeset the above diagram is with the following code: -{\small \begin{verbatim}\Qcircuit @C=1em @R=1.2em { - & \gate{U_1} & \qw \\ - & \ctrl{-1} \qwx[1] & \qw \\ - & \gate{U_2} & \qw \\ -}\end{verbatim}} -\noindent or, equivalently, -{\small \begin{verbatim}\Qcircuit @C=1em @R=1.2em { - & \gate{U_1} & \qw \\ - & \ctrl{1} \qwx & \qw \\ - & \gate{U_2} & \qw \\ -}\end{verbatim}} -\noindent which is what the author used. - -Note that wire commands must not precede the gate command in an entry. -Also, remember that commands taking an optional -argument use {\it square} braces rather than curly braces. - -\subsection{Labelling input and output states \label{S:labels}} -The last element we need for simple circuits is the ability to add labels. We'll look at input and output labels here, other kinds of labels are discussed in \S\ref{S:labels2}. - -When labelling input and output qubits, one should use the \verb=\lstick= and \verb=\rstick= commands. These commands ensure that the labels and the wires connecting to them line up correctly. The \verb=\lstick= command is used for input labels (on the left of the diagram), and the \verb=\rstick= command is used for output labels (on the right of the diagram). Placement rules are the same as those for gates with the exception that \verb=\lstick= and \verb=\rstick= can be inserted in the leftmost column of the array. Here is an example circuit: -\[ \Qcircuit @C=1em @R=1em { -\lstick{\ket{1}} & \targ & \rstick{\ket{0}} \qw \\ -\lstick{\ket{1}} & \ctrl{-1} & \rstick{\ket{1}} \qw -}\] -typeset with -{\small \begin{verbatim}\Qcircuit @C=1em @R=1em { - \lstick{\ket{1}} & \targ & \rstick{\ket{0}} \qw \\ - \lstick{\ket{1}} & \ctrl{-1} & \rstick{\ket{1}} \qw -}\end{verbatim}} - -There are a few options for labelling multi-qubit input states, as well. - - -\[ \Qcircuit @C=1em @R=1.6em { - \lstick{} & \qw & \qw \\ - \lstick{} & \qw & \qw \inputgroup{1}{2}{.75em}{\ket{0^k}}\\ - \lstick{} & \qw & \qw \\ - \lstick{} & \qw & \qw \inputgroupv{3}{4}{.8em}{.8em}{\ket{\psi}}\\ - \lstick{A} & \qw & \qw \\ - \lstick{B} & \qw & \qw \inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em} - }\] -typeset with -{\small \begin{verbatim}\Qcircuit @C=1em @R=1.6em { - \lstick{} & \qw & \qw \\ - \lstick{} & \qw & \qw - \inputgroup{1}{2}{.75em}{\ket{0^k}}\\ - \lstick{} & \qw & \qw \\ - \lstick{} & \qw & \qw - \inputgroupv{3}{4}{.8em}{.8em}{\ket{\psi}}\\ - \lstick{A} & \qw & \qw \\ - \lstick{B} & \qw & \qw - \inputgrouph{5}{6}{.75em}{\ket{\psi}}{2.2em} - }\end{verbatim}} - -\section{More Complicated Circuits: Multiple Qubit Gates and Beyond} - -So far, we have seen how to make arbitrary QCDs involving single qubit gates and controlled gates, including CNOT. Since this is known to be universal for computation, we could just stop here! Of course, many circuit diagrams use more complicated structures such as multi-qubit gates, measurements, classical wires, and swaps. We will learn how to use Q-circuit to make all of these in this section. - -\subsection{Multiple qubit gates \label{S:multigate}} - -Let's look at an example, and then we'll explain the code. -\[ \Qcircuit @C=1em @R=.7em { - & \multigate{2}{U^\dag} & \qw \\ - & \ghost{U^\dag}& \qw \\ - & \ghost{U^\dag} & \qw -}\] -The 3-qubit gate above was typeset with -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \multigate{2}{U^\dag} & \qw \\ - & \ghost{U^\dag}& \qw \\ - & \ghost{U^\dag} & \qw -}\end{verbatim}} -First let's go over the \verb=\multigate= command. -\verb=\multigate{#1}{#2}= is a two argument gate that takes the -\textit{depth} of the -gate for the first argument and the \textit{label} of the gate for the -second argument. In the above example, \verb=#1= equals 2 because the 3-qubit gate -extends two rows below the position of \verb=\multigate=. On the other two lines, -the \verb=\ghost= command is used to get the spacing and connections right. \verb=\ghost= behaves like an invisible gate that allows the quantum wires on either side of your multigate to connect correctly. - -The generalization to an arbitrarily large gate is now obvious. Let's look at a 6-qubit gate. The code -{\small \begin{verbatim}\Qcircuit @C=1em @R=0em { - & \multigate{5}{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw -}\end{verbatim}} -\noindent yields -\[ \Qcircuit @C=1em @R=0em { - & \multigate{5}{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw \\ - & \ghost{\mathcal{F}} & \qw -}\] -Thus, for every entry below the top, a \verb=\ghost= command -with the label for the gate is needed. Strictly speaking, the name of the gate is not necessary inside the \verb=\ghost= command. Since \verb=\ghost= is just an invisible place holder, anything with the same width as the label specified in multigate will work as well. In practice, however, it is usually easiest to use the same argument. - -Note that controls to multiple qubit gates work the same as for single -qubit gates, using \verb=\ctrl= and \verb=\qwx=. - -Sometimes a multi-qubit gate must be applied to qubits which are \emph{not} on adjacent rows (and as such, the \verb=\multigate= command is not suitable). To account for this, the \verb=\sgate= command can be used to ``hook together'' the application of a multi-qubit gate on non-adjacent qubits: - -{\scriptsize \begin{verbatim}\\Qcircuit @C=1em @R=.7em { - & \multigate{1}{\mathcal{F}} & \sgate{\mathcal{G}}{2} & \qw \\ - & \ghost{\mathcal{F}} & \qw & \qw\\ - & \qw & \gate{\mathcal{G}} & \qw \\ -}\end{verbatim}} -\noindent which yields -\[ \Qcircuit @C=1em @R=.7em { - & \multigate{1}{\mathcal{F}} & \sgate{\mathcal{G}}{2} & \qw \\ - & \ghost{\mathcal{F}} & \qw & \qw\\ - & \qw & \gate{\mathcal{G}} & \qw \\ -}\] - -Such notation may be a bit confusing, admittedly. An alternative circuit which does use the \verb=\multigate= command would have a step where qubits 2 and 3 above were swapped, then the two-qubit gate $\mathcal{G}$ was applied, and finally the qubits were swapped back. - -\subsection{Measurements and classical bits} - -Measurement gates are typeset just like ordinary gates, but they typically have some sort of decoration to indicate that measurement has occurred. At present, Q-circuit supports the following single qubit measurement gates. -{\small \begin{center} - \begin{tabular}{l | l | l} - \multicolumn{1}{c}{\itshape Example} & \multicolumn{1}{c}{\itshape Command} & \multicolumn{1}{c}{\itshape Example Code }\\ \hline - \Qcircuit @C=1em @R=.7em {& \meter} - & \verb=\meter= & \verb=\meter=\\ - \Qcircuit @C=1em @R=.7em {& \measure{\mbox{Basis}}} - & \verb=\measure = & \verb=\measure{\mbox{Basis}}=\\ - \Qcircuit @C=1em @R=.7em {& \measuretab{M_{ijk}}} \hspace{.5em} - & \verb=\measuretab= & \verb=\measuretab{M_{ijk}}=\\ - \Qcircuit @C=1em @R=.7em {& \measureD{\chi}} - & \verb=\measureD= & \verb=\measureD{\chi}=\\\\ - \Qcircuit @C=1em @R=1.5em{ &\meterB{\ket{\xi_\pm}}} - & \verb=\meterB= & \verb=\meterB{\ket{\xi_\pm}}=\\ - \Qcircuit @C=1em @R=1.5em{ &\metersymb} - & \verb=\metersymb= & \verb=\metersymb= - \end{tabular} -\end{center}} - -Often we want to condition some gate on the output of a measurement. One convenient way illustrate this is with the classical wire commands, \verb=\cw= and \verb=\cwx=. The classical wire commands work exactly like the quantum wire commands, but they draw double instead of single lines. - -Here is an example using measurement gates and classical wires and the corresponding code. -\[\Qcircuit @C=1em @R=.7em { - & \qw & \measure{\mbox{Codebit}} \cwx[1] \\ - & \qw & \gate{\chi} & \meter & \rstick{\cdots} \cw -}\] -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \qw & \measure{\mbox{Codebit}} \cwx[1] \\ - & \qw & \gate{\chi} & \meter & - \rstick{\cdots} \cw -}\end{verbatim}} - -If you are using a special basis for your measurements the \verb=\meterB= command allows you to indicate the basis. -\[\Qcircuit @C=1em @R=1.5em { - \lstick{\ket{\psi}} & \meterB{\ket{\xi_\pm}} & \cw -}\] -{\small \begin{verbatim}\Qcircuit @C=1em @R=1.5em { - \lstick{\ket{\psi}} & \meterB{\ket{\xi_\pm}} & \cw -}\end{verbatim}} - -Q-circuit also includes the commands \verb=\multimeasure= and \verb=\multimeasureD= for typesetting measurements on multiple qubits. The syntax for these commands exactly parallels that of the \verb=\multigate= command (see \S\ref{S:multigate}). An example is shown below. -\[\Qcircuit @C=1em @R=.7em { - & \multimeasureD{1}{\text{Bell}} \\ - & \ghost{\text{Bell}} -}\] -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \multimeasureD{1}{\text{Bell}} \\ - & \ghost{\text{Bell}} -}\end{verbatim}} - - In addition, if the measurement must be done on qubits which are \emph{not} adjacent, Q-circuit provides for the \verb=\smeterB= command, which, similar to the \verb=\sgate= command, allows one to split the measurement: - - \[ \Qcircuit @C=1em @R=.7em { - & \smeterB{\ket{\xi_{\pm}}}{2} & \qw \\ - & \qw & \qw\\ - & \gate{\ket{\xi_{\pm}}} & \qw \\ -}\] -{\small \begin{verbatim} \Qcircuit @C=1em @R=.7em { - & \smeterB{\ket{\xi_{\pm}}}{2} & \qw \\ - & \qw & \qw\\ - & \gate{\ket{\xi_{\pm}}} & \qw \\ -}\end{verbatim}} - -\subsection{Non-gate inserts, forcing space, and swap \label{S:inserts}} - -In addition to the gates defined by Q-circuit, standard \LaTeX\ can function as a gate if enclosed in curly brackets. By default, inputs are assumed to have zero size, so no space will be made for the resulting object and any wires connecting to it will run straight to the object's middle. Standard \LaTeX\ entries can serve as labels or wire decorations. - -To force an object to take up space, you should use the \verb=\push= command. \verb=\push= is most useful in conjunction with the \LaTeX\ command \verb=\rule=. Together they can be used to construct various sorts of invisible props and struts. - -Q-circuit implements a gate command called \verb=\qswap= that is equivalent to the text \verb={\times} \qw=. The effect of \verb=\qswap= is to insert half of a swap gate (that is a $\times$) which can then be connected (using \verb=\qwx=) to another instance of \verb=\qswap= to create a swap gate. - -Here is a circuit that shows how to construct swap, decorate wires, and use \verb=\push= to make an invisible prop. -\[\Qcircuit @C=1em @R=.3em { - & & \mbox{Defective Circuit}\\ - & \qswap & \qw & \push{\rule{0em}{1em}} \qw \\ - & \qswap \qwx & \push{X} \qw & \qw \\ - & {/} \qw & \gate{H^{\otimes n}} & \qw -}\] -{\small \begin{verbatim}\Qcircuit @C=1em @R=.3em { - & & \mbox{Defective Circuit}\\ - & \qswap & \qw & \push{\rule{0em}{1em}} \qw \\ - & \qswap \qwx & \push{X} \qw & \qw \\ - & {/} \qw & \gate{H^{\otimes n}} & \qw -}\end{verbatim}} - -To indicate a generalized circuit with $n$ iterations of something, you could use the \verb=\cds= command. -\[\Qcircuit @C=1em @R=.7em { - & \targ & \targ & \cds{4}{\cdots} & \targ & \qw\\ - & \ctrl{-1} & \qw &\qw & \qw & \qw \\ - & \qw & \ctrl{-2} & \qw & \qw & \qw \\ - & & & & & \\ - & \qw & \qw & \qw & \ctrl{-4} & \qw \\ -}\] -{\small \begin{verbatim}\Qcircuit @C=1em @R=.3em { - & \targ & \targ & \cds{4}{\cdots} & \targ & \qw\\ - & \ctrl{-1} & \qw &\qw & \qw & \qw \\ - & \qw & \ctrl{-2} & \qw & \qw & \qw \\ - & & & & & \\ - & \qw & \qw & \qw & \ctrl{-4} & \qw \\ -}\end{verbatim}} - -\subsection{How to control anything} - -Controlled-Z gates, wires with bends, and gates that control-on-zero can all be made using the extended family of control commands. The complete family of control commands is \verb=\ctrl=, \verb=\cctrl=, \verb=\ctrlo=, \verb=\cctrlo=, \verb=\control=, and \verb=\controlo=. - -\verb=\ctrlo= is identical to the \verb=\ctrl= command (see \S\ref{S:CNOT}) except that it draws an open bullet (indicating control-on-zero). Both commands place a wire to the left and take one argument indicating which wire to connect to. - -The commands \verb=\cctrl= and \verb=\cctrlo= are identical to the \verb=\ctrl= and \verb=\ctrlo= commands, respectively, except they use \emph{classical wires} instead of quantum ones to do the controlling. These commands may be useful for writing circuits where the gates are conditioned on classical outputs. - -The commands \verb=\control= and \verb=\controlo= are isolated controls; they don't automatically connect to anything. Isolated controls allow you to decide exactly what connections are made to your control operator, which makes them very useful for working with classical wires and rendering things like the controlled-Z. - -Here is an example circuit using various controls. -\[ \Qcircuit @C=1em @R=.7em { - & \ctrl{2} & \ctrlo{1} & \ctrl{1} & \qw & \multigate{1}{U} & \qw \\ - & \qw & \targ & \ctrlo{2} \qw & \ctrl{1} & \ghost{U} & \qw\\ - & \control \qw & \ctrl{1} & \qw & \meter & \cctrlo{-1} &\\ - & \qw & \control \qw & \gate{H} & \meter & \cctrl{-1} -}\] - -{\small \begin{verbatim}\Qcircuit @C=1em @R=.7em { - & \ctrl{2} & \ctrlo{1} & \ctrl{1} - & \qw & \multigate{1}{U} & \qw \\ - & \qw & \targ & \ctrlo{2} \qw - & \ctrl{1} & \ghost{U} & \qw \\ - & \control \qw & \ctrl{1} & \qw - & \meter & \cctrlo{-1} \\ - & \qw & \control \qw & \gate{H} - & \meter & \cctrl{-1} -}\end{verbatim}} - -Note that we, the authors, have used a pair of controls connected by a wire to denote the controlled-Z gate. This isn't standard notation, but we feel it is a logically consistent and concise notation, and it illustrates nicely the symmetry of the controlled-Z gate. We hope to encourage the readers to adopt this notation in their own QCDs. - -\section{Bells and Whistles: Tweaking Your Diagram to Perfection} - -By now, the reader should be able to quickly and easily typeset almost any QCD. Nonetheless, it may occasionally be desirable to decorate or modify a circuit in ways not yet discussed. This section presents additional tricks, options, and commands for putting the final polish on your QCDs. - -\subsection{Spacing\label{S:spaces}} - -The Q-circuit parameters \verb+@R+ and \verb+@C+ were introduced in \S\ref{S:basics}; they are examples of a family of spacing parameters that can appear between the text \verb=\Qcircuit= and the opening curly brace. A more complete list of available parameters is given in the table below. - -{\small \begin{center} - \begin{tabular}{l | l } - \multicolumn{1}{c}{\itshape Parameter} & \multicolumn{1}{c}{\itshape Effect }\\ \hline - \verb+@R=#1+ & Sets the spacing between rows to \verb=#1=.\\ - \verb+@C=#1+ & Sets the spacing between columns to \verb=#1=.\\ - \verb+@!R+ & \parbox[t]{6cm}{Sets all rows to the height of the tallest object in the circuit.}\\ - \verb+@!C+ & \parbox[t]{6cm}{Sets all columns to the width of the widest object in the circuit.}\\ - \verb+@!+ & \parbox[t]{6cm}{Sets all entries to the size of the largest object in the circuit.} - \end{tabular} -\end{center}} - -The \verb=@R= and \verb=@C= parameters adjust the separation between elements, allowing you to dictate the compactness of your QCD. \verb=@!R=, \verb=@!C=, and \verb=@!= force the elements of your circuit to have uniform sizes, this helps to prevent bunching that may occur when a particular row or column contains many small elements. \verb=@!R= is particularly useful for forcing wires to be evenly spaced, as in the following example. -\[ \Qcircuit @C=.7em @R=.3em @!R { - & \qswap & \qw & \qswap & \qw\\ - & \qswap \qwx & \ctrl{1} & \qswap \qwx & \qw \\ - & \qw & \gate{T^\dag} & \qw & \qw -}\] - -{\small \begin{verbatim}\Qcircuit @C=.7em @R=.3em @!R { - & \qswap & \qw & \qswap & \qw\\ - & \qswap \qwx & \ctrl{1} & \qswap \qwx & \qw \\ - & \qw & \gate{T^\dag} & \qw & \qw -}\end{verbatim}} - -\subsection{Labelling \label{S:labels2}} - -A label can be placed anywhere that a gate command might normally appear. Unlike gates, however, Q-circuit treats labels as having zero size when determining the layout of a QCD. This prevents large labels from bending your circuit out of whack, but it also means that labels can overlap with other components. - -Normally an element whose size is set to zero is drawn centered on it's entry. This is what happens when you insert text directly using curly brackets (see \S\ref{S:inserts}). For most labelling, however, it is more useful to have one edge of the label fixed in the center of an entry. For this reason Q-circuit provides a set of label commands, \verb=\lstick=, \verb=\rstick=, \verb=\ustick=, and \verb=\dstick=. The stick commands each cause their contents to ``stick out" from the center of an entry in a different direction. \verb=\lstick=, \verb=\rstick=, \verb=\ustick=, and \verb=\dstick= produce labels that project out to the left, right, top, and bottom respectively. - -Proper usage of \verb=\lstick= and \verb=\rstick= was demonstrated in \S\ref{S:labels}, so the following example focuses on \verb=\ustick= and \verb=\dstick=. -\[ \Qcircuit @C=.7em @R=.3em { - & \ustick{a} \qw & \qw & \qw & \qw & \meter \\ - & \ustick{b} \qw & \qw & \qw & \meter \\ - & & & & \dstick{B} \cwx & \dstick{A} \cwx[-2] -}\] -\\ -{\small \begin{verbatim}\Qcircuit @C=.7em @R=.3em { - & \ustick{a} \qw & \qw & \qw & \qw & \meter \\ - & \ustick{b} \qw & \qw & \qw & \meter \\ - & & & & \dstick{B} \cwx & \dstick{A} \cwx[-2] -}\end{verbatim}} - -\subsection{Grouping} - -It is sometimes useful to box off sections of a circuit to indicate a subcircuit, as in the following example. -\[ \Qcircuit @C=1em @R=1em { - & \ctrl{2} & \qw & \gate{H} & \ctrl{1} & \gate{H} & \qw \\ - & \qw & \ctrl{1} & \gate{H} & \targ & \gate{H} & \qw \\ - & \targ & \targ & \gate{Z} & \qw & \ctrl{-1} & \qw \gategroup{1}{4}{2}{6}{.7em}{--} -}\] -which was typeset using -{\small \begin{verbatim}\Qcircuit @C=1em @R=1em { - & \ctrl{2} & \qw & \gate{H} & \ctrl{1} & - \gate{H} & \qw \\ - & \qw & \ctrl{1} & \gate{H} & \targ & - \gate{H} & \qw \\ - & \targ & \targ & \gate{Z} & \qw & \ctrl{-1} & - \qw \gategroup{1}{4}{2}{6}{.7em}{--} -}\end{verbatim}} -The command that made the dashed box is in the last line of code and is called \verb=\gategroup=. The \verb=\gategroup= command can be placed following any non-empty entry, but, for clarity, it is perhaps best to put it at the end. - -Because it takes six arguments, \verb=\gategroup= looks intimidating, but it is actually relatively easy to use. \verb=\gategroup{#1}{#2}{#3}{#4}{#5}{#6}= highlights the entries between rows \verb=#1= and \verb=#3= and columns \verb=#2= and \verb=#4= by adding a box or a bracket. Argument \verb=#6= selects between various highlights, with the available options being: -\begin{center} {\small \verb=-- . _\} ^\} \{ \} _) ^) ( )=} \end{center} -These options produce a dashed box, a dotted box, a curly brace on the bottom, top, left, or right, and a normal brace on the bottom, top, left, or right. Argument \verb=#5= is twice the spacing from the nearest gate to the box. - -\verb=\gategroup= only checks that the gates at the four corners of the requested region are properly enclosed. As a result, gates along the boundary that are bigger than the corner gates will tend to stick out. This is especially unsightly when the corner entries are wires, though in that case the problem can be fixed by inserting an invisible prop of the desired height (see \S\ref{S:inserts}). - -\section{Acknowledgments} - -The authors would like to thank Aaron Smith, Joe Renes, and Andrew Silberfarb for useful discussions, ideas, and debugging. Thanks to Carl Caves and Michael Nielsen for encouragement on this project. An extra thanks to Michael Nielsen for suggesting some useful \LaTeX \ resources. - -The development of Q-circuit was supported in part by the National Security Agency (NSA) and the Advanced Research and Developement Activity (ARDA) under the Army Research Office (ARO) contract numbers DAAD19-01-1-0648 and W911NF-04-1-0242. - -\appendix -\section{Positioning Q-circuit diagrams in \LaTeX} -Q-circuit produces \TeX\ graphics objects. In theory these objects should act like any symbol or character. Thus, they can be placed in equation environments, arrays, and figures. In practice there are a few, largely unexplained, complications. - -One of these is vertical centering in a line of text. To center the top line of a circuit, it is sufficient to invoke it in inline math mode using \verb=$=. To center the entire circuit, place it inside an array. - -Horizontal centering within figures is also problematic. Typically this can be corrected by placing the \verb=\Qcircuit= command inside a \verb=\centerline= command, an \verb=\mbox= command, or an equation environment. For some \LaTeX\ distributions the commands \verb=\leavevmode= and \verb=\centering= must be added to center a figure. - -Finally, circuits using large labels often appear a bit off center. This is because labels are not included when calculating the size of a circuit. The best solution is probably to add white space (see \S\ref{S:inserts}) until the labels all fit within the boundaries of the circuit. - -\section{Bugs and Future Work} - -\begin{enumerate} -\item Wires often end just short of curved surfaces. -\item \verb=\gategroup= needs to check all the boundary gates when determining the highlighted area. -\item Targets look poor when the font size is set to small. -\item It would be nice if the \verb=\ghost= command could read the argument of the \verb=\multigate= command automatically. -\item Larger issues of centering within \LaTeX\ need to be addressed. -\end{enumerate} - -\section{Code for the Introduction\label{S:code}} -The first QCD depicts a way of decomposing doubly controlled unitaries. -It was typeset with -{\small \begin{verbatim}\Qcircuit @C=.5em @R=0em @!R { - & \ctrl{1} & \qw & & & \qw & \ctrl{1} & \qw & - \ctrl{1} & \ctrl{2} & \qw\\ - & \ctrl{1} & \qw & - \push{\rule{.3em}{0em}=\rule{.3em}{0em}} & & - \ctrl{1} & \targ & \ctrl{1} & \targ & \qw & - \qw\\ - & \gate{U} & \qw & & & \gate{V} & \qw & - \gate{V^\dag} & \qw & \gate{V} & \qw -} -\end{verbatim}} - -The second QCD depicts quantum teleportation and was typeset with -{\small \begin{verbatim}\Qcircuit @C=.7em @R=.4em @! { - \lstick{\ket{\psi}} & \qw & \qw & \ctrl{1} & - \gate{H} & \meter & \control \cw\\ - \lstick{\ket{0}} & \qw & \targ & \targ & \qw & - \meter & \cwx\\ - \lstick{\ket{0}} & \gate{H} & \ctrl{-1} & \qw & - \qw & \gate{X} \cwx & \gate{Z} \cwx & - \rstick{\ket{\psi}} \qw -} -\end{verbatim}} - -The third QCD depicts quantum error correction on the bit flip code. It was typeset with -{\small \begin{verbatim}\Qcircuit @C=1.3em @R=.6em { - & & & & & & \mbox{Syndrome Measurement} & & & & - \mbox{Recovery}\\ - & \qw & \qw & \ctrl{3} & \qw & \qw & \qw & - \ctrl{5} & \qw & \qw & - \multigate{2}{\ \mathcal{R}\ } & \qw\\ - & \qw & \qw & \qw & \ctrl{2} & \ctrl{3} & \qw & - \qw & \qw & \qw & \ghost{\ \mathcal{R}\ } \qw & - \qw\\ - & \qw & \qw & \qw & \qw & \qw & \ctrl{2} & \qw & - \ctrl{3} & \qw & \ghost{\ \mathcal{R}\ } \qw & - \qw\\ - & & \lstick{\ket{0}} & \targ \qw & \targ \qw & - \qw & \qw & \qw & \qw & \measure{M_a} & - \control \cw \cwx\\ - & & \lstick{\ket{0}} & \qw & \qw & \targ \qw & - \targ \qw & \qw & \qw & \measure{M_b} & - \control \cw \cwx\\ - & & \lstick{\ket{0}} & \qw & \qw & \qw & \qw & - \targ \qw & \targ \qw & \measure{M_c} - \gategroup{2}{2}{7}{10}{.8em}{--} & - \control \cw \cwx -} -\end{verbatim}} - -\pagebreak - -\section{Table of Commands} - -The following table is grouped according to the effect of each command.\\ - -{\small \begin{center} - \begin{tabular}{l | l } - \multicolumn{1}{c}{\itshape Subject} & \multicolumn{1}{c}{\itshape Command }\\ \hline - Loading Q-circuit \hspace{.5em} & \verb=\input{Qcircuit}= \\ - Making Circuits & \verb=\Qcircuit= \\ - Spacing & \parbox[t]{6cm}{\tt - @C=\#1 \\ - @R=\#1 \\ - @!R \\ - @!C \\ - @! \\ - \char92 push\{\#1\} \\ - \char92 cds\{\#1\}\{\#2\}}\\ - Wires & \parbox[t]{6cm}{\tt - \char92 qw[\#1] \\ - \char92 qwx[\#1] \\ - \char92 qwa[\#1] \\ - \char92 cw[\#1] \\ - \char92 cwa[\#1] \\ - \char92 cwx[\#1] }\\ - Gates & \parbox[t]{6cm}{\tt - \char92 gate\{\#1\} \\ - \char92 targ \\ - \char92 qswap \\ - \char92 multigate\{\#1\}\{\#2\} \\ - \char92 sgate\{\#1\}\{\#2\}\\ - \char92 ghost\{\#1\} }\\ - Controls & \parbox[t]{6cm}{\tt - \char92 ctrl\{\#1\} \\ - \char92 ctrlo\{\#1\} \\ - \char92 cctrl\{\#1\} \\ - \char92 cctrlo\{\#1\} \\ - \char92 control \\ - \char92 controlo } \\ - Measurements & \parbox[t]{6cm}{\tt - \char92 meter \\ - \char92 meterB\{\#1\} \\ - \char92 smeterB\{\#1\}\{\#2\} \\ - \char92 measure\{\#1\} \\ - \char92 measureD\{\#1\} \\ - \char92 measuretab\{\#1\} \\ - \char92 multimeasure\{\#1\}\{\#2\} \\ - \char92 multimeasureD\{\#1\}\{\#2\} } \\ - Labels & \parbox[t]{6cm}{\tt - \char92 lstick\{\#1\} \\ - \char92 rstick\{\#1\} \\ - \char92 ustick\{\#1\} \\ - \char92 dstick\{\#1\} \\ - \char92 bra\{\#1\} \\ - \char92 ket\{\#1\} \\ - \char92 gategroup\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\{\#6\}\\ - \char92 inputgroup\{\#1\}\{\#2\}\{\#3\}\{\#4\}\\ - \char92 inputgroupv\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\\ - \char92 inputgrouph\{\#1\}\{\#2\}\{\#3\}\{\#4\}\{\#5\}\\ - } - \end{tabular} -\end{center}} - -\end{document} Binary files old/doc/latex/qcircuit/qcircuit.pdf and new/doc/latex/qcircuit/qcircuit.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qcircuit.doc.tlpobj new/tlpkg/tlpobj/qcircuit.doc.tlpobj --- old/tlpkg/tlpobj/qcircuit.doc.tlpobj 2016-04-14 19:44:22.000000000 +0200 +++ new/tlpkg/tlpobj/qcircuit.doc.tlpobj 2017-04-14 17:59:35.000000000 +0200 @@ -1,9 +1,8 @@ name qcircuit.doc category Package -revision 40319 +revision 42816 shortdesc doc files of qcircuit relocated 1 -docfiles size=87 - RELOC/doc/latex/qcircuit/Qtutorial.pdf - RELOC/doc/latex/qcircuit/Qtutorial.tex +docfiles size=74 RELOC/doc/latex/qcircuit/README.md + RELOC/doc/latex/qcircuit/qcircuit.pdf ++++++ qcircuit.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tex/latex/qcircuit/qcircuit.sty new/tex/latex/qcircuit/qcircuit.sty --- old/tex/latex/qcircuit/qcircuit.sty 2016-04-07 22:47:22.000000000 +0200 +++ new/tex/latex/qcircuit/qcircuit.sty 2016-12-31 05:01:06.000000000 +0100 @@ -1,4 +1,4 @@ -% qcircuit version 2.5.2 +% qcircuit version 2.5.3 % Contributors: Steve Flammia, Bryan Eastin, Travis Scholten % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ % Thanks also to Dave Clader, Andrew Childs, Rafael Possignolo, Tyson Williams, % Sergio Boixo, Cris Moore, Jonas Anderson, and Stephan Mertens for helping us test % and/or develop the new version. -\ProvidesPackage{qcircuit}[2016/04/06] +\ProvidesPackage{qcircuit}[2016/12/29] \RequirePackage{xy} \DeclareOption{braket}{ @@ -28,11 +28,11 @@ } \DeclareOption{qm}{ - \newcommand{\ip}[2]{\ensuremath{\left\langle{#1}\right\vert{#2}\rangle}} - \newcommand{\melem}[3]{\ensuremath{\left\langle{#1}\right\vert{#2}\vert{#3}\rangle}} + \newcommand{\ip}[2]{\ensuremath{\left\langle{#1}\middle\vert{#2}\right\rangle}} + \newcommand{\melem}[3]{\ensuremath{\left\langle{#1}\middle\vert{#2}\middle\vert{#3}\right\rangle}} \newcommand{\expval}[1]{\ensuremath{\left\langle #1 \right\rangle}} - \newcommand{\op}[2]{\ensuremath{\vert{#1}\rangle\langle{#2}\vert}} - } + \newcommand{\op}[2]{\ensuremath{\left\vert{#1}\middle\rangle\middle\langle{#2}\right\vert}} +} \ProcessOptions\relax diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qcircuit.tlpobj new/tlpkg/tlpobj/qcircuit.tlpobj --- old/tlpkg/tlpobj/qcircuit.tlpobj 2016-04-14 19:44:22.000000000 +0200 +++ new/tlpkg/tlpobj/qcircuit.tlpobj 2017-04-14 17:59:35.000000000 +0200 @@ -1,6 +1,6 @@ name qcircuit category Package -revision 40319 +revision 42816 shortdesc Macros to generate quantum ciruits relocated 1 longdesc The package supports those within the quantum information @@ -9,7 +9,7 @@ runfiles size=4 RELOC/tex/latex/qcircuit/qcircuit.sty catalogue-ctan /graphics/qcircuit -catalogue-date 2016-04-07 05:38:11 +0200 +catalogue-date 2016-12-29 23:31:35 +0100 catalogue-license gpl2 catalogue-topics diagram-circ graphics-in-tex -catalogue-version 2.5.2 +catalogue-version 2.5.3 ++++++ qcm.doc.tar.xz ++++++ ++++++ qcm.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qcm.tlpobj new/tlpkg/tlpobj/qcm.tlpobj --- old/tlpkg/tlpobj/qcm.tlpobj 2016-04-14 19:44:23.000000000 +0200 +++ new/tlpkg/tlpobj/qcm.tlpobj 2017-04-14 17:59:35.000000000 +0200 @@ -19,7 +19,7 @@ RELOC/tex/latex/qcm/qcm.cls RELOC/tex/latex/qcm/qcm.sty catalogue-ctan /macros/latex/contrib/qcm -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics exam catalogue-version 2.1 ++++++ qobitree.doc.tar.xz ++++++ ++++++ qobitree.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qobitree.tlpobj new/tlpkg/tlpobj/qobitree.tlpobj --- old/tlpkg/tlpobj/qobitree.tlpobj 2016-04-14 19:44:23.000000000 +0200 +++ new/tlpkg/tlpobj/qobitree.tlpobj 2017-04-14 17:59:35.000000000 +0200 @@ -9,6 +9,6 @@ runfiles size=6 RELOC/tex/latex/qobitree/qobitree.tex catalogue-ctan /macros/latex/contrib/qobitree -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics tree ++++++ qpxqtx.doc.tar.xz ++++++ ++++++ qpxqtx.tar.xz ++++++ ++++++ qrcode.doc.tar.xz ++++++ ++++++ qrcode.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qrcode.tlpobj new/tlpkg/tlpobj/qrcode.tlpobj --- old/tlpkg/tlpobj/qrcode.tlpobj 2016-04-14 19:44:23.000000000 +0200 +++ new/tlpkg/tlpobj/qrcode.tlpobj 2017-04-14 17:59:35.000000000 +0200 @@ -9,7 +9,7 @@ RELOC/tex/latex/qrcode/qrcode.sty catalogue-also pst-barcode catalogue-ctan /macros/latex/contrib/qrcode -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics barcode qrcode rule catalogue-version 1.51 ++++++ qstest.doc.tar.xz ++++++ ++++++ qstest.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qstest.tlpobj new/tlpkg/tlpobj/qstest.tlpobj --- old/tlpkg/tlpobj/qstest.tlpobj 2016-04-14 19:44:24.000000000 +0200 +++ new/tlpkg/tlpobj/qstest.tlpobj 2017-04-14 17:59:36.000000000 +0200 @@ -18,6 +18,6 @@ RELOC/tex/latex/qstest/makematch.sty RELOC/tex/latex/qstest/qstest.sty catalogue-ctan /macros/latex/contrib/qstest -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics units ++++++ qsymbols.doc.tar.xz ++++++ ++++++ qsymbols.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qsymbols.tlpobj new/tlpkg/tlpobj/qsymbols.tlpobj --- old/tlpkg/tlpobj/qsymbols.tlpobj 2016-04-14 19:44:24.000000000 +0200 +++ new/tlpkg/tlpobj/qsymbols.tlpobj 2017-04-14 17:59:36.000000000 +0200 @@ -10,6 +10,6 @@ runfiles size=7 RELOC/tex/latex/qsymbols/qsymbols.sty catalogue-ctan /macros/latex/contrib/qsymbols -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license gpl catalogue-topics shortcut ++++++ qtree.doc.tar.xz ++++++ ++++++ qtree.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/qtree.tlpobj new/tlpkg/tlpobj/qtree.tlpobj --- old/tlpkg/tlpobj/qtree.tlpobj 2016-04-14 19:44:24.000000000 +0200 +++ new/tlpkg/tlpobj/qtree.tlpobj 2017-04-14 17:59:36.000000000 +0200 @@ -14,7 +14,7 @@ RELOC/tex/latex/qtree/qtree.sty catalogue-also tree-dvips catalogue-ctan /macros/latex/contrib/qtree -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics tree linguistic catalogue-version 3.1b ++++++ quattrocento.doc.tar.xz ++++++ ++++++ quattrocento.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/quattrocento.tlpobj new/tlpkg/tlpobj/quattrocento.tlpobj --- old/tlpkg/tlpobj/quattrocento.tlpobj 2016-04-14 19:44:25.000000000 +0200 +++ new/tlpkg/tlpobj/quattrocento.tlpobj 2017-04-14 17:59:36.000000000 +0200 @@ -247,6 +247,6 @@ RELOC/tex/latex/quattrocento/TS1QuattrocentoSans-TLF.fd RELOC/tex/latex/quattrocento/quattrocento.sty catalogue-ctan /fonts/quattrocento -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics font-sans font-serif font-type1 font-otf ++++++ quotchap.doc.tar.xz ++++++ ++++++ quotchap.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/quotchap.tlpobj new/tlpkg/tlpobj/quotchap.tlpobj --- old/tlpkg/tlpobj/quotchap.tlpobj 2016-04-14 19:44:28.000000000 +0200 +++ new/tlpkg/tlpobj/quotchap.tlpobj 2017-04-14 17:59:37.000000000 +0200 @@ -9,7 +9,7 @@ runfiles size=2 RELOC/tex/latex/quotchap/quotchap.sty catalogue-ctan /macros/latex/contrib/quotchap -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license gpl catalogue-topics headings catalogue-version 1.1 ++++++ quoting.doc.tar.xz ++++++ ++++++ quoting.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/quoting.tlpobj new/tlpkg/tlpobj/quoting.tlpobj --- old/tlpkg/tlpobj/quoting.tlpobj 2016-04-14 19:44:28.000000000 +0200 +++ new/tlpkg/tlpobj/quoting.tlpobj 2017-04-14 17:59:37.000000000 +0200 @@ -13,7 +13,7 @@ runfiles size=1 RELOC/tex/latex/quoting/quoting.sty catalogue-ctan /macros/latex/contrib/quoting -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics quotation catalogue-version 0.1c ++++++ quotmark.doc.tar.xz ++++++ ++++++ quotmark.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/quotmark.tlpobj new/tlpkg/tlpobj/quotmark.tlpobj --- old/tlpkg/tlpobj/quotmark.tlpobj 2016-04-14 19:44:28.000000000 +0200 +++ new/tlpkg/tlpobj/quotmark.tlpobj 2017-04-14 17:59:38.000000000 +0200 @@ -49,7 +49,7 @@ RELOC/tex/latex/quotmark/quotmark-welsh.def RELOC/tex/latex/quotmark/quotmark.sty catalogue-ctan /macros/latex/contrib/quotmark -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics quotation catalogue-version 1.0 ++++++ quran.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/xelatex/quran/README new/doc/xelatex/quran/README --- old/doc/xelatex/quran/README 2016-05-16 00:11:54.000000000 +0200 +++ new/doc/xelatex/quran/README 2017-02-28 23:01:04.000000000 +0100 @@ -1,6 +1,6 @@ _____________________ The quran package -v1.14 +v1.252 The package is prepared for typesetting the Holy Quran. This work is inspired by lipsum and ptext packages, provides several macros for typesetting the whole or @@ -8,12 +8,12 @@ For more information, please see the documentation. -Current version release date: 2016/05/15 +Current version release date: 2017/02/28 ___________________ Seiied-Mohammad-Javad Razvian javadr@gmail.com -Copyright © 2015-2016 +Copyright © 2015-2017 It may be distributed and/or modified under the LaTeX Project Public License, version 1.3c or higher (your choice). The latest version of this license is at: http://www.latex-project.org/lppl.txt Binary files old/doc/xelatex/quran/defaulttext.pdf and new/doc/xelatex/quran/defaulttext.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/xelatex/quran/defaulttext.tex new/doc/xelatex/quran/defaulttext.tex --- old/doc/xelatex/quran/defaulttext.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/xelatex/quran/defaulttext.tex 2016-11-25 19:30:55.000000000 +0100 @@ -0,0 +1,13 @@ +\documentclass{standalone} + +\usepackage{quran} +\usepackage{xepersian} +\settextfont{Scheherazade} + +\begin{document} + +\begin{minipage}{.45\textwidth} +{\quransurah*[1]} +\end{minipage} + +\end{document} Binary files old/doc/xelatex/quran/quran-doc.pdf and new/doc/xelatex/quran/quran-doc.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/xelatex/quran/quran-doc.tex new/doc/xelatex/quran/quran-doc.tex --- old/doc/xelatex/quran/quran-doc.tex 2016-05-16 00:11:54.000000000 +0200 +++ new/doc/xelatex/quran/quran-doc.tex 2017-02-28 23:01:04.000000000 +0100 @@ -1,5 +1,6 @@ \documentclass{ltxdoc} -%\usepackage{pgffor} + +%\usepackage{caption} \usepackage{forloop} \usepackage{pgf} %\usepackage{pgfcalendar} @@ -11,7 +12,12 @@ \usepackage{tikz} \usetikzlibrary{calc} \usepackage{fontspec} -\newfontfamily\quran{Scheherazade} +\newfontfamily\quran[Script=Arabic]{Scheherazade} +% because of definition of \XeTeX and \XeLaTeX symbols in bidi, I should undef these macro that are also defined in holtxdoc package. +\makeatletter +\bidi@undef\XeTeX +\bidi@undef\XeLaTeX +\makeatother \usepackage{bidi} \makeatletter \bidi@preto\qurantext{\quran} @@ -64,17 +70,18 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\begin{document} \title{\includegraphics[scale=.3]{quran.png}\\ The \xpackage{quran} Package\footnote{to one who has devoted his life to Quran}} \author{Seiied Mohammad Javad Razavian\\\xemail{javadr@gmail.com}} -\date{May 15, 2016} +\date{February 28, 2017} + +\begin{document} \maketitle \begin{framed} This manual is incomplete and the package is under development. \par -\centerline{ver 1.14} +\centerline{ver 1.252} \end{framed} \tableofcontents @@ -92,7 +99,7 @@ terminal and to the log file, too. The information is something like: \begin{lstlisting}[style=BashInputStyle, language=tex] -Package: quran 2016/05/15 v1.14 An easy way to typeset the whole or any part of The Holy Quran +Package: quran 2016/12/25 v1.251 An easy way to typeset the whole or any part of The Holy Quran \end{lstlisting} \section{Typesetting The Holy Quran} @@ -106,8 +113,8 @@ e.g. both of \cs{quransurah[1]} and \cs{quransurah[Al-Fatiha]} have the same effect. For using surah's name instead of their order see table~\ref{tab1}. \marginpar{\cs{quransurah[1]}}\marginpar{\cs{quransurah[Al-Fatiha]}} - \hbox{\mx{quransurah[94]}{\quransurah[94]}\hfill - \mx{quransurah[At-Tin]}{\quransurah[At-Tin]}} + \centerline{\hbox{\mx{quransurah[94]}{\quransurah[94]}\hfill + \mx{quransurah[At-Tin]}{\quransurah[At-Tin]}}} \begin{declcs}{quransurah}\oarg{m-n} \end{declcs} @@ -118,8 +125,8 @@ In this case m and n are tranliterations of surah's names, e.g. \cs{quransurah[An-Nasr--An-Nas]}. \marginpar{\cs{quransurah[An-Nasr--An-Nas]}} - \hbox{\mx{quransurah[109-110]}{\quransurah[109-110]}\hfill - \mx{quransurah[Al-Masadd--Al-Ikhlas]}{\quransurah[Al-Masadd--Al-Ikhlas]}} + \centerline{\hbox{\mx{quransurah[109-110]}{\quransurah[109-110]}\hfill + \mx{quransurah[Al-Masadd--Al-Ikhlas]}{\quransurah[Al-Masadd--Al-Ikhlas]}}} \newcounter{ct} \def\mycell#1{ @@ -166,15 +173,15 @@ \end{declcs} The above macro typeset the \textit{n}$^{th}$ Ayah of \textit{l}$^{th}$ Surah. - \hbox{\mx{quranayah[33][33]}{\quranayah[33][33]}\hfill - \mx{quranayah[Al-Ahzab][33]}{\quranayah[Al-Ahzab][33]}} + \centerline{\hbox{\mx{quranayah[33][33]}{\quranayah[33][33]}\hfill + \mx{quranayah[Al-Ahzab][33]}{\quranayah[Al-Ahzab][33]}}} If you just typeset the first Ayah of any Surah, then the Basmalah will not be printed. In this case if you need Basmalah, then you can use the \cs{basmalah} macro before. \marginpar{\cs{basmalah}} - \hbox{\mx{quranayah[Ibrahim][1]}{\quranayah[Ibrahim][1]}\hfill - \mx{basmalah\textbackslash{}quranayah[14][1]}{\quran\basmalah\quranayah[14][1]}} + \centerline{\hbox{\mx{quranayah[Ibrahim][1]}{\quranayah[Ibrahim][1]}\hfill + \mx{basmalah\textbackslash{}quranayah[14][1]}{\quran\basmalah\quranayah[14][1]}}} \begin{declcs}{quranayah}\oarg{l}\oarg{m-n} \end{declcs} @@ -188,8 +195,8 @@ \textit{n} is diffirent by every Surah and it relies on the number of the Surah's verses. \textit{m} should be between 1 and a number less than \textit{n}. - \hbox{\mx{quranayah[Ash-Shura][22-26]}{\quranayah[Ash-Shura][22-26]}\hfill - \mx{quranayah[42][22-26]}{\quranayah[42][22-26]}} + \centerline{\hbox{\mx{quranayah[Ash-Shura][22-26]}{\quranayah[Ash-Shura][22-26]}\hfill + \mx{quranayah[42][22-26]}{\quranayah[42][22-26]}}} \subsection{Page/Pages} \begin{declcs}{quranpage}\oarg{n} @@ -201,9 +208,9 @@ \end{declcs} The numbers should be between $1$ to $604$, based on Uthmani text. - \hboxR{\mx{quranpage*[249]}{\quranpage*[249]} + \centerline{\hboxR{\mx{quranpage*[249]}{\quranpage*[249]} \hfill - \mx{quranpage*[250]}{\quranpage*[250]}} + \mx{quranpage*[250]}{\quranpage*[250]}}} * starred version of macros are explained in page~\pageref{starred}; concisely it means typesetting that part of the Holy Quran in one paragraph. @@ -335,9 +342,9 @@ \end{declcs} This macro returns the arabic name of \textit{m}$^{th}$ Surah. - \hbox{\mx{surahname[19]}{\surahname[19]} + \centerline{\hbox{\mx{surahname[19]}{\surahname[19]} \hfill - \mx{surahname*[19]}{\quran\surahname*[19]}} + \mx{surahname*[19]}{\quran\surahname*[19]}}} \subsection{Basmalah} \begin{declcs}{basmalah} @@ -372,6 +379,14 @@ \centerline{\mxf{ToggleAyahNumber\textbackslash{}quransurah*[89]} {\ToggleAyahNumber\quransurah*[89]}} +By default, the package typesets the text of The Holy Quran in simple script, but if you prefer the Uthmani script you can use \texttt{uthmani} \marginpar{uthmani} +option. Compare the following text to figure out the differences between default and uthmani script. + \centerline{\hbox{ + \mx{quransurah*[1] (default)}{\includegraphics{defaulttext.pdf}} + \hfill + \mx{quransurah*[1] (uthmani)}{\includegraphics{uthmanitext.pdf}} + }} + \section{Acknowledgment} At first, I should appreciate Vafa Khaligi by preparing such adorable packages --\xpackage{bidi} and \xpackage{xepersian}. Secondly, the costly \url{http://tanzil.net/} for providing the text of The Holy Quran that @@ -380,23 +395,35 @@ \section{Frequently Asked Questions} \subsection{What is the best font for typesetting quran text?} - We strongly recommend you to use "Scheherazade" font.% - \footnote{\url{http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=scheherazade}} + We strongly recommend you to use "Scheherazade"% + \footnote{\url{http://software.sil.org/scheherazade/}} + and "Amiri"% + \footnote{\url{http://www.amirifont.org/}} fonts. + Scheherazade is released under the SIL Open Font License (OFL), version 1.1. Copyright (c) 2004-2015, SIL International (http://scripts.sil.org/) with Reserved Font Names "Scheherazade" and "SIL". Therefore you can freely download it. All examples in this document use this font. + Amiri is a classical Arabic typeface in Naskh style for typesetting books and other running text. + Amiri is a revival of the beautiful typeface pioneered in early 20th century by Bulaq Press in Cairo, + also known as Amiria Press, after which the font is named. + Amiri is a free, open source project that everyone is encouraged to use and modify. + \subsection{How to use \xpackage{quran} package?} As you've noticed, for typesetting quran text you need a package that can typeset text - in RTL mode in additon to using UTF8 fonts. The \xpackage{polyglossia}, + in RTL mode in additon to using UTF8 fonts, because \xpackage{quran} draws its text from a + unicoded databases. The \xpackage{polyglossia}, \xpackage{fontspec}, and \xpackage{bidi} will do that for you. - You can also use \xpackage{xepersian} that depends on \xpackage{fontspec}, too. - Below, we demonstrated two examples for both approaches: + You can also use \xpackage{xepersian} that relies on \xpackage{fontspec}, too. + Another choices are \xpackage{arabxetex} and \xpackage{arabluatex} that the latter just + works with \LuaLaTeX{} while former + ways work with \XeLaTeX. \xpackage{arabxetex} and \xpackage{arabluatex} use Amiri font by default. + The following demonstrates examples for all four approaches: \begin{lstlisting}[style=BashInputStyle, language=tex, title=``example: with polyglossia{,} fontspec{,} and bidi"] -\documentclass[12pt]{article} +\documentclass{article} \usepackage{quran} @@ -420,7 +447,7 @@ \begin{lstlisting}[style=BashInputStyle, language=tex, title=``example: with xepersian"] -\documentclass[12pt]{article} +\documentclass{article} \usepackage{quran} @@ -434,6 +461,36 @@ \end{document} \end{lstlisting} + +\begin{lstlisting}[style=BashInputStyle, language=tex, title=``example: with arabxetex"] +\documentclass{article} + +\usepackage{arabxetex} % for typesetting Arabic text in Rigth-To-Left direction +\usepackage{quran} + +\begin{document} + +\begin{arab}[utf] + \quransurah +\end{arab} + +\end{document} +\end{lstlisting} + +\begin{lstlisting}[style=BashInputStyle, language=tex, title=``example: with arabluatex"] +\documentclass{article} + +\usepackage{arabluatex} % for typesetting Arabic text in Rigth-To-Left direction +\usepackage{quran} + +\begin{document} + +\begin{txarab} + \quransurah +\end{txarab} + +\end{document} +\end{lstlisting} \subsection{How to set quran default font?} If you want to automatically change the font of quran text in your document, you Binary files old/doc/xelatex/quran/quran-test1.pdf and new/doc/xelatex/quran/quran-test1.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/xelatex/quran/quran-test1.tex new/doc/xelatex/quran/quran-test1.tex --- old/doc/xelatex/quran/quran-test1.tex 2016-05-16 00:11:54.000000000 +0200 +++ new/doc/xelatex/quran/quran-test1.tex 2016-11-25 19:30:55.000000000 +0100 @@ -1,6 +1,6 @@ \documentclass[12pt]{article} -\usepackage{quran} +\usepackage[uthmani]{quran} %%% for typesetting arabic text \usepackage{polyglossia} \setotherlanguage{arabic} Binary files old/doc/xelatex/quran/uthmanitext.pdf and new/doc/xelatex/quran/uthmanitext.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/xelatex/quran/uthmanitext.tex new/doc/xelatex/quran/uthmanitext.tex --- old/doc/xelatex/quran/uthmanitext.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/xelatex/quran/uthmanitext.tex 2016-11-25 19:30:55.000000000 +0100 @@ -0,0 +1,13 @@ +\documentclass{standalone} + +\usepackage[uthmani]{quran} +\usepackage{xepersian} +\settextfont{Scheherazade} + +\begin{document} + +\begin{minipage}{.45\textwidth} +{\quransurah*[1]} +\end{minipage} + +\end{document} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/quran.doc.tlpobj new/tlpkg/tlpobj/quran.doc.tlpobj --- old/tlpkg/tlpobj/quran.doc.tlpobj 2016-05-16 00:52:40.000000000 +0200 +++ new/tlpkg/tlpobj/quran.doc.tlpobj 2017-04-14 17:59:38.000000000 +0200 @@ -1,10 +1,12 @@ name quran.doc category Package -revision 41165 +revision 43360 shortdesc doc files of quran relocated 1 -docfiles size=89 +docfiles size=112 RELOC/doc/xelatex/quran/README + RELOC/doc/xelatex/quran/defaulttext.pdf + RELOC/doc/xelatex/quran/defaulttext.tex RELOC/doc/xelatex/quran/quran-doc.pdf RELOC/doc/xelatex/quran/quran-doc.tex RELOC/doc/xelatex/quran/quran-test.pdf @@ -14,3 +16,5 @@ RELOC/doc/xelatex/quran/quran-test2.pdf RELOC/doc/xelatex/quran/quran-test2.tex RELOC/doc/xelatex/quran/quran.png + RELOC/doc/xelatex/quran/uthmanitext.pdf + RELOC/doc/xelatex/quran/uthmanitext.tex ++++++ quran.tar.xz ++++++ ++++ 37895 lines of diff (skipped) ++++++ r_und_s.doc.tar.xz ++++++ ++++++ r_und_s.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/r_und_s.tlpobj new/tlpkg/tlpobj/r_und_s.tlpobj --- old/tlpkg/tlpobj/r_und_s.tlpobj 2016-04-14 19:44:31.000000000 +0200 +++ new/tlpkg/tlpobj/r_und_s.tlpobj 2017-04-14 17:59:39.000000000 +0200 @@ -21,7 +21,7 @@ RELOC/tex/latex/r_und_s/r_und_s.tex catalogue-also mhchem catalogue-ctan /macros/latex/contrib/r_und_s -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license other-free catalogue-topics safety-notice catalogue-version 1.3i ++++++ raleway.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/raleway/LPPL.txt new/doc/latex/raleway/LPPL.txt --- old/doc/latex/raleway/LPPL.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/raleway/LPPL.txt 2016-12-04 00:01:03.000000000 +0100 @@ -0,0 +1,416 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. + Binary files old/doc/latex/raleway/raleway.pdf and new/doc/latex/raleway/raleway.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/raleway/raleway.tex new/doc/latex/raleway/raleway.tex --- old/doc/latex/raleway/raleway.tex 2015-05-14 23:23:49.000000000 +0200 +++ new/doc/latex/raleway/raleway.tex 2016-12-04 00:01:03.000000000 +0100 @@ -18,8 +18,7 @@ } \author{Silke Hofstra, \href{mailto:tex@slxh.nl}{tex@slxh.nl}} -\date{Documentation for raleway v1.3.\\ \today} -\listfiles +\date{Documentation for raleway v1.4.\\ \today} \begin{document} \maketitle \begin{multicols}{2} @@ -117,6 +116,11 @@ \textbf{Please note:} to use italic smallcaps the \texttt{slantsc} package is required. \section{Version history} +\subsection*{1.4} +\begin{itemize*} + \item Johannes Choo: have sfdefault set ItalicFont and BoldItalicFont (Fixes \href{https://github.com/silkeh/latex-raleway/issues/1}{issue~\#1}). +\end{itemize*} + \subsection*{1.3} \begin{itemize*} \item Fixed scaling issue. @@ -183,4 +187,3 @@ (list generated with otfinfo) \end{document} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/raleway.doc.tlpobj new/tlpkg/tlpobj/raleway.doc.tlpobj --- old/tlpkg/tlpobj/raleway.doc.tlpobj 2016-04-14 19:44:31.000000000 +0200 +++ new/tlpkg/tlpobj/raleway.doc.tlpobj 2017-04-14 17:59:39.000000000 +0200 @@ -1,9 +1,10 @@ name raleway.doc category Package -revision 37394 +revision 42629 shortdesc doc files of raleway relocated 1 -docfiles size=87 +docfiles size=92 + RELOC/doc/latex/raleway/LPPL.txt RELOC/doc/latex/raleway/OFL.txt RELOC/doc/latex/raleway/raleway-otf-specimen.pdf RELOC/doc/latex/raleway/raleway-otf-specimen.tex ++++++ raleway.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tex/latex/raleway/raleway.sty new/tex/latex/raleway/raleway.sty --- old/tex/latex/raleway/raleway.sty 2015-05-14 23:23:49.000000000 +0200 +++ new/tex/latex/raleway/raleway.sty 2016-12-04 00:01:02.000000000 +0100 @@ -8,7 +8,7 @@ % Licenced under the LPPL v1.3 or higher. % \NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{raleway}[2015/01/11 v1.3 Matt McInerney’s Raleway family] +\ProvidesPackage{raleway}[2016/12/03 v1.4 Matt McInerney’s Raleway family] \RequirePackage{ifxetex,ifluatex,xkeyval} @@ -122,7 +122,10 @@ \ifraleway@sfdefault \setsansfont [ UprightFont = *-\raleway@regstyle , - BoldFont = *-\raleway@boldstyle ] + ItalicFont = *-\raleway@regstyle-Italic , + BoldFont = *-\raleway@boldstyle , + BoldItalicFont = *-\raleway@boldstyle-Italic + ] {Raleway} \fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/raleway.tlpobj new/tlpkg/tlpobj/raleway.tlpobj --- old/tlpkg/tlpobj/raleway.tlpobj 2016-04-14 19:44:31.000000000 +0200 +++ new/tlpkg/tlpobj/raleway.tlpobj 2017-04-14 17:59:39.000000000 +0200 @@ -1,6 +1,6 @@ name raleway category Package -revision 37394 +revision 42629 shortdesc Use Raleway with TeX(-alike) systems relocated 1 longdesc The package provides the Raleway family in an easy to use way. @@ -754,7 +754,7 @@ RELOC/tex/latex/raleway/raleway-type1-autoinst.sty RELOC/tex/latex/raleway/raleway.sty catalogue-ctan /fonts/raleway -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-12-03 18:07:41 +0100 catalogue-license ofl catalogue-topics font font-sans font-type1 font-otf font-supp -catalogue-version 1.3 +catalogue-version 1.4 ++++++ ran_toks.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/README.md new/doc/latex/ran_toks/README.md --- old/doc/latex/ran_toks/README.md 2016-02-12 01:26:01.000000000 +0100 +++ new/doc/latex/ran_toks/README.md 2017-05-19 23:06:02.000000000 +0200 @@ -1,7 +1,6 @@ The ran_toks Package Author: D. P. Story -Dated: 2016/02/06 -Version: v1.0e +Dated: 2017/05/04 This short package, with minimal requirements, defines macros for randomizing a list of tokens. There are two approaches: @@ -38,15 +37,16 @@ \useRanTok{4}, and {\useRanTok{5}} to obtain a random listing of the tokens in the myList list. -For user of AeB or eqexam, the latter structure can be used to randomize +For users of AeB or eqexam, the latter structure can be used to randomize the order of the questions on a quiz or exam. -If the ran_toks.sty file is not provided in the distribution, then tex (not latex) -the file ran_toks.dtx. +What's new in v1.1: Added the convenience command \useTheseDBs to input files for +an application to constructing exams (using eqexam) from a series of DB files. Refer to the +new demo file mc-db.tex. Enjoy! Now, I must get back to my retirement. dps -2016/02/08 + Binary files old/doc/latex/ran_toks/doc/rantoks_man.pdf and new/doc/latex/ran_toks/doc/rantoks_man.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/doc/rantoks_man.tex new/doc/latex/ran_toks/doc/rantoks_man.tex --- old/doc/latex/ran_toks/doc/rantoks_man.tex 2016-02-12 01:26:01.000000000 +0100 +++ new/doc/latex/ran_toks/doc/rantoks_man.tex 2017-05-19 23:06:02.000000000 +0200 @@ -7,13 +7,15 @@ ]{aeb_pro} \usepackage{ran_toks} -%\useThisSeed{1441984427} +\useThisSeed{1441984427} %\useLastAsSeed -\useThisSeed{2001383846} +%\useThisSeed{2001383846} %2001383846 % initializing seed value %1629639958 % last random number used +\let\pkg\textsf +\let\env\texttt %\rtdebugtrue %\ranToksOn @@ -41,11 +43,13 @@ \makeatother \def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} +\let\ameta\anglemeta \def\meta#1{\textit{\texttt{#1}}} \def\darg#1{\texttt{\{#1\}}} \def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} \def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} \def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} + \usepackage[active]{srcltx} \let\amtIndent\leftmargini @@ -68,7 +72,7 @@ email={dpstory@acrotex.net}, subject=Documentation for the ran\_toks package, talksite={\url{www.acrotex.net}}, - version={1.0e}, + version={1.1}, Keywords={LaTeX,PDF,random, tokens, JavaScript,Adobe Acrobat}, copyrightStatus=True, copyrightNotice={Copyright (C) \the\year, D. P. Story}, @@ -94,17 +98,52 @@ %\pagestyle{empty} %\parindent0pt\parskip\medskipamount - -\definePath\bgPath{"C:/Users/Public/Documents/% - ManualBGs/Manual_BG_Print_AeB.pdf"} +\chngDocObjectTo{\newDO}{doc} \begin{docassembly} -\addWatermarkFromFile({% - bOnTop: false, - cDIPath: \bgPath -}) -\executeSave() +var titleOfManual="The ran_toks Package"; +var manualfilename="Manual_BG_Print_rt.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); \end{docassembly} +%\definePath\bgPath{"C:/Users/Public/Documents/% +% ManualBGs/Manual_BG_Print_AeB.pdf"} +%\begin{docassembly} +%\addWatermarkFromFile({% +% bOnTop: false, +% cDIPath: \bgPath +%}) +%\executeSave() +%\end{docassembly} + \begin{document} \maketitle @@ -123,12 +162,18 @@ \newtopic\noindent\exSrc The \texttt{examples} folder contains three demonstration files: \begin{enumerate} \item \texttt{ran\_toks.tex} reproduces the sample code of this manual. - \item \texttt{random\_tst.tex} shows how to use \textsf{ran\_toks} to + \item \texttt{random\_tst.tex} shows how to use \pkg{ran\_toks} to randomize the \emph{questions} of an exam document created by the - \textsf{eqexam} package. + \pkg{eqexam} package. \item \texttt{random\_tst\_qz.tex} shows how to randomize choices of a - multiple choice field in a \texttt{quiz} environment of the - \textsf{exerquiz} package, when the choices contain verbatim text. + multiple choice field in a \env{quiz} environment of the + \pkg{exerquiz} package, when the choices contain verbatim text. + \item \texttt{mc-db.tex} is an \pkg{eqexam} file that draws from the + database files \texttt{db1.tex}, \texttt{db2.tex}, + \texttt{db3.tex}, and \texttt{db4.tex}, to construct the questions + of the exam. The questions are drawn at random from the DB files. Refer + to \hyperref[s:DBConcept]{Section~\ref*{s:DBConcept}} for a few more details. + \end{enumerate} \section{The Preamble and Package Options} @@ -144,7 +189,7 @@ The requirements for \textsf{ran\_toks} are the \textsf{verbatim} package (part of the standard {\LaTeX} distribution, and the macro file -\texttt{random.tex} by Donald Arseneau +\texttt{random.tex} by Donald Arseneau. \section{The main commands and environments}\label{rtmain} @@ -153,8 +198,7 @@ using either the \cs{ranToks} command or the \cs{bRTVToks}/\cs{eRTVToks} pair. Each of these is discussed in the next two subsections. -\subsection{The \texorpdfstring{\protect\cs{ranToks} -command}{\CMD{ranToks}} command} +\subsection{The \texorpdfstring{\protect\cs{ranToks}}{\CMD{ranToks}} command} The \cs{ranToks} command was the original concept; declare a series of tokens to be randomized. @@ -234,15 +278,41 @@ Repeating the sentence yields, ``I have {\nToksFor{myPals}} pals, they are \useRanTok{1}, \useRanTok{2}, \useRanTok{3}, \useRanTok{4}, -{\useRanTok{5}} and \useRanTok{6}'' the exact same random order. To obtain -a different order, re-execute the \cs{ranToks} command with the same -arguments. Doing just that, \ranToks{myPals}{{Jim}{Richard}{Don} +{\useRanTok{5}} and \useRanTok{6}'', which is the exact same random order. To +obtain a different order, re-execute the \cs{ranToks} command with the same +arguments.\footnote{{\ttfamily\string\ranToks\darg{myPals}\darg{\darg{Jim}\darg{Richard}\darg{Don}\darg{Alex}\darg{Tom}\darg{J\string\"\darg{u}rgen}}} in this example.} Doing just that, \ranToks{myPals}{{Jim}{Richard}{Don} {Alex}{Tom}{J\"{u}rgen}}we obtain, ``I have {\nToksFor{myPals}} pals, they are \useRanTok{1}, \useRanTok{2}, \useRanTok{3}, \useRanTok{4}, -{\useRanTok{5}} and \useRanTok{6}.'' A new order? For most applications, -re-randomizing the same token list in the same document is not very likely -something you need to do. +{\useRanTok{5}} and \useRanTok{6}.'' A new order? +An alternative to re-executing \cs{ranToks} is to use the \cs{reorderRanToks} command: +\bVerb\takeMeasure{\string\reorderRanToks\darg{\meta{name}}}% +\begin{minipage}{\bxSize}\kern0pt +\begin{Verbatim}[frame=single,commandchars=!()] +\reorderRanToks{!meta(name)} +\end{Verbatim} +\end{minipage}\eVerb Now, executing \verb~\reorderRanToks{myPals}~ and compiling the sentence again yields, +``I have {\nToksFor{myPals}} pals, they are +\useRanTok{1}, \useRanTok{2}, \useRanTok{3}, \useRanTok{4}, +{\useRanTok{5}} and \useRanTok{6}.'' For most applications, re-randomizing +the same token list in the same document is not very likely something you +need to do. + +The \cs{reorderRanToks\darg{\meta{name}}} rearranges the list of tokens +associated with \ameta{name}, which may not be what you want; the +\cs{copyRanToks} command, on the other hand, makes a (randomized) copy of its +first required argument \ameta{name\SUB1} and saves it as \ameta{name\SUB2}, without +effecting the order of \ameta{name\SUB1}. +\bVerb\takeMeasure{\string\copyRanToks\darg{\ameta{name\SUB1}}\darg{\ameta{name\SUB2}}}% +\begin{minipage}{\bxSize}\kern0pt +\begin{Verbatim}[frame=single,commandchars=!()] +\copyRanToks{!ameta(name!SUB1)}{!ameta(name!SUB2)} +\end{Verbatim} +\end{minipage}\eVerb Thus, if \verb!\copyRanToks{myPals}{myPals1}! is executed, the token list name +\texttt{myPals1} contains the names of my pals in another randomized order, +while maintaining the same order of \texttt{myPals}. + +\newtopic My original application for this, the one that motivated writing this package at long last, was the need to arrange several form buttons randomly on the page. My point is that the listing given in the argument @@ -252,25 +322,25 @@ \subsection{The \texorpdfstring{\protect\cs{bRTVToks}/\protect\cs{eRTVToks}} - {\CMD{bRTVToks}/\CMD{eRTVToks}} pair of commands} + {\CMD{bRTVToks}/\CMD{eRTVToks}} pair of commands}\label{ss:RTVToks} Sometimes the content to be randomized is quite large or contains verbatim text. For this, it may be more convenient to use the \cs{bRTVToks}/\penalty0\cs{eRTVToks} command pair. The syntax is \bVerb\takeMeasure{\string\bRTVToks\darg{\meta{name}}\quad}% \edef\WIDTH{\the\wd\webtempboxi}% -\def\1{\rlap{\hspace*{\WIDTH}\texttt{\% End token listing}}}% -\takeMeasure{\string\bRTVToks\darg{\meta{name}}\quad\% <- Begin token listing}% +\def\1{\rlap{\hspace*{\WIDTH}\texttt{\% <-{\sffamily{ End token listing}}}}}% +\takeMeasure{\string\bRTVToks\darg{\meta{name}}\quad\% <-{\sffamily{ Begin token listing}}}% \begin{minipage}{\bxSize}\kern0pt \begin{Verbatim}[frame=single,commandchars=!()] -\bRTVToks{!meta(name)}!quad% <- Begin token listing +\bRTVToks{!meta(name)}!quad% <-!sffamily( Begin token listing) \begin{rtVW} - !anglemeta(content!SUB(1)) +!qquad!ameta(content!SUB(1)) \end{rtVW} ... ... \begin{rtVW} - !anglemeta(content!SUB(n)) +!qquad!ameta(content!SUB(n)) \end{rtVW} !1\eRTVToks \end{Verbatim} @@ -278,7 +348,7 @@ The \cs{bRTVToks}\texttt{\{\meta{name}\}} command begins the (pseudo) environment and is ended by \cs{eRTVToks}. Between these two are a series of \texttt{rtVW} (random toks verbatim write) environments. When the document is -compiled, the contents (\anglemeta{content\SUB{i}}) of each of these environments +compiled, the contents (\ameta{content\SUB{i}}) of each of these environments are written to the computer hard drive and saved under a different name (based on the parameter \meta{name}). Later, using the \cs{useRanTok} commands, they are input back into the document in a random order. @@ -349,6 +419,14 @@ \item \useRanTok{3} \end{enumerate} \end{Verbatim} +The \cs{reorderRanToks} works for lists created by the \cs{bRTVToks}/\penalty0\cs{bRTVToks} construct. +If we say \cs{reorderRanToks\darg{myThoughts}} and reissue the above list, we obtain, +\begin{enumerate}\ranToksOn\reorderRanToks{myThoughts} + \displayListRandomly[\item]{myThoughts} +\end{enumerate} +The command \cs{copyRanToks} works for list created by +\cs{bRTVToks}/\penalty0\cs{bRTVToks} as well. + \paragraph*{On the \cs{displayListRandomly} command.}\label{para:DLR} In the enumerate example immediately above, the items in the list are @@ -359,18 +437,49 @@ \displayListRandomly[\item]{myThoughts} \end{enumerate} \end{Verbatim} -The \cs{displayListRandomly} has the syntax, -\bVerb\takeMeasure{\string\displayListRandomly[\anglemeta{prior}]\darg{\meta{name}}}% +The full syntax for \cs{displayListRandomly} is displayed next. +\bVerb\takeMeasure{\string\displayListRandomly[\ameta{prior}][\ameta{post}]\darg{\meta{name}}}% \begin{minipage}{\bxSize}\kern0pt \begin{Verbatim}[frame=single,commandchars=!()] -\displayListRandomly[!anglemeta(prior)]{!meta(name)} +\displayListRandomly[!ameta(prior)][!ameta(post)]{!meta(name)} \end{Verbatim} \end{minipage} \eVerb The action of \cs{displayListRandomly} is to expand all tokens that -are listed in the \meta{name} token list, each entry is displayed with -\anglemeta{prior}\cs{useRanTok\darg{i}}, where \texttt{i} goes from~1 to -\cs{nToksFor\darg{\meta{name}}}. In the example above, \meta{prior} is -\cs{item}, but normally, its default is empty. +are listed in the \meta{name} token list, each entry is displayed as +\ameta{prior}\cs{useRanTok\darg{i}}\ameta{post}, where \texttt{i} +goes from~1 to \cs{nToksFor\darg{\meta{name}}}. In the example above, +\meta{prior} is \cs{item}, but normally, its default is empty. The defaults +for \ameta{prior} and \ameta{post} are both empty. + +\subparagraph*{The optional arguments.} When only one optional argument is present, +if is interpreted as \ameta{prior}. To obtain a \ameta{post} with no \ameta{prior} +use the syntax, +\begin{quote} +\cs{displayListRandomly[][\ameta{post}]\darg{\ameta{name}}} +\end{quote} +Within \emph{each optional argument}, the four commands \cs{i}, +\cs{first}, \cs{last}, and \cs{lessone} are (locally) defined. The \cs{i} command is the index +counter of the token currently being typeset; \cs{first} is the index of the +first item; \cs{last} is the index of the last item; and \cs{lessone} is one +less than \cs{last}. The two optional arguments and the four commands may use +to perform logic on the token as it is being typeset. For example: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +List of pals: \displayListRandomly + [\ifnum\i=\last and \fi] + [\ifnum\i=\last.\else, \fi]{myPals} +\end{Verbatim} +yields, +\begin{quote} +List of pals: \displayListRandomly + [\ifnum\i=\last and \fi] + [\ifnum\i=\last.\else, \fi]{myPals} +\end{quote} +The optional arguments are wrapped to the next line to keep them within the margins, cool. + +The example above shows the list of my pals with an Oxford comma. How would +you modify the optional argument to get the same listing without the Oxford +comma? (\displayListRandomly[\ifnum\i=\last and \fi][\ifnum\i=\last.\else\ifnum\i=\lessone\relax\space\else, \fi\fi]{myPals}) +Hint: a solution involves the other command \cs{lessone}. @@ -390,11 +499,11 @@ inclusive. The optional argument is useful in special circumstances when you want to mix two random lists together. -\newtopic\noindent To illustrate: \useRanTok[myPals]{1}, \useRanTok[myThoughts]{1} +\newtopic\noindent To illustrate: \useRanTok[myPals]{1}, \useRanTok[myThoughts]{2} \newtopic\noindent The verbatim listing is \begin{Verbatim}[xleftmargin=\amtIndent] -To illustrate: \useRanTok[myPals]{1}, \useRanTok[myThoughts]{1} +To illustrate: \useRanTok[myPals]{1}, \useRanTok[myThoughts]{2} \end{Verbatim} The typeset version looks a little strange, but recall, the text of \texttt{myThoughts} were each put in a \texttt{minipage} of width \texttt{.67\cs{linewidth}}. @@ -440,6 +549,29 @@ `\ranToksOff\ranToks{integers}{ {1}{2}{3}{4}}\ranToksOn $\useRanTok{3} = \rtTokByNum{3} = 3 $'? As anticipated. +To create a non-randomized list of tokens that already have been created (and randomized), use +\cs{copyRanToks}: +\begin{Verbatim}[xleftmargin=\amtIndent] +\ranToksOff\copyRanToks{myPals}{myOriginalPals}\ranToksOn +\end{Verbatim} +Then, using \cs{displayListRandomly} in a clever way, +\begin{Verbatim}[xleftmargin=\amtIndent] +\displayListRandomly[\ifnum\i=\last\space and \fi(\the\i)~] + [\ifnum\i=\last.\else,\fi\space]{myOriginalPals} +\end{Verbatim} +we obtain: \ranToksOff\copyRanToks{myPals}{myOriginalPals}\ranToksOn +\displayListRandomly[\ifnum\i=\last\space and \fi(\the\i)~][\ifnum\i=\last.\else,\fi\space]{myOriginalPals} +The original list for \texttt{myPals} remains unchanged: +\displayListRandomly[\ifnum\i=\last\space and \fi(\the\i)~][\ifnum\i=\last.\else,\fi\space]{myPals} + +The \cs{useRanTok} command---whether it operates on a randomized token list +or not---behaves similarly to an array. Thus, if we wanted the extract +the third entry of the non-randomized token list (array) +\texttt{myOriginalPals}, we do so by expanding the command +\verb!\useRanTok[myOriginalPals]{3}! to produce +\useRanTok[myOriginalPals]{3}. + +\subparagraph*{Document preparation.} The command \cs{ranToksOff} is probably best in the preamble to turn off all randomization while the rest of the document is being composed. @@ -515,6 +647,36 @@ \end{Verbatim} Again, this goes in the preamble. +\section{Commands to support a DB application}\label{s:DBConcept} + +One user wanted to create exams using \pkg{eqexam}, but wanted to randomly +select questions from a series of `database' files. My thought was that +\pkg{ran\_toks} would do the job for him. After setting up a demo for him, I +added the new command \cs{useTheseDBs} to \pkg{ran\_toks}: +\bVerb\takeMeasure{\string\useTheseDBs\darg{\ameta{db\SUB{1}},\ameta{db\SUB{2}},...,\ameta{db\SUB{n}}}}% +\begin{minipage}{\bxSize}\kern0pt +\begin{Verbatim}[frame=single,commandchars=!()] +\useTheseDBs{!ameta(db!SUB(1)),!ameta(db!SUB(2)),...,!ameta(db!SUB(n))} +\useProbDBs{!ameta(db!SUB(1)),!ameta(db!SUB(2)),...,!ameta(db!SUB(n))} +\end{Verbatim} +\end{minipage}\eVerb The argument of \cs{useTheseDBs} is a comma-delimited +list of file names. Each file name contains a +\cs{bRTVToks}/\penalty0\cs{eRTVToks} construct. Within this pair are +\env{rtVW} environments, as described in +\hyperref[ss:RTVToks]{Section~\ref*{ss:RTVToks}}. The \cs{useTheseDBs} +command inputs the files listed in its comma-delimited argument; a warning is +emitted if one or more of the files are not found. The default extension is +\texttt{.tex}, \cs{useTheseDBs\darg{db1,db2}} inputs the files +\texttt{db1.tex} and \texttt{db2.tex}, if they exist, while +\cs{useTheseDBs\darg{db1.def,db2.db}} inputs the files \texttt{db1.def} and +\texttt{db2.db}, if they exist. The command \cs{useProbDBs} is an alias for +\cs{useTheseDBs}. + +The placement of \cs{useTheseDBs} is anywhere prior to the insertion of the +problems into the document, usually in the preamble. + +Refer to the demonstration file \texttt{mc-db.tex} for an example. + \newtopic\noindent Now, I simply must get back to my retirement. \dps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/db1.tex new/doc/latex/ran_toks/examples/db1.tex --- old/doc/latex/ran_toks/examples/db1.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/ran_toks/examples/db1.tex 2017-05-19 23:06:02.000000000 +0200 @@ -0,0 +1,76 @@ +% +% First DB, uses ran_toks and eqexam +% +\bRTVToks{DB1-} + +\begin{rtVW} +\begin{problem}[5] +DB1: First: Which is correct? +\begin{answers}{4} +\bChoices[nCols=1,random,label=db1-1] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\begin{solution} +It is obvious that the answer is `\useSavedAns{db1-1}', that is, alternative \useSavedAlts{db1-1} is correct. +\end{solution} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB1: Second: Which is correct? +\begin{answers}{4} +\bChoices[nCols=1,random,label=db1-2] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\begin{solution} +According to the guy sitting next to me, the answer might be \useSavedAlts{db1-2} +\end{solution} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB1: Third: Which is correct? +\begin{answers}{4} +\bChoices[nCols=1,random,label=db1-3] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\begin{solution} +I know the answer in advance to be \useSavedAlts{db1-3}, but don't tell anyone. +\end{solution} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB1: Fourth: Which is correct? +\begin{answers}{4} +\bChoices[nCols=1,random,label=db1-4] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\begin{solution} +After meditating in the lotus position on this question for many hours, we determine that the correct answer is \textbf{\useSavedAltsAns{db1-4}}. +\end{solution} +\end{problem} +\end{rtVW} + +\eRTVToks + +\endinput diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/db2.tex new/doc/latex/ran_toks/examples/db2.tex --- old/doc/latex/ran_toks/examples/db2.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/ran_toks/examples/db2.tex 2017-05-19 23:06:02.000000000 +0200 @@ -0,0 +1,65 @@ +% +% Second DB, uses ran_toks and eqexam +% + +\bRTVToks{DB2-} + +\begin{rtVW} +\begin{problem}[5] +DB2: First: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB2: Second: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB2: Third: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB2: Fourth: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\eRTVToks + +\endinput \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/db3.tex new/doc/latex/ran_toks/examples/db3.tex --- old/doc/latex/ran_toks/examples/db3.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/ran_toks/examples/db3.tex 2017-05-19 23:06:02.000000000 +0200 @@ -0,0 +1,65 @@ +% +% Third DB, uses ran_toks and eqexam +% + +\bRTVToks{DB3-} + +\begin{rtVW} +\begin{problem}[5] +DB3: First: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB3: Second: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB3: Third: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB3: Fourth: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\eRTVToks + +\endinput \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/db4.tex new/doc/latex/ran_toks/examples/db4.tex --- old/doc/latex/ran_toks/examples/db4.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/ran_toks/examples/db4.tex 2017-05-19 23:06:02.000000000 +0200 @@ -0,0 +1,65 @@ +% +% Fourth DB, uses ran_toks and eqexam +% + +\bRTVToks{DB4-} + +\begin{rtVW} +\begin{problem}[5] +DB4: First: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB4: Second: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB4: Third: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\begin{rtVW} +\begin{problem}[5] +DB4: Fourth: Which is correct? +\begin{answers}{4} +\bChoices[nCols=2,random] + \Ans1 True\eAns + \Ans0 False\eAns + \Ans0 Maybe\eAns + \Ans0 Perhaps\eAns +\eChoices +\end{answers} +\end{problem} +\end{rtVW} + +\eRTVToks + +\endinput \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/mc-db.tex new/doc/latex/ran_toks/examples/mc-db.tex --- old/doc/latex/ran_toks/examples/mc-db.tex 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/latex/ran_toks/examples/mc-db.tex 2017-05-19 23:06:02.000000000 +0200 @@ -0,0 +1,75 @@ +\documentclass{article} +\usepackage[allowrandomize,nosolutions, + forpaper,pointsonleft,noparttotals]{eqexam} +\usepackage{ran_toks} + +\useLastAsSeed +% To reproduce the same pseudo-random sequence, you need to supply a seed +%\useThisSeed{1125676795} + +\examNum{1} +\title[T\nExam]{Test \nExam} +\author{D. P. Story} +\subject[MC]{My Course} +\date{Spring \the\year} +\keywords{Test~\nExam, Section 001} + +\university +{% + THE UNIVERSITY OF AKRON\\ + Theoretical and Applied Mathematics +} +\email{dpstory@uakron.edu} + +% Input the DB files used in the demo file +\useTheseDBs{db1,db2,db3,db4} + + +\begin{document} +\maketitle + +\begin{exam}{Part1} + +\begin{instructions} +Solve each without error. Passing is 100\%. + +\medskip\noindent +This part demonstrates how to not only randomly pull problems (two from each of the DB files) at random, but +to randomize the order they are listed in the exam. +\end{instructions} + +\ranToks{myExam}{% + {\useRanTok[DB1-]{1}} + {\useRanTok[DB1-]{2}} + {\useRanTok[DB2-]{1}} + {\useRanTok[DB2-]{2}} + {\useRanTok[DB3-]{1}} + {\useRanTok[DB3-]{2}} + {\useRanTok[DB4-]{1}} + {\useRanTok[DB4-]{2}} +} +\displayListRandomly{myExam} + +\end{exam} + +\begin{exam}{Part2} + +\begin{instructions} +In this part, we take the same two problems from each of the four DB files, but do not randomize +the order of the questions. +\end{instructions} + +\useRanTok[DB1-]{1} +\useRanTok[DB1-]{2} +\useRanTok[DB2-]{1} +\useRanTok[DB2-]{2} +\useRanTok[DB3-]{1} +\useRanTok[DB3-]{2} +\useRanTok[DB4-]{1} +\useRanTok[DB4-]{2} + +\end{exam} + +\end{document} + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/ran_toks/examples/ran_toks.tex new/doc/latex/ran_toks/examples/ran_toks.tex --- old/doc/latex/ran_toks/examples/ran_toks.tex 2016-02-12 01:26:01.000000000 +0100 +++ new/doc/latex/ran_toks/examples/ran_toks.tex 2017-05-19 23:06:02.000000000 +0200 @@ -1,14 +1,16 @@ \documentclass{article} \usepackage{ran_toks} +\usepackage{ifthen} -%\useThisSeed{606574325} -\useLastAsSeed -%\rtdebugtrue -%\ranToksOn +\useThisSeed{606574325} % comment out this line, and uncomment next line to get ... +%\useLastAsSeed % a new pseudo-random sequence each time you compile. + +% Other useful switches +%\ranToksOn % the default %\ranToksOff \parindent0pt \parskip6pt - +\def\cs#1{\texttt{\char`\\#1}} \begin{document} \begin{center}\bfseries @@ -26,8 +28,8 @@ \useRanTok{3}, \useRanTok{4}, {\useRanTok{5}} and \useRanTok{6}. (Listed in the order of best friend to least best friend.) -Test of the \verb!\bRTVToks!/\verb!\eRTVToks! pair of commands and of the -\texttt{rtVW} environment. +Test of the \verb!\bRTVToks!/\verb!\eRTVToks! pair of commands, which encloses +\texttt{rtVW} environments. \bRTVToks{myThoughts}% \begin{rtVW} @@ -53,11 +55,8 @@ \end{rtVW} \eRTVToks \begin{enumerate} - \item \useRanTok{1} - \item \useRanTok{2} - \item \useRanTok{3} + \displayListRandomly[\item]{myThoughts} \end{enumerate} - Use \verb!\useRTName! command when another list separates the current position from the list you want to use. Here we want to use the list named \texttt{myPals}, but since that definition, a new list named @@ -70,8 +69,27 @@ For mixing lists. it might be easier to use the optional parameter: {\useRanTok[myPals]{1}} and \useRanTok[myThoughts]{1} -The \verb!\rtTokByNum! can retrieve an item from the list, in its declared -order; eg, from the \texttt{myPals} list, the first and last are {\rtTokByNum[myPals]{1}} -and \rtTokByNum[myPals]{\nToksFor{myPals}}. +The \cs{rtTokByNum} can retrieve an item from the list in its declared order; +eg, from the \texttt{myPals} list, the first and last are +{\rtTokByNum[myPals]{1}} and \rtTokByNum[myPals]{\nToksFor{myPals}}. + +We demonstrate the command \cs{reorderRanToks} and the optional parameters of \cs{displayListRandomly}: +\begin{quote}\reorderRanToks{myPals}% +List of pals: \displayListRandomly[\ifnum\i=\last\space and \fi][\ifnum\i=\last.\else,\fi\space]{myPals} +\end{quote} +The reordering is global, so \displayListRandomly[\ifnum\i=\last\space and \fi][\ifnum\i=\last\else, \fi]{myPals} +are listed in the same order as above, and different from the original random order seen in the second paragraph +of this document. + +Without the Oxford comma: My pals are +\displayListRandomly[\ifnum\i=\last and \fi][\ifnum\i=\last.\else\ifnum\i=\lessone\relax\space\else, \fi\fi]{myPals} + +The following is the same logic but uses the syntax of the \textsf{ifthen} package: My pals are +\displayListRandomly[\ifthenelse{\i=\last}{and }{}][\ifthenelse{\i=\last}{.}{\ifthenelse{\i=\lessone}{\space}{, }}]{myPals} + +Test the \cs{copyRanToks} command: +\copyRanToks{myPals}{myPals1}\displayListRandomly[\ifthenelse{\i=\last}{and }{}][\ifthenelse{\i=\last}{.}{\ifthenelse{\i=\lessone}{\space}{, }}]{myPals1} +This does not change the order of the \texttt{myPals} list, which is still +\displayListRandomly[\ifnum\i=\last\space and \fi][\ifnum\i=\last.\else,\fi\space]{myPals} \end{document} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/ran_toks.doc.tlpobj new/tlpkg/tlpobj/ran_toks.doc.tlpobj --- old/tlpkg/tlpobj/ran_toks.doc.tlpobj 2016-04-14 19:44:38.000000000 +0200 +++ new/tlpkg/tlpobj/ran_toks.doc.tlpobj 2017-05-19 23:41:35.000000000 +0200 @@ -1,12 +1,17 @@ name ran_toks.doc category Package -revision 39684 +revision 44429 shortdesc doc files of ran_toks relocated 1 -docfiles size=30 +docfiles size=72 RELOC/doc/latex/ran_toks/README.md RELOC/doc/latex/ran_toks/doc/rantoks_man.pdf RELOC/doc/latex/ran_toks/doc/rantoks_man.tex + RELOC/doc/latex/ran_toks/examples/db1.tex + RELOC/doc/latex/ran_toks/examples/db2.tex + RELOC/doc/latex/ran_toks/examples/db3.tex + RELOC/doc/latex/ran_toks/examples/db4.tex + RELOC/doc/latex/ran_toks/examples/mc-db.tex RELOC/doc/latex/ran_toks/examples/mytext.verb RELOC/doc/latex/ran_toks/examples/ran_toks.tex RELOC/doc/latex/ran_toks/examples/random_tst.tex ++++++ ran_toks.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tex/latex/ran_toks/ran_toks.sty new/tex/latex/ran_toks/ran_toks.sty --- old/tex/latex/ran_toks/ran_toks.sty 2016-02-12 01:26:01.000000000 +0100 +++ new/tex/latex/ran_toks/ran_toks.sty 2017-05-19 23:06:02.000000000 +0200 @@ -7,8 +7,8 @@ %% ran_toks.dtx (with options: `copyright,package') %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% ran_toks.sty package, 2013/08/03 %% -%% Copyright (C) 2012 D. P. Story %% +%% Web package, %% +%% Copyright (C) 1999-2017 D. P. Story %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% @@ -17,9 +17,9 @@ %% macros/latex/base/lppl.txt; either version 1 of the %% %% License, or (at your option) any later version. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\NeedsTeXFormat{LaTeX2e} +\NeedsTeXFormat{LaTeX2e}[1997/12/01] \ProvidesPackage{ran_toks} - [2016/02/06 v1.0e Randomizing tokens] + [2017/05/04 v1.1 Randomizing tokens (dps)] \RequirePackage{verbatim} \@ifundefined{nextrandom}{\input{random.tex}}{} \def\nextrandom{\begingroup @@ -89,47 +89,38 @@ \def\endverbatimwrite{\@esphack} \def\rt@IWVO{\immediate\write\verbatim@out} \def\InitSeedValue{\the\randomi} -\def\rt@writeSeedData{% - \ifsaveseed - \@ifundefined{saveseedinfo}{\newwrite\saveseedinfo}{} - \immediate\openout \saveseedinfo \jobname_rt.sav - \let\verbatim@out\saveseedinfo - \def\rt@msgi{initializing seed value}% - \def\rt@msgii{last random number used}% - \uccode`c=`\%\uppercase{% - \rt@IWVO{\InitSeedValue\space c \rt@msgi}% - \rt@IWVO{\the\randomi\space c \rt@msgii}% - }\immediate\closeout\saveseedinfo - \fi -} +\def\rt@writeSeedData{\ifsaveseed + \@ifundefined{saveseedinfo}{\newwrite\saveseedinfo}{} + \immediate\openout \saveseedinfo \jobname_rt.sav + \let\verbatim@out\saveseedinfo + \def\rt@msgi{initializing seed value}% + \def\rt@msgii{last random number used}% + \uccode`c=`\%\uppercase{% + \rt@IWVO{\InitSeedValue\space c \rt@msgi}% + \rt@IWVO{\the\randomi\space c \rt@msgii}}\immediate + \closeout\saveseedinfo\fi} \AtEndDocument{\rt@writeSeedData}% -\def\rt@populateList#1{% - \rt@listIn={}% - \rt@nCnt=0 - \@whilenum\rt@nCnt<#1\do{% - \advance\rt@nCnt1 +\def\rt@populateList#1{\rt@listIn={}\rt@nCnt\z@ + \@whilenum\rt@nCnt<#1\do{\advance\rt@nCnt\@ne \edef\rt@listInHold{\the\rt@listIn\noexpand\\{\the\rt@nCnt}}% - \rt@listIn=\expandafter{\rt@listInHold}% - }% -} -\def\rt@RandomizeList#1{% - \global\rt@listIn={}\global\rt@newListIn={}\global\rt@listOut={}% + \rt@listIn=\expandafter{\rt@listInHold}}} +\def\rt@RandomizeList#1{\global + \rt@listIn={}\global\rt@newListIn={}\global\rt@listOut={}% \rt@nMax=#1\relax\rt@populateList{\the\rt@nMax}% \ifwerandomize \expandafter\rt@randomizeList\else \global\rt@listOut=\expandafter{\the\rt@listIn}\fi -} -\def\rt@randomizeList{% - \let\\=\rt@processi + \global\rt@nameedef{\rt@BaseName-List}{\the\rt@listOut}} +\def\rt@randomizeList{\let\\=\rt@processi \setrannum{\rt@getRanNum}{1}{\the\rt@nMax}% \ifrtdebug\typeout{\string\rt@getRanNum=\the\rt@getRanNum}\fi - \rt@nCnt=0\relax + \rt@nCnt\z@ \ifrtdebug\typeout{LISTING: \the\rt@listIn}\fi \the\rt@listIn \rt@loopTest } -\def\rt@loopTest{\advance\rt@nMax-1\relax - \ifnum\rt@nMax>0\relax +\def\rt@loopTest{\advance\rt@nMax\m@ne + \ifnum\rt@nMax>\z@ \def\rt@next{% \rt@listIn=\expandafter{\the\rt@newListIn}% \rt@newListIn={}\rt@randomizeList}% @@ -140,7 +131,7 @@ \fi \rt@next } -\def\rt@processi#1{\advance\rt@nCnt1 +\def\rt@processi#1{\advance\rt@nCnt\@ne \ifnum\rt@nCnt=\rt@getRanNum \edef\rt@listOutHold{\the\rt@listOut}% \global\rt@listOut=\expandafter{\rt@listOutHold\\{#1}}% @@ -152,28 +143,49 @@ \ifrtdebug\typeout{\string\rt@newListIn: \the\rt@newListIn}\fi \fi } +\def\rt@modarith#1#2{\count\z@=#1\relax\count\tw@=#1\relax + \advance\count\z@\m@ne\divide\count\z@ #2\relax + \multiply\count\z@ #2\relax + \advance\count\tw@-\count\z@ + \edef\rt@mod{\the\count\tw@}} +\def\rt@badIndex#1#2{\PackageWarningNoLine{ran_toks} + {The argument of \string\useRanTok{#1} on line + \the\inputlineno\space is\MessageBreak + greater than \string\nToksFor{#2} (\nToksFor{#2}), + instead will use\MessageBreak + \string\useRanTok{\rt@mod}, obtained from modular + arithmetic.\MessageBreak + You might want to fix this} +} +\def\rt@badTokName#1{% + \PackageWarningNoLine{ran_toks} + {The token list `#1' on line \the\inputlineno\space + is undefined,\MessageBreak + possibly simply mispelled; check spelling.\MessageBreak + If undefined, use \string\ranToks\space or \string\bRTVToks/% + \string\eRTVToks\space\MessageBreak + to define a list with the name `#1'}% +} +\def\rt@warnTokName#1{% + \PackageWarningNoLine{ran_toks} + {The token list `#1' on line \the\inputlineno\space + is already defined,\MessageBreak + will overwrite this list}% +} \def\ranToks#1{\begingroup \useRTName{#1}% \r@nToks } -\long\def\r@nToks#1{% - \rt@nMax=0 - \r@ndToks#1\rt@NIL -} +\long\def\r@nToks#1{\rt@nMax\z@\r@ndToks#1\rt@NIL} \def\rt@NIL{@nil} \newcommand{\useRTName}[1]{\gdef\rt@BaseName{#1}}% \let\rt@BaseName\@empty -\newcommand{\bRTVToks}[1]{% - \rt@nCnt=0 - \useRTName{#1}% -} -\newcommand{\eRTVToks}{% - \global\rt@nameedef{\rt@BaseName Cnt}{\the\rt@nCnt}% - \expandafter\r@nVToks\expandafter{\rt@BaseName}% -} +\newcommand{\bRTVToks}[1]{\rt@nCnt\z@\useRTName{#1}} +\newcommand{\eRTVToks}{\global + \rt@nameedef{\rt@BaseName Cnt}{\the\rt@nCnt}% + \expandafter\r@nVToks\expandafter{\rt@BaseName}} \def\reVerbEnd{\ifhmode\unskip\fi} -\newenvironment{rtVW}{% - \global\advance\rt@nCnt1 +\newenvironment{rtVW}{\global\advance\rt@nCnt\@ne \immediate\openout\rt@Verb@write \jobname_\rt@BaseName\the\rt@nCnt.cut \let\verbatim@out\rt@Verb@write @@ -187,45 +199,104 @@ \gdef\rt@BaseName{#1}% \expandafter\rt@nMax\@nameuse{#1Cnt}% \rt@listIn={}\rt@nCnt=0\relax\let\rt@listInHold\@empty - \@whilenum\rt@nCnt<\rt@nMax\do{% - \advance\rt@nCnt1 - \edef\rt@listInHold{% - \the\rt@listIn{\noexpand\rt@inputVerb{#1\the\rt@nCnt}}}% - \rt@listIn=\expandafter{\rt@listInHold}% - }% -\ifrtdebug\typeout{\string\r@nVToks: \the\rt@listIn}\fi - \expandafter\r@nToks\expandafter{\the\rt@listIn}% -} + \@whilenum\rt@nCnt<\rt@nMax\do{\advance\rt@nCnt\@ne + \edef\rt@listInHold{% + \the\rt@listIn{\noexpand\rt@inputVerb{#1\the\rt@nCnt}}}% + \rt@listIn=\expandafter{\rt@listInHold}}\ifrtdebug + \typeout{\string\r@nVToks: \the\rt@listIn}\fi + \expandafter\r@nToks\expandafter{\the\rt@listIn}} \def\rt@inputVerb#1{\input{\jobname_#1.cut}} \def\rt@PAR{\par} \long\def\r@ndToks#1{\def\rt@rgi{#1}% \ifx\rt@rgi\rt@PAR\def\rt@next{\r@ndToks}\else - \advance\rt@nMax1\relax + \advance\rt@nMax\@ne \global\@namedef{rtTok\the\rt@nMax\rt@BaseName}{#1}% \def\rt@next{\@ifnextchar\rt@NIL - {\rt@endToks\@gobble}{\r@ndToks}}% - \fi\rt@next -} -\def\rt@endToks{% - \global\rt@nameedef{nMax4\rt@BaseName}{\the\rt@nMax}% - \rt@RandomizeList{\the\rt@nMax}% - \rt@nCnt=0 - \let\\\assignRanToks - \the\rt@listOut - \endgroup -} -\def\assignRanToks#1{\advance\rt@nCnt1 - \global\rt@nameedef{rtRanTok\the\rt@nCnt\rt@BaseName}% - {\noexpand\@nameuse{rtTok#1\rt@BaseName}}% -} -\newcommand{\nToksFor}[1]{\@nameuse{nMax4#1}} -\newcommand{\rtTokByNum}[2][\rt@BaseName]{\@nameuse{rtTok#2#1}% - \ignorespaces} -\newcommand{\useRanTok}[2][\rt@BaseName]{\@nameuse{rtRanTok#2#1}} -\newcommand{\displayListRandomly}[2][]{\rt@nCnt=0\relax - \@whilenum\rt@nCnt<\nToksFor{#2}\advance\rt@nCnt1\relax - \do{#1\useRanTok{\the\rt@nCnt}}% -} + {\rt@endToks\@gobble}{\r@ndToks}}\fi\rt@next} +\def\rt@performRanDefns#1{% + \rt@RandomizeList{#1}\rt@nCnt\z@ + \let\\\rt@ssign\the\rt@listOut} +\def\rt@endToks{\global + \rt@nameedef{nMax4\rt@BaseName}{\the\rt@nMax}% + \rt@performRanDefns{\the\rt@nMax}\endgroup} +\def\reorderRanToks#1{\begingroup\useRTName{#1}\expandafter + \ifx\csname nMax4#1\endcsname\relax + \rt@badTokName{#1}\else + \rt@performRanDefns{\@nameuse{nMax4#1}}\fi +\endgroup} +\newcommand\copyRanToks[2]{\begingroup\expandafter + \ifx\csname nMax4#1\endcsname\relax + \rt@badTokName{#1}% + \else\expandafter + \ifx\csname nMax4#2\endcsname\relax + \useRTName{#2}\global + \rt@nameedef{nMax4#2}{\@nameuse{nMax4#1}}% + \rt@nCnt=\csname nMax4#2\endcsname\relax + \@whilenum\rt@nCnt>\z@\do{\global + \rt@nameedef{rtTok\the\rt@nCnt#2}% + {\noexpand\@nameuse{rtTok\the\rt@nCnt#1}}% + \advance\rt@nCnt\m@ne}% + \rt@performRanDefns{\@nameuse{nMax4#2}}\else + \rt@warnTokName{#2}\fi + \fi +\endgroup} +\def\rt@ssign#1{\advance\rt@nCnt\@ne\global + \rt@nameedef{rtRanTok\the\rt@nCnt\rt@BaseName}{\noexpand + \@nameuse{rtTok#1\rt@BaseName}}} +\newcommand{\nToksFor}[1]{\expandafter + \ifx\csname nMax4#1\endcsname\relax + \textbf{??}\rt@badTokName{#1}\else + \@nameuse{nMax4#1}\fi} +\newcommand{\rtTokByNum}[2][\rt@BaseName]{\expandafter + \ifx\csname nMax4#1\endcsname\relax + \textbf{??}\rt@badTokName{#1}\else + \@nameuse{rtTok#2#1}\expandafter\ignorespaces\fi} +\newcommand{\useRanTok}[2][\rt@BaseName]{\bgroup + \expandafter\ifx\csname nMax4#1\endcsname\relax + \rt@badTokName{#1}\else + \ifnum#2>\nToksFor{#1}\rt@modarith{#2}{\nToksFor{#1}}% + \rt@badIndex{#2}{#1}\@nameuse{rtRanTok\rt@mod#1}\else + \@nameuse{rtRanTok#2#1}\fi\fi\egroup} +\newcommand{\displayListRandomly}[1][]{\bgroup\def\rt@prior{#1}% + \displ@yListRandomly} +\newcommand{\displ@yListRandomly}[2][]{\rt@nCnt\z@ + \expandafter\ifx\csname nMax4#2\endcsname\relax + \rt@rgi\space\textbf{??}\rt@badTokName{#2}#1% + \else + \def\rt@post{#1}\useRTName{#2}\let\i\rt@nCnt + \def\first{1}\edef\last{\@nameuse{nMax4#2}}% + \@tempcnta\last \advance\@tempcnta\m@ne + \edef\lessone{\the\@tempcnta}% + \@whilenum\rt@nCnt<\last\advance\rt@nCnt\@ne + \do{\rt@prior\useRanTok{\the\rt@nCnt}\rt@post}% + \fi\egroup +} +\def\rt@gettonil#1\@nil{\def\to@nilarg{#1}} +\def\rt@ifspc{\ifx\@let@token\@sptoken + \let\rt@next\rt@xifspc\else + \let\rt@next\rt@gettonil\fi\rt@next} +\begingroup +\def\:{\rt@xifspc} +\expandafter\gdef\: {\futurelet\@let@token\rt@ifspc} +\endgroup +\def\rt@strpspcs{\futurelet\@let@token\rt@ifspc} +\def\ProbDBWarningMsg#1{\filename@parse{#1} + \PackageWarning{ran_toks} + {The file \filename@area\filename@base.\ifx\filename@ext\relax + tex\else\filename@ext\fi\space cannot be found}} +\def\useTheseDBs#1{\def\rt@dblist{#1}\ifx\rt@dblist\@empty\else + \let\rt@DB@List\@empty + \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\rt@dblist}% + \temp@expand\do{\ifx\@@tmp\@empty\else + \expandafter\rt@strpspcs\@@tmp\@nil\edef\@@tmp{\to@nilarg}% + \edef\rt@nextDB{\noexpand + \InputIfFileExists{\@@tmp}{}{\noexpand + \ProbDBWarningMsg{\@@tmp}}}% + \toks\tw@=\expandafter{\rt@DB@List}% + \toks@=\expandafter{\rt@nextDB}% + \edef\rt@DB@List{\the\toks\tw@\space\the\toks@}\fi + }\expandafter\rt@DB@List\fi} +\let\useProbDBs\useTheseDBs \endinput %% %% End of file `ran_toks.sty'. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/ran_toks.tlpobj new/tlpkg/tlpobj/ran_toks.tlpobj --- old/tlpkg/tlpobj/ran_toks.tlpobj 2016-04-14 19:44:38.000000000 +0200 +++ new/tlpkg/tlpobj/ran_toks.tlpobj 2017-05-19 23:41:35.000000000 +0200 @@ -1,6 +1,6 @@ name ran_toks category Package -revision 39684 +revision 44429 shortdesc Randomise token strings relocated 1 longdesc The package provides means of randomising lists of tokens, or @@ -10,10 +10,10 @@ longdesc commands delimit a collection of tokens for randomising; each longdesc group inside a rtVw constitutes one of these (typically larger) longdesc token sets. -runfiles size=2 +runfiles size=3 RELOC/tex/latex/ran_toks/ran_toks.sty catalogue-ctan /macros/latex/contrib/ran_toks -catalogue-date 2016-02-10 16:03:10 +0100 +catalogue-date 2017-05-18 22:38:32 +0200 catalogue-license lppl1 catalogue-topics macro-supp -catalogue-version 1.0e +catalogue-version 1.1 ++++++ randbild.doc.tar.xz ++++++ ++++++ randbild.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/randbild.tlpobj new/tlpkg/tlpobj/randbild.tlpobj --- old/tlpkg/tlpobj/randbild.tlpobj 2016-04-14 19:44:39.000000000 +0200 +++ new/tlpkg/tlpobj/randbild.tlpobj 2017-04-14 17:59:42.000000000 +0200 @@ -10,7 +10,7 @@ runfiles size=1 RELOC/tex/latex/randbild/randbild.sty catalogue-ctan /macros/latex/contrib/randbild -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics graphics-use catalogue-version 0.2 ++++++ randomwalk.doc.tar.xz ++++++ ++++++ randomwalk.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/randomwalk.tlpobj new/tlpkg/tlpobj/randomwalk.tlpobj --- old/tlpkg/tlpobj/randomwalk.tlpobj 2016-04-14 19:44:39.000000000 +0200 +++ new/tlpkg/tlpobj/randomwalk.tlpobj 2017-04-14 17:59:42.000000000 +0200 @@ -11,7 +11,7 @@ runfiles size=2 RELOC/tex/latex/randomwalk/randomwalk.sty catalogue-ctan /macros/latex/contrib/randomwalk -catalogue-date 2015-09-20 05:44:37 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics graphics-in-tex calculation random expl3 catalogue-version 0.4 ++++++ randtext.doc.tar.xz ++++++ ++++++ randtext.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/randtext.tlpobj new/tlpkg/tlpobj/randtext.tlpobj --- old/tlpkg/tlpobj/randtext.tlpobj 2016-04-14 19:44:39.000000000 +0200 +++ new/tlpkg/tlpobj/randtext.tlpobj 2017-04-14 17:59:42.000000000 +0200 @@ -13,6 +13,6 @@ runfiles size=2 RELOC/tex/latex/randtext/randtext.sty catalogue-ctan /macros/latex/contrib/randtext -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics security ++++++ rccol.doc.tar.xz ++++++ ++++++ rccol.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rccol.tlpobj new/tlpkg/tlpobj/rccol.tlpobj --- old/tlpkg/tlpobj/rccol.tlpobj 2016-04-14 19:44:39.000000000 +0200 +++ new/tlpkg/tlpobj/rccol.tlpobj 2017-04-14 17:59:42.000000000 +0200 @@ -11,7 +11,7 @@ runfiles size=2 RELOC/tex/latex/rccol/rccol.sty catalogue-ctan /macros/latex/contrib/rccol -catalogue-date 2016-01-22 18:25:34 +0100 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.2 catalogue-topics table maths catalogue-version 1.2c ++++++ rcs-multi.doc.tar.xz ++++++ ++++++ rcs-multi.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rcs-multi.tlpobj new/tlpkg/tlpobj/rcs-multi.tlpobj --- old/tlpkg/tlpobj/rcs-multi.tlpobj 2016-04-14 19:44:40.000000000 +0200 +++ new/tlpkg/tlpobj/rcs-multi.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -11,7 +11,7 @@ RELOC/tex/latex/rcs-multi/rcs-multi.sty catalogue-also rcs rcsinfo catalogue-ctan /macros/latex/contrib/rcs-multi -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics version-control doc-mgmt catalogue-version 0.1a ++++++ rcs.doc.tar.xz ++++++ ++++++ rcs.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rcs.tlpobj new/tlpkg/tlpobj/rcs.tlpobj --- old/tlpkg/tlpobj/rcs.tlpobj 2016-04-14 19:44:40.000000000 +0200 +++ new/tlpkg/tlpobj/rcs.tlpobj 2017-04-14 17:59:42.000000000 +0200 @@ -19,6 +19,6 @@ RELOC/tex/latex/rcs/rcs.sty catalogue-also rcsinfo catalogue-ctan /macros/latex/contrib/rcs -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license gpl catalogue-topics version-control doc-mgmt ++++++ rcsinfo.doc.tar.xz ++++++ ++++++ rcsinfo.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rcsinfo.tlpobj new/tlpkg/tlpobj/rcsinfo.tlpobj --- old/tlpkg/tlpobj/rcsinfo.tlpobj 2016-04-14 19:44:41.000000000 +0200 +++ new/tlpkg/tlpobj/rcsinfo.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -11,7 +11,7 @@ RELOC/tex/latex/rcsinfo/rcsinfo.sty catalogue-also rcs catalogue-ctan /macros/latex/contrib/rcsinfo -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics version-control doc-mgmt catalogue-version 1.11 ++++++ readarray.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/readarray/README new/doc/latex/readarray/README --- old/doc/latex/readarray/README 2013-04-20 01:41:18.000000000 +0200 +++ new/doc/latex/readarray/README 2016-11-25 19:29:56.000000000 +0100 @@ -1,12 +1,28 @@ The readarray package allows one to input formatted data into elements -of a 2-D or 3-D array and to recall that data at will by individual cell -number. The data can be but need not be numerical in nature. It can -be, for example, formatted text. +of a 2-D or 3-D array (or a 1-D file-record array). Subsequently, that +data may be recalled at will using an array-cell indexing nomenclature. +The data can be but need not be numerical in nature. It can be, for +example, formatted text. In this regard, the array stores the +unexpanded data from the file, if macros are present in the data. + +As of V2.0, the separator by which data is parsed may be customized by +the user. A totally new package syntax has also been introduced (the +prior syntax is retained as deprecated macros). Various levels of bound +checking are now available to the user. While the package can be used for any application where indexed data is called for, the package proves particularly useful when elements of multiple arrays must be recallable and dynamically combined at time of compilation, rather than in advance. -When data is read from an input file, it may also be accessed by file -record (1-D access), in addition to 2-D or 3-D array-cell access. +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is in + + http://www.latex-project.org/lppl.txt + +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +The Current Maintainer of this work is Steven B. Segletes. Binary files old/doc/latex/readarray/readarray.pdf and new/doc/latex/readarray/readarray.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/readarray/readarray.tex new/doc/latex/readarray/readarray.tex --- old/doc/latex/readarray/readarray.tex 2013-05-15 23:52:42.000000000 +0200 +++ new/doc/latex/readarray/readarray.tex 2016-11-25 19:29:56.000000000 +0100 @@ -1,5 +1,4 @@ \documentclass{article} -\def\version{1.2} %% Copyright 2013 Steven B. Segletes % % This work may be distributed and/or modified under the @@ -20,13 +19,55 @@ % -Added \arrayij and \arrayijk, which can be put into \edef % -Used \romannumeral in preference to \roman{}, when possible, % to avoid unnecessary use of counters. - +% v1.3 -Moved \newread outside of \readdef, so as not to exhaust the +% 16 allotted file streams (Thanks to Ken Kubota for the tip). +\usepackage{tabstackengine}[2016-10-04] +\usepackage{lmodern} +\usepackage[T1]{fontenc} \parskip 1em \parindent 0em \newcommand\rl{\rule{1em}{0in}} \def\rdar{\textsf{readarray}} +\def\loi{\textsf{listofitems}} +\def\cmd#1{\texttt{\string\ \unskip#1}} \usepackage{readarray} \usepackage{verbatimbox} +\usepackage{filecontents} +\begin{filecontents*}{file1data.txt} +A111 A112 A113 A114 +A121 A122 A123 A124 +A131 A132 A133 A134 + +A211 A212 A213 A214 +A221 A222 A223 A224 +A231 A232 A233 A234 +\end{filecontents*} +\begin{filecontents*}{file2data.txt} +\def{\dataA}{% +A111 A112 A113 A114 +A121 A122 A123 A124 +A131 A132 A133 A134 +% +A211 A212 A213 A214 +A221 A222 A223 A224 +A231 A232 A233 A234 +} +\end{filecontents*} +\begin{filecontents*}{file3data.txt} +\textit{am} , \textit{are}, have \textit{been}, have \textit{been} +\textit{are}, \textit{are} , have \textit{been}, have \textit{been} +\textit{is} , \textit{are} , has \textit{been} , have \textit{been} + +\textit{was} , \textit{were}, had \textit{been}, had \textit{been} +\textit{were}, \textit{were}, had \textit{been}, had \textit{been} +\textit{was} , \textit{were}, had \textit{been}, had \textit{been} + +will \textit{be}, will \textit{be}, will have \textit{been}, will have \textit{been} +will \textit{be}, will \textit{be}, will have \textit{been}, will have \textit{been} +will \textit{be}, will \textit{be}, will have \textit{been}, will have \textit{been} +\end{filecontents*} + + \let\vb\verb \def\bs{{\ttfamily\char'134}} \reversemarginpar @@ -37,112 +78,211 @@ \begin{center} \LARGE The {\rdar} Package\\ \rule{0em}{.7em}\small Routines for inputting formatted array data and -recalling it on an element-by-element basis.\\Currently supports 2-D -and 3-D array structures\\ +recalling it on an element-by-element basis.\\ \rule{0em}{2.7em}\large Steven B. Segletes\\ steven.b.segletes.civ@mail.mil\\ -\rule{0em}{1.7em}\today\\ -v\version +\rule{0em}{1.7em}\readarrayPackageDate\\ +V\readarrayPackageVersion \end{center} +\section*{Comments About Version 2.0} + +Version 2.0 of the \rdar{} package has brought major changes, + including a \textit{new and improved} syntax. +Functionally, the data-reading/parsing code of the package + has been revised to use the powerful \loi{} package. +This has two primary advantages: 1) the data that is read is no + longer expanded prior to the read, so that macros can be read + and stored in the data arrays using their unexpanded tokens; and 2) + list separators other than a space may now be employed + to parse the data into array cells. + +While a newer preferred syntax has been introduced for reading and + recalling arrays, the deprecated syntax is still supported. +The user will also note other small changes, such as the fact that errors + arising from array-boundary violations now appear in the log file + rather than the document itself. + \section{Description and Commands} -The {\rdar} package allows for the inputting of data arrays (numeric, -string, or even formatted) in either file form or \vb|\def| form, such -that the elements of multiple arrays can be specified and later recalled -in an orderly fashion, on a cell-by-cell basis. Routines have been -developed to support the storage and recall of both 2-D and 3-D arrays. - -The commands included in this package help the user input data, define -it in terms of array elements and recall those elements at will. Those -commands are:\\\itshape -\rl\vb|\readdef{|filename\vb|}{|token\vb|}|\\ -\rl\vb|\showrecord[|error\vb|]{|record number\vb|}|\\ -\rl\vb|\copyrecords{|identifier\vb|}|\\ -\rl\vb|\readArrayij{|token\vb|}{|identifier\vb|}{|columns\vb|}|\\ -\rl\vb|\readArrayijk{|token\vb|}{|identifier\vb|}{|rows\vb|}{|columns\vb|}|\\ -\rl\vb|\Arrayij[|error\vb|]{|identifier\vb|}{|row\vb|}{|column\vb|}|\\ -\rl\vb|\Arrayijk[|error\vb|]{|identifier\vb|}{|plane\vb|}{|row\vb|}{|% - column\vb|}|\\ -\rl\vb|\arrayij{|identifier\vb|}{|row\vb|}{|column\vb|}|\\ -\rl\vb|\arrayijk{|identifier\vb|}{|plane\vb|}{|row\vb|}{|% - column\vb|}|\upshape +The {\rdar} package allows for the creation of data arrays (numeric, + string, or even formatted) using either file contents or \vb|\def| + format for input, such that the elements of multiple arrays can be + set and later recalled in an orderly fashion, on a cell-by-cell basis. +Routines have been developed to support the storage and recall of both + 2-D and 3-D arrays, as well as 1-D file-record arrays.% +\footnote{ +Note: for 1-D arrays that are to be simply parsed on the basis of a + specified separator, the \loi{} package is already prepared + to do this, without the help of this package. +} + +\clearpage +The commands included in this package help the user to input data, define +it in terms of array elements, and recall those elements at will. Those +commands are: + + +\itshape +\textup{To place file data into a data macro:}\\ +\rl\vb|\readdef{|filename\vb|}\|data-macro\\ +\textup{To place file data into a 1-D file-record array:}\\ +\rl\vb|\readrecordarray{|filename\vb|}\|array-identifier\\ +\textup{To parse a data macro and place the results into a 2-D or 3-D array:}\\ +\rl\vb|\readarray\|data-macro\vb|\|array-identifier\vb|[-,|columns\vb|]|% + \hfill\textup{(2-D)}\\ +\rl\vb|\readarray\|data-macro\vb|\|array-identifier\vb|[-,|rows\vb|,|columns\vb|]|% + \hfill\textup{(3-D)}\\ +\textup{Same as above, with leading/trailing spaces removed from array cells:}\\ +\rl\vb|\readarray*\|data-macro\vb|\|array-identifier\vb|[-,|columns\vb|]|% + \hfill\textup{(2-D)}\\ +\rl\vb|\readarray*\|data-macro\vb|\|array-identifier\vb|[-,|rows\vb|,|columns\vb|]|% + \hfill\textup{(3-D)}\\ +\textup{Recall data from indexed array cell:}\\ +\rl\vb|\|array-identifier\vb|[|row\vb|,|column\vb|]|% + \hfill\textup{(2-D)}\\ +\rl\vb|\|array-identifier\vb|[|plane\vb|,|row\vb|,|column\vb|]|% + \hfill\textup{(3-D)}\\ +\textup{To place the actual tokens of an array cell into a macro:}\\ +\rl\vb|\arraytomacro\|array-identifier\vb|[-,|columns\vb|]\|macro% + \hfill\textup{(2-D)}\\ +\rl\vb|\arraytomacro\|array-identifier\vb|[-,|rows\vb|,|columns\vb|]\|macro% + \hfill\textup{(3-D)}\\ +\textup{To change the array-parsing separator character:}\\ +\rl\vb|\readarraysepchar{|parsing-separator-char\vb|}|\\ +\textup{To select the level of bounds checking on array cell recall:}\\ +\rl\vb|\nocheckbounds|\hfill OR\hfill% +\vb|\checkbounds|\hfill OR\hfill% +\vb|\hypercheckbounds| +\upshape + +In these commands, \cmd{}\textit{data-macro} is a command sequence into + which the contents of \texttt{filename} are set into a \cmd{def}. +The \textit{array-identifier} is a sequence of + (catcode 11) letters that identify the array. +The starred version of the commands are used if, during the array + creation, it is desired to automatically excise the array data of + leading and trailing spaces. + +Unlike earlier versions of this package, where error messages were + output into the typeset document, error messages are now + set in the log file. +The level of error messaging is defined by the level of bounds checking, + with \cmd{hypercheckbounds} providing the + most intense level of error checking. +When a bounds-checking error is found in an array invocation, in addition + to the error message in the log file, a ``?'' is typeset in the document, + unless bound checking is disabled with \cmd{nocheckbounds}. + + +Several strings of fixed name are defined through the use the +\cmd{readdef} command, which are accessible to the user: -Several strings of fixed name are defined through the use of this -package which are accessible to the user:\\ +\itshape \rl\vb|\nrows|\\ \rl\vb|\ncols|\\ \rl\vb|\nrecords|\\ -\rl\vb|\record|\textit{index} +\rl\vb|\ArrayRecord[|record\vb|]|% + \hfill\textup{(to retrieve record from most recent \cmd{readdef})}\upshape -In addition to the strings of fixed name, there are various strings -created whose name is a function of the user-specified data, such -as\\\itshape -\rl\vb|\|identifier\vb|CELLS|\\ -\rl\vb|\|identifier\vb|PLANES|\\ -\rl\vb|\|identifier\vb|ROWS|\\ -\rl\vb|\|identifier\vb|COLS|\\\upshape -where \textit{identifier} is the alphabetic-character string by which -you have designated a particular array. They will be discussed in -relation to the commands that create these strings. +The macros \cmd{nrows} and \cmd{ncols}, which were gleaned from the file + structure, may be used in the subsequent \cmd{readarray} + invocation to specify the array dimensions. +Alternately, those values may be manually overridden by specifying + the desired values in the \cmd{readarray} invocation. +Individual records of the original file, from the most recent + \cmd{readdef}, may be recalled with the + \cmd{ArrayRecord} macro. + +In addition to the strings of fixed name created during the + \cmd{readdef}, there are various strings created during + the \cmd{readarray} whose name is a function of the + \textit{array-identifier}, such as + +\itshape +\rl\vb|\|array-identifier\vb|CELLS|\\ +\rl\vb|\|array-identifier\vb|PLANES|\\ +\rl\vb|\|array-identifier\vb|ROWS|\\ +\rl\vb|\|array-identifier\vb|COLS|\upshape + +where \textit{array-identifier} is the alphabetic-character string by which +you have designated a particular array. +Their meaning will be discussed later in this document. Support routines which are generally not required directly by the user for the specification and recall of data arrays, but which are -useful to this package and in a variety of other circumstances include -the following:\\\itshape -\rl\vb|\getargsC{|token {\upshape or} string\vb|}|\\ -\rl\vb|\arg|index\\ -\rl\vb|\narg|\\ -\rl\vb|\showargs[|number\vb|]|\\\upshape -\rl\vb|\def\converttilde{|T or F\vb|}|\upshape +useful for debugging include +the following: + +\itshape + +\rl\vb|\arraydump\|array-identifier\\% +\rl\vb|\scalardump\|array-identifier% +\upshape + +These macros print out the complete array, in either a structured or + unstructured form, respectively. -\begin{center} -\vfill -[\textsc{This Space Intentionally Left Blank}] -\vfill -\end{center} -\clearpage \section{Data Structure} The first requirement is to lay out a format for the data interface to -this package. The {\rdar} package is set up to digest space-separated data. -The format for the data organization is as follows, for 2-D arrays: - -\( -\begin{array}{lllll} -A_{11} &A_{12} &A_{13} & \ldots & A_{1\mathrm{(columns)}} \\ -A_{21} &A_{22} & \ldots && \\ + this package. +The {\rdar} package is set up to digest data separated by a user-defined + separator character. +The default separator is a space character but, as of V2.0, the separator + may be specified by way of \vb|\readarraysepchar{|\textit{separator}\vb|}|. +The format for the data organization to be digested is as follows, + for 2-D arrays: + +\TABstackTextstyle{\tiny} +\setstackgap{L}{3pt} +\newcommand\SEP{\,\langle\smash{\raisebox{1pt}{\tabbedCenterstack{s\\e\\p}}}\rangle\,} +\renewcommand\arraystretch{1.1} +{\arraycolsep=3pt\relax\small\( +\begin{array}{lll@{\hspace{2pt}}ll} +A_{11}\SEP &A_{12}\SEP &A_{13}\SEP & \ldots & A_{1\mathrm{(columns)}} \\ +A_{21}\SEP &A_{22}\SEP & \ldots && \\ \vdots&&&&\\ -A_{\mathrm{(rows)}1} &A_{\mathrm{(rows)}2} &A_{\mathrm{(rows)}3} & +A_{\mathrm{(rows)}1}\SEP &A_{\mathrm{(rows)}2}\SEP &A_{\mathrm{(rows)}3}\SEP & \ldots & A_{\mathrm{(rows)}\mathrm{(columns)}} \\ \end{array} -\) +\)} -and for 3-D arrays: +For 3-D arrays, the following structure is employed: -\( -\begin{array}{lllll} -A_{111} &A_{112} &A_{113} & \ldots & A_{11\mathrm{(columns)}} \\ -A_{121} &A_{122} & \ldots && \\ +{\arraycolsep=3pt\relax\small\( +\begin{array}{lll@{\hspace{2pt}}ll} +A_{111}\SEP &A_{112}\SEP &A_{113}\SEP & \ldots & A_{11\mathrm{(columns)}} \\ +A_{121}\SEP &A_{122}\SEP & \ldots && \\ \vdots&&&&\\ -A_{1\mathrm{(rows)}1} &A_{1\mathrm{(rows)}2} &A_{1\mathrm{(rows)}3} & +A_{1\mathrm{(rows)}1}\SEP &A_{1\mathrm{(rows)}2}\SEP &A_{1\mathrm{(rows)}3}\SEP & \ldots & A_{1\mathrm{(rows)}\mathrm{(columns)}} \\ -&&&&\\ -A_{211} &A_{212} &A_{213} & \ldots & A_{21\mathrm{(columns)}} \\ -A_{221} &A_{222} & \ldots && \\ +\rlap{\scriptsize$<$blank line$>$}&&&&\\ +A_{211}\SEP &A_{212}\SEP &A_{213} & \ldots & A_{21\mathrm{(columns)}} \\ +A_{221}\SEP &A_{222}\SEP & \ldots && \\ \vdots&&&&\\ -A_{2\mathrm{(rows)}1} &A_{2\mathrm{(rows)}2} &A_{2\mathrm{(rows)}3} & +A_{2\mathrm{(rows)}1}\SEP &A_{2\mathrm{(rows)}2}\SEP &A_{2\mathrm{(rows)}3}\SEP & \ldots & A_{2\mathrm{(rows)}\mathrm{(columns)}} \\ &&&&\\ \vdots&&&&\\ &&&&\\ -A_{\mathrm{(planes)}11} &A_{\mathrm{(planes)}12} &A_{\mathrm{(planes)}13} & \ldots & A_{\mathrm{(planes)}1\mathrm{(columns)}} \\ -A_{\mathrm{(planes)}21} &A_{\mathrm{(planes)}22} & \ldots && \\ +A_{\mathrm{(planes)}11}\SEP &A_{\mathrm{(planes)}12}\SEP &A_{\mathrm{(planes)}13}\SEP & \ldots & A_{\mathrm{(planes)}1\mathrm{(columns)}} \\ +A_{\mathrm{(planes)}21}\SEP &A_{\mathrm{(planes)}22}\SEP & \ldots && \\ \vdots&&&&\\ -A_{\mathrm{(planes)}\mathrm{(rows)}1} &A_{\mathrm{(planes)}\mathrm{(rows)}2} &A_{\mathrm{(planes)}\mathrm{(rows)}3} & +A_{\mathrm{(planes)}\mathrm{(rows)}1}\SEP &A_{\mathrm{(planes)}\mathrm{(rows)}2}\SEP &A_{\mathrm{(planes)}\mathrm{(rows)}3}\SEP & \ldots & A_{\mathrm{(planes)}\mathrm{(rows)}\mathrm{(columns)}} \\ \end{array} -\) +\)} + + +Here,\,$\SEP${}\,is the data separator that is used to parse the input. +Terms like $A_{\mathrm{(plane)}\mathrm{(row)}\mathrm{(column)}}$ refers + to the \LaTeX{}-formatted data to be associated with the particlar plane, + row, and column of data. +Note, that for 3-D arrays, a blank line can be used to signify to the + parsing algorithm the size of a data plane (alternately, the number of + rows per data plane can be explicitly provided to the \cmd{readarray} + command). \section{Getting Data into Array Structures\label{s:ex}} @@ -151,41 +291,56 @@ \vb|\def|. If one chooses the external file approach, the command \vb|\readdef|\margcmd{readdef} is the command which can achieve this result. The command takes two arguments. The first is the file in -which the data is stored, while the second is the token into which the -data will be placed, for example +which the data is stored, while the second is the data macro into which the +file's data will be placed, for example -\rl\vb|\readdef{data.txt}{\dataA}| +\rl\vb|\readdef{data.txt}{\dataA}|\readdef{file1data.txt}{\dataA} In this case, the contents of the file \vb|data.txt| will be placed -into the token \vb|\dataA|. At this point, the data is still not -digested into a data ``array,'' but merely stuffed into a \vb|\def| (a -\vb|\protected@edef| actually). Thus, there is no -\textit{requirement} that carriage returns be part of the input file -after each row of data, nor that blank lines exist between planes of -data (if the data is 3-D). \textit{However}, there is a reason to do so, -nonetheless. In particular, for datafiles that are organized in the + into the data macro \vb|\dataA|. +Two alterations to the format occur during this conversion from file + to \cmd{def}: 1) blank lines in the file are ignored; and + 2) a data separator replaces the end-of-line. +At this point, the data is still not digested into a 2-D or 3-D data + ``array.'' +However, two things have been accomplished: 1) the file contents are \cmd{def}'ed + into the data macro \cmd{dataA}; and 2) they are also placed into a 1-D + file record array, \cmd{ArrayRecord}. + +There is no +\textit{requirement} that the input file be organized with structured rows + of data corresponding to individual file records, nor that blank + lines exist between planes of data (if the data is 3-D). +\textit{However}, there is a reason to do so, nonetheless. +In particular, for datafiles that are organized in the preferred fashion, for example: -\begin{verbbox} -A111 A112 A113 A114 -A121 A122 A123 A124 -A131 A132 A133 A134 +\verbfilebox{file1data.txt} +\rl\theverbbox -A211 A212 A213 A214 -A221 A222 A223 A224 -A231 A232 A233 A234 -\end{verbbox} -\tabcolsep 1em\begin{tabular}{l} -\theverbbox -\end{tabular} - -a \vb|\readdef| will cause the following strings to be set: -\vb|\ncols|\margcmd{ncols} and \vb|\nrows|\margcmd{nrows}, in this -case to values of \vb|4| and \vb|3|, respectively. Such data could -prove useful if the array size is not known in advance. -When \verb|\readdef| is invoked, a string -\verb|\nrecords|\margcmd{nrecords} will also be set to the number of -file records processed by the \vb|\readdef| command. +a \vb|\readdef| attempts to estimate the number columns, and + rows-per-plane of the dataset by analyzing the data structure. +These estimates are given by + \vb|\ncols|\margcmd{ncols} and \vb|\nrows|\margcmd{nrows}, in this + case to values of \texttt{\ncols} and \texttt{\nrows}, respectively. +Such data could prove useful if the array size is not known in advance. +When \verb|\readdef| is invoked, a string + \verb|\nrecords|\margcmd{nrecords} will also be set to the number of + file records processed by the \vb|\readdef| command, in this case, + to \texttt{\nrecords}. +Finally, the 1-D file-record array, \cmd{ArrayRecord}\margcmd{ArrayRecord}, + is created to allow access to the most recently read file records. +For example, \vb|\ArrayRecord[3]| produces: ``\ArrayRecord[3]''. +Note, however, that the array, \cmd{ArrayRecord}, will be overwritten on + the subsequent invocation of \cmd{readdef}. + +Because \cmd{ArrayRecord} is only a 1-D file-record array, the + \textit{actual} array metrics, given by \cmd{ArrayRecordCOLS}, + \cmd{ArrayRecordROWS}, \cmd{ArrayRecordPLANES}, and + \cmd{ArrayRecordCELLS} are + \ArrayRecordCOLS, \ArrayRecordROWS, \ArrayRecordPLANES, and + \ArrayRecordCELLS, respectively, which do not align with the + estimations provided by \cmd{ncols} and \cmd{nrows}. In lieu of \verb|\readdef|, a generally less preferred, but viable way to make the data available is to cut and paste into a \vb|\def|. @@ -195,303 +350,450 @@ \verb|\def| example at the top of the following page. Note that the \vb|%| is also required at the end of the line containing \vb|\def|, in order to guarantee that, in this case, \vb|A111| is the first element of -data (and not a linebreak). However, unlike \vb|\readdef|, this -definition will set the values of neither \vb|\ncols| nor \vb|\nrows|. +data (and not a space separator). However, unlike \vb|\readdef|, this +definition will neither set the value of \vb|\ncols| nor \vb|\nrows|. -\begin{verbbox}[] -\def{\dataA}{% -A111 A112 A113 A114 -A121 A122 A123 A124 -A131 A132 A133 A134 -% -A211 A212 A213 A214 -A221 A222 A223 A224 -A231 A232 A233 A234 -} +\verbfilebox{file2data.txt} +\rl\theverbbox + +Once the data to be placed into an array is available in a macro, + by way of either + \vb|\readdef| or \vb|\def|, the command to digest the data into an + array is \vb|\readarray| for the case of 2-D or 3-D data. +For 1-D file-record arrays, in contrast, the \cmd{readrecordarray} + command is used to go directly from a file into the 1-D array, + bypassing the intermediate step of a data macro. + +\subsection{1-D File-Record Arrays} + +If the desire is merely to parse a string of data based on a common + data separator, such as a comma or any other character, there is + no need to use the \rdar{} package. +The \loi{} package, which is employed by \rdar, already has those provisions + and should be used directly.% +\begin{verbbox}[\footnotesize] +\setsepchar{ } +\readlist\oneDlist{\dataA} +\oneDlistlen{} list items, 12th item is ``\oneDlist[12]''. \end{verbbox} -\begin{tabular}{l} -\theverbbox -\end{tabular} - -Once the data to be placed into an array is available by way of either -\vb|\readdef| or \vb|\def|, the command to digest the data into an array -is either \vb|\readArrayij| (or \verb|\copyrecords|), in the case of 2-D -data, or \vb|\readArrayijk|, for 3-D data. - -\subsection{Creating 2-D Arrays} - -In the case of \vb|\readArrayij|\margcmd{readArrayij}, the command -takes three arguments. The first is the token into which the data had -previously been stuffed. The second is an alphabetic-string identifier -for the array, which can be one or more characters in length. Finally, -the last argument is the number of columns in the array. If the data -had been read by way of \vb|\readdef|, the string \vb|\ncols| -may be used to signify this value. - -\subsection{Creating Pseudo-1-D Arrays} - -While the {\rdar} package has no explicit provisions for 1-D arrays, one -could use the 2-D \verb|\readArrayij| command, with the third argument set -to a value of unity \{1\}, instead of \verb|\ncols|. In this way, each -space-separated word of the input file will be set to a new data row. -While this approach is useful for sticking each ``word'' of input data -into its own single-column data row, the command -\verb|\copyrecords|\margcmd{copyrecords} can be used to stick the -individual ``file records'' from the most recent \verb|\readdef| into a -2-D array of \textbf{single-column width}. The \verb|\copyrecords| command takes -as its argument an alphabetic string identifier to associate with the -array of data. Its use accomplishes two things: 1) it allows records -(rather than words) of a file to be accessed using the general -\verb|\Arrayij| nomenclature to be discussed shortly; and 2) it saves -the most recently read file data into its own data structure, so that it -is not overwritten by a subsequent invocation of \verb|\readdef|. - -\subsection{Creating 3-D Arrays} - -For the 3-D case, \vb|\readArrayijk|\margcmd{readArrayijk} takes an -additional argument, in comparison to \verb|\readArrayij|. The first two -arguments are identical to \vb|\readArrayij|; namely, the token containing -the data and an identifier for the array. The third argument is the -number of rows in the array, while the fourth argument is the number of -columns. Likewise, if \vb|\readdef| had been used on a properly formed +\footnote{% +For a simple 1-D list punctuated by data separators, one may use the +\loi{} package directly:\\ +\rl\theverbbox\\ +which produces the following output: +\setsepchar{ }% +\readlist\oneDlist{\dataA}% +\oneDlistlen{} list items, 12th item is ``\oneDlist[12]''. +} + +On the other hand, if one wishes a 1-D file-record array, in which each + array element corresponds to the record from a file, then \rdar{} + can be used. +The command \cmd{readrecordarray} can be used to stick the individual + ``file records'' from a designated file into a 1-D array. + +The \cmd{readrecordarray} command takes two arguments: a file + name containing data records, and the name of a 1-D record-array + into which to place the file records. + +So, for example, with the invocation of + \vb|\readrecordarray{data.txt}\oneD|, the data from the file + \texttt{data.txt} is now saved in the \cmd{oneD} array, and can + be retrieved, for example, the 3rd record, with \cmd{oneD[3]}, which + returns \readrecordarray{file1data.txt}\oneD``\oneD[3]''. + +If an array name is reutilized, its prior definitions are cleared, + so that ``old'' data is not inadvertantly retrieved following the + reutilization. + + +\subsection{Creating 2-D and 3-D Arrays} + +The \cmd{readarray}\margcmd{readarray} command, used to convert + raw parsable data into data arrays, + takes three arguments. +The first is the data macro into which the unarrayed raw data had + previously been stuffed (e.g., by way of \cmd{readdef} or \cmd{def}). +The second is array-identifier macro into which the parsed data is to + be placed. +Finally, the last compound argument, enclosed in square brackets, denotes the + rank and range of the array to be created. + +There is a starred version of the command, \cmd{readarray*}, which is used + to remove leading/trailing spaces from the array elements, when parsed. +This option, is only relevant when the data separator is not already a + space. + +If an array name is reutilized, its prior definitions are cleared, + so that ``old'' data is not inadvertantly retrieved following the + reutilization. + +\subsubsection{2-D Arrays} + +\begin{sloppypar} +For a 2-D array, this last argument of \cmd{readarray} will be + of the form \vb|[-,<columns>]|. +If the data had recently been read by way of \vb|\readdef|, the + string \vb|\ncols| may be used to signify the \vb|<columns>| value. +The \texttt{-} (or any other character before the initial comma) + reminds us that the range of row numbers is not specified in advance, + but is dictated by the length of the data macro containing the raw + file data. +For such a 2-D array, only the column range is specified. +\end{sloppypar} + +Consider, for example, the previously discussed file, \texttt{dataA.txt}, + which had been digested into the data macro \cmd{dataA}. +One can process that as a 2-D array with an invocation of + \vb|\readarray\dataA\twoD[-,\ncols]|, since \cmd{ncols} had been + set to a value of \texttt{\ncols}, based on the prior \cmd{readdef}. +Thereafter, data may be retieved, for example the 3rd row, 2nd column, + with \cmd{twoD[3,2]}, to give +\readarray\dataA\twoD[-,\ncols] +``\twoD[3,2]''. + +The actual array size is given by +\cmd{twoDROWS}, \cmd{twoDCOLS}, \cmd{twoDCELLS} +as +\twoDROWS, \twoDCOLS, and \twoDCELLS, respectively. +The number of rows in the array is fewer than the number of file records, + \oneDCELLS, because blank rows in the input file are ignored. +One should also note that if the end of the data stream results in a + partial final row of data, the partial row will be discarded. + +\subsubsection{3-D Arrays} + +For the 3-D case, the only difference in the invocation of + \vb|\readarray| is in the 3rd argument, in which the + rank and range of the array is specified. +This last argument will be of the form + \vb|[-,<rows>,<columns>]|. +As before, the \vb|-| denotes the fact that the range of the planes + of data is unknown before the fact, and governed by the length + of data in the dataset. +Only the range of rows and columns are specifiable here. +If \vb|\readdef| had been used on a properly formed input file, both \vb|\nrows| and \vb|\ncols| may be used to supply the -third and fourth arguments. +range arguments of the 3-D array. + +For example, using the same \cmd{dataA} dataset, but reading it as a + 3-D array can be accomplished with + \vb|\readarray\dataA\threeD[-,\nrows,\ncols]|.% +\readarray\dataA\threeD[-,\nrows,\ncols] +This results in an array with \threeDPLANES{} planes, + \threeDROWS{} rows, and \threeDCOLS{} columns +(\threeDCELLS{} data cells total). +Data from the 2nd plane, 1st row, 2nd column can be obtained via +\cmd{threeD[2,1,2]} as ``\threeD[2,1,2]''. + +If, perchance, a row or plane is only partially defined by + \cmd{readarray}, the partial data is discarded from the array. + +\subsubsection{Array Parsing Separator} While it may be easily envisioned that the array data is numerical, this -need not be the case. The data may be text, and even formatted text. + need not be the case. +The array data may be text, and even formatted text. + Furthermore, one may introduce space characters into the data of -individual cells through the use of hardspaces (\vb|~|), since -normal white space would otherwise be interpreted as a data separator. -Thus, given the following definitions and array initialization, - -\begin{verbbox}[] -\def\I#1{\textit{#1}} -\def\dataC{% -\I{am} \I{are} have~\I{been} have~\I{been} -\I{are} \I{are} have~\I{been} have~\I{been} -\I{is} \I{are} has~\I{been} have~\I{been} -% -\I{was} \I{were} had~\I{been} had~\I{been} -\I{were} \I{were} had~\I{been} had~\I{been} -\I{was} \I{were} had~\I{been} had~\I{been} -% -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -} -\readArrayijk{\dataC}{tobeConjugation}{3}{4} -\end{verbbox} -\begin{tabular}{l} -\theverbbox -\end{tabular} - -\def\I#1{\textit{#1}} -\def\dataC{% -\I{am} \I{are} have~\I{been} have~\I{been} -\I{are} \I{are} have~\I{been} have~\I{been} -\I{is} \I{are} has~\I{been} have~\I{been} -% -\I{was} \I{were} had~\I{been} had~\I{been} -\I{were} \I{were} had~\I{been} had~\I{been} -\I{was} \I{were} had~\I{been} had~\I{been} -% -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -will~\I{be} will~\I{be} will~have~\I{been} will~have~\I{been} -} -\readArrayijk{\dataC}{tobeConjugation}{3}{4} -multi-word sequences will be placed into the individual array elements -of an array identified as ``tobeConjugation,'' with the appropriate -italic emphases applied to the words. - -If, perchance, a row is only partially defined by \vb|\readArrayij| or -a plane is only partially defined by \vb|\readArrayijk|, the partial -data is discarded. - -\subsection{Treatment of Hardspaces} - -For either the 2-D or 3-D \verb|\readArray| commands, the interpretation -of hardspaces (\vb|~|) as data is specifically designed to allow -multi-word data entries. However, one may choose to turn this feature -off by setting the flag + individual cells simply by resetting the \rdar{} parsing separator + to something other than the default space, ``~''. +This can be done, for example employing a comma as the separator, + by way of \vb|\readarraysepchar{,}|.\margcmd{readarraysepchar} + +Note also, using the facilities of the underlying \loi{} package, + that compound separators are possible. +For example, \textit{either} a comma \textit{or} a period may be used + for the data parsing, by specifying a + \textbf{logical-OR} (\vb+||+) separated list: \vb:\readarraysepchar{,||.}:. +Similarly, a multicharacter separator is possible, so that setting + \vb|\readarraysepchar{!!}| will cause \cmd{readarray} to look for + instances of ``!!'' to divide the data into separate array elements. + +Consider the following comma-separated input in, let us say, the file + \textsf{conjugation.txt}. -\rl\vb|\def\converttilde{T}| +\verbfilebox[\footnotesize]{file3data.txt} +\rl\theverbbox + +The sequence of commands + +\begin{verbbox} +\readarraysepchar{,} +\readdef{conjugation.txt}\dataC +\readarray*\dataC\tobeConjugation[-,\nrows,\ncols] +\end{verbbox} +\rl\theverbbox +\readarraysepchar{,} +\readdef{file3data.txt}\dataC +\readarray*\dataC\tobeConjugation[-,\nrows,\ncols] + +will employ a comma separator to parse the file. +It will then create a 3-D array using data from the file, placed into the + array \cmd{tobeConjugation}. +Leading/trailing spaces will be removed from the data, with the use of the + star form of the \cmd{readarray} command. +Data can then be directly accessed, so that, for example +\cmd{tobeConjugation[1,3,3]} will yield the entry from the + 1st plane, 3rd row, 3rd column as ``\tobeConjugation[1,3,3]''. + +The 3-D array metrics are \cmd{tobeConjugationPLANES}, + \cmd{tobeConjugationROWS}, \cmd{tobeConjugationCOLS}, and + \cmd{tobeConjugationCELLS}, which are + here given as \tobeConjugationPLANES, + \tobeConjugationROWS, \tobeConjugationCOLS, and + \tobeConjugationCELLS. + respectively. -which will have the effect of converting hardspaces to regular space -tokens. \section{Recalling Data from Array Structures} -While one has specified the number of columns and/or rows associated -with the \vb|\readArray...| initialization, those numbers may not yet +\begin{sloppypar} +While one must specify the number of columns and/or rows associated +with the \vb|\readarray| invocation, those numbers may not yet be known to the user, if the values employed came from the -\vb|\readdef| initializations of -\vb|\ncols| and \vb|\nrows|. Therefore, the \vb|\readArray...| -\margcmd{{\rmfamily\itshape identifier}CELLS}% -\margcmd{{\rmfamily\itshape identifier}PLANES}% -\margcmd{{\rmfamily\itshape identifier}ROWS}% -\margcmd{{\rmfamily\itshape identifier}COLS}% -commands also set the following strings: -\itshape\vb|\|identifier\vb|CELLS|, \vb|\|identifier\vb|PLANES|% , -\vb|\|identifier\vb|ROWS|{\upshape, and} -\vb|\|identifier\vb|COLS|\upshape, where -\textit{identifier} is the array identifier string that was supplied to -the \verb|\readarray...| command. Note that it is the -case, for 3-D arrays, that - -\rl\itshape\vb|\|identifier\vb|CELLS| $=$ \vb|\|identifier\vb|PLANES| -$\times$ \vb|\|identifier\vb|ROWS| $\times$ -\vb|\|identifier\vb|COLS|\upshape +\vb|\readdef| estimations of +\vb|\ncols| and \vb|\nrows|. Therefore, the \cmd{readrray} +\margcmd{{\rmfamily\itshape array-identifier}CELLS}% +\margcmd{{\rmfamily\itshape array-identifier}PLANES}% +\margcmd{{\rmfamily\itshape array-identifier}ROWS}% +\margcmd{{\rmfamily\itshape array-identifier}COLS}% +command variants also define the following strings: +\itshape\vb|\|array-identifier\vb|CELLS|, \vb|\|array-identifier\vb|PLANES|, +\vb|\|array-identifier\vb|ROWS|{\upshape, and} +\vb|\|array-identifier\vb|COLS|\upshape, where +\cmd{array-identifier} is the array name supplied to +the \cmd{readarray} command. Note, for 3-D arrays, that +\end{sloppypar} + +\rl\itshape\vb|\|array-identifier\vb|CELLS| $=$ \\\rl\quad + \vb|\|array-identifier\vb|PLANES| $\times$ \vb|\|array-identifier\vb|ROWS| + $\times$ \vb|\|array-identifier\vb|COLS|\upshape -For the ``tobeConjugation'' example of the prior section, +For the \cmd{tobeConjugation} example of the prior section, \tobeConjugationCELLS $=$\tobeConjugationPLANES $\times$\tobeConjugationROWS $\times$% \tobeConjugationCOLS. Likewise, for 2-D arrays -\rl\itshape\vb|\|identifier\vb|CELLS| $=$ \vb|\|identifier\vb|ROWS| -$\times$ \vb|\|identifier\vb|COLS|\upshape +\rl\itshape\vb|\|array-identifier\vb|CELLS| $=$ \vb|\|array-identifier\vb|ROWS| +$\times$ \vb|\|array-identifier\vb|COLS|\upshape -To retrieve the data from the array, one need employ either the -\vb|\Arrayij| -\margcmd{Arrayij} -or \vb|\Arrayijk| -\margcmd{Arrayijk} -commands, depending on whether the array is 2-D or 3-D. The first -mandatory argument to either of these commands is the array identifer. -The remaining arguments to these commands are simply the row and column, -in the case of the 2-D \vb|\Arrayij|, or else the plane, row, and -column, in the case of the 3-D \vb|\Arrayijk|. +To retrieve the data from the array, one merely supplies the + array name in the form of + \cmd{}\textit{array-identifier}\margcmd{\rmfamily\itshape array-identifier% + \upshape\ttfamily[...]}, + along with the array-cell nomenclature in the form of + \textit{\texttt{\upshape[}plane\texttt{\upshape,}row\texttt{\upshape,}% + column\texttt{\upshape]}} for 3-D arrays, + \textit{\texttt{\upshape[}row\texttt{\upshape,}% + column\texttt{\upshape]}} for 2-D arrays, and + \textit{\texttt{\upshape[}row\texttt{\upshape]}} for 1-D arrays. Thus, in the case of the earlier example involving conjugation of the verb \textit{to be}, the second-person future-perfect tense of the verb -is given by\\ -\rl\vb|\Arrayijk{tobeConjugation}{3}{2}{4}|,\\ -which yields ``\Arrayijk{tobeConjugation}{3}{2}{4}.'' - -For pseudo-1-D arrays, either created with \verb|\copyrecords| or else -using the \verb|\readarray| command with the third argument set to -unity, access to these arrays is achieved by way of \verb|\Arrayij|, -setting the column argument to unity. - -There are also strings defined, one for each record that was read from -the file, with the name -\verb|\record|\textit{index}\margcmd{record\itshape\rmfamily index}, -where \textit{index} is the record number expressed in roman numerals. -Thus in the example from section~\ref{s:ex}, \vb|\recordii| would -contain the string ``\vb|A121 A122 A123 A124|''. However, such syntax -provides no bounds checking. - -An alternate (perhaps preferred) way to access one of the file records -read during the most recent \verb|\readdef|, in a way which provides -bounds checking, is to use the \verb|\showrecord| -command\margcmd{showrecord}. For the section~\ref{s:ex} example, the -alternative to executing \vb|\recordii| would be to use -\verb|\showrecord{2}|. The optional argument to this command provides -an alternative error message if the record requested is out of bounds. -The default error messages for negative or excessive record numbers are, -respectively: - -\def\nrecords{1} -\rl\showrecord{-1}\\ -\rl\showrecord{10} - -Unlike the \vb|\Arrayij| and \verb|\Arrayijk| commands already -discussed, the record data from a given file read will only be available -until the next invocation of \verb|\readdef|. For this reason, the -command \verb|\copyrecords| was introduced to convert file-record data -into an array data structure. +is given by + +\rl\cmd{tobeConjugation[3,2,4]} -While the user is developing his application involving the {\rdar} +which yields ``\tobeConjugation[3,2,4]''. + +\section{Bounds Checking} + +While the user is developing his or her application involving the {\rdar} package, there may accidentally arise the unintended circumstance where -an array element is asked for which falls outside the array bounds. -Like \verb|\showrecord|, the \verb|\Arrayij| and \verb|\Arrayijk| -commands also employ bounds checking. These commands check for -four error conditions that, by default, produce the following error -messages:\\ -\rl\Arrayijk{tobeConjugation}{-3}{2}{4}\\ -\rl\Arrayijk{tobeConjugation}{9}{2}{4}\\ -\rl\Arrayijk{tobeConjugation}{3}{9}{4}\\ -\rl\Arrayijk{tobeConjugation}{3}{2}{9} - -which are written in lieu of a valid array element datum. While such -messages help in debugging, the user may desire an error tailored to the -application. The optional argument to both \vb|\Arrayij| and -\vb|\Arrayijk| replaces the default error messages and is to be printed -if any error condition arises. It could be a blank \vb|[]|, a black -box \vb|[\rule{1ex}{1ex}]|, or anything else that makes sense for the -application. - -\section{Alternate Accessing Commands if \texttt{\bs edef} is Required} - -The\verb|\Arrayij| and \verb|\Arrayijk| commands may, of course, be -placed as arguments of \verb|\def| commands. They, cannot, however, be -placed into an \verb|\edef|. If the user has need to place the -array-element content into an \verb|\edef| (and assuming that the -actual array-element content is suitable for an \verb|\edef|), the user -should employ the \verb|\arrayij| and \verb|\arrayijk| commands, as -alternatives. -\margcmd{arrayij}\margcmd{arrayijk}% -These commands do not perform any bounds checking (thus eliminating the -need for an optional argument). Their advantage, however, is that they -may be freely placed into an -\verb|\edef|. +an array element is requested which falls outside the array bounds. +In general, when a non-existent array element is requested in the + absence of bounds checking, the call will expand to \cmd{relax}. + +The package provides three declarations to set the manner in + which array bounds are be monitored. +The setting \cmd{nocheckbounds}\margcmd{nocheckbounds} is used when bounds + are not to be checked. +This is the default behavior for \rdar. +For some bounds checking, \cmd{checkbounds}\margcmd{checkbounds} + may be set. +With this setting, bounds violations are noted, but no guidance is + provided as to the allowable index range for the array. +However, with \cmd{hypercheckbounds}\margcmd{hypercheckbounds} set, + full bounds checking is possible. +With this setting, not only are violations noted, but a description + of the actual array range is provided. + +As of V2.0, bounds violations are noted in the log file, rather than the + document itself. +However, if an array bound is violated when bounds checking is turned on, +a ``?'' shows up in the document itself. + + +\section{Accessing Array Cells if Full Expansion is Required + (e.g., placed in an \texttt{\bs edef}) } + +If full expansion is required of array cell contents (and assuming the cell + content is expandable), it is advisable to set \cmd{nocheckbounds}% + , so that the error checking code is not + included in the expansion. +Results may be also expanded even with \cmd{checkbounds} + set, though the error-checking code is part of the expansion. +However, with \cmd{hypercheckbounds} set, full + expansion of array cells is no longer possible. + +\section{Accessing Array Cells if No Expansion is Required} + +With the normal use of \cmd{\rmfamily\itshape array-identifier} syntax + for accessing array cells, + several levels of expansion are required to directly recover the original + tokens of the cell, and then only when bounds checking is disabled. +When the actual unexpanded tokens of cell are required, the use of the + \cmd{arraytomacro}\margcmd{arraytomacro} command provides the means + to accomplish this. +The command takes the array name and index as the initial arguments followed + by a generic macro name into which to place the unexpanded tokens of the + indexed array cell. + +So, for example \vb|\arraytomacro\tobeConjugation[2,2,3]\thiscell| will + place the cell's original tokens in the macro \cmd{thiscell}. +Upon detokenization, \cmd{thiscell} contains +\arraytomacro\tobeConjugation[2,2,3]\thiscell +``\texttt{\detokenize\expandafter{\thiscell}}''. \section{Support Routines} -The engine for the {\rdar} package is the \vb|\getargsC| -\margcmd{getargsC} command, based on the \vb|\getargs| command found -in the \textsf{stringstrings} package. This command has been herein -rewritten for speed. The \vb|\getargsC| command takes a string or -token as its argument and separates each of the space-separated words of -it into individual strings, named with roman numerals as -\vb|\argi|\margcmd{arg\itshape\rmfamily index}, \vb|\argii|, -\textit{etc}. The total number of arguments that are separated is given -by the string \vb|\narg|\margcmd{narg}. This command can be useful -for a variety of applications outside of \rdar. While generally used -only for diagnostic purposes, the command -\vb|\showargs|\margcmd{showargs} is used print out all the arguments -recently digested by an invocation of \vb|\getargsC|, separated by -small black blocks. The optional argument to \vb|\showargs| is the -number of individual arguments to place on a single line of output, -before issuing a linefeed. Thus, the command +The package provides two commands that can help one understand how a + data set has been parsed into an array. +Both of these commands dump the specified array to the document. +In the case of \cmd{arraydump}\margcmd{arraydump}, the array is formatted + in the structure of the array, broken up by columns, rows, and planes. +In the case of \cmd{scalardump}\margcmd{scalardump}, however, the elements + of the array are dumped sequentially, without reference to the array's + heirarchy. + +For the case of 1-D record array \cmd{oneD} employed in prior sections, for + example, the invocations of + +\rl\vb|\arraydump\oneD|\\ +\rl\vb|\scalardump\oneD| + +results in + +\arraydump\oneD +\scalardump\oneD + +\clearpage + +The \cmd{twoD} equivalent, resulting from parsing the same data file as + a 2-D, rather than a 1-D record array, is + +\rl\vb|\arraydump\twoD|\\ +\rl\vb|\scalardump\twoD| + +\arraydump\twoD +\scalardump\twoD + +For the case of the 3-D array (earlier read as \cmd{threeD}), +the \cmd{arraydump} would appear as + +\rl\vb|\arraydump\threeD|\\ +\rl\vb|\scalardump\threeD| + +\arraydump\threeD +\scalardump\threeD + +Note that the \cmd{scalardump} of \cmd{threeD} is indistinguishable from + that of \cmd{twoD}, since both arrays are comprised of the same data + cells, though arrayed into different plane/row/column structures. + +\clearpage +For comparison, the \cmd{arraydump} of \cmd{tobeConjugation} is + +\arraydump\tobeConjugation + + +\section{Deprecated, Vestigial, and Defunct Features} + +\textbf{Deprecated} + +The following commands are supplied, but are no longer the preferred +embodiment of package syntax. + +\itshape +\rl\vb|\copyrecords{|array-identifier\vb|}|% +\\ +\rl\vb|\readArrayij{\|data-macro\vb|}{|array-identifier\vb|}{|columns\vb|}|% +\\ +\rl\vb|\readArrayij*{\|data-macro\vb|}{|array-identifier\vb|}{|columns\vb|}|% +\\ +\rl\vb|\readArrayijk{\|data-macro\vb|}{|array-identifier\vb|}{|rows\vb|}{|columns\vb|}|% +\\ +\rl\vb|\readArrayijk*{\|data-macro\vb|}{|array-identifier\vb|}{|rows\vb|}{|columns\vb|}|% +\\ +\rl\vb|\showrecord[|error\vb|]{|record number\vb|}|\\ +\rl\vb|\Arrayij[|error\vb|]{|array-identifier\vb|}{|row\vb|}{|column\vb|}|\\ +\rl\vb|\Arrayijk[|error\vb|]{|array-identifier\vb|}{|plane\vb|}{|row\vb|}{|% + column\vb|}|\\ +\rl\vb|\arrayij{|array-identifier\vb|}{|row\vb|}{|column\vb|}|\\ +\rl\vb|\arrayijk{|array-identifier\vb|}{|plane\vb|}{|row\vb|}{|% + column\vb|}|\upshape + +\textbf{Vestigial} + +The following support macros are provided but no longer recommended. +Their capability is more fully served by way of the \loi{} package. + +\itshape +\rl\vb|\getargsC{\|macro {\upshape or} string\vb|}|\\ +\rl\vb|\arg|index\\ +\rl\vb|\narg|\\ +\rl\vb|\showargs|% +\upshape + +Note that whereas \cmd{getargs} could previously (pre-V2.0 \rdar) employ + only a space as the parsing separator, \cmd{getargs} now respects the + currently set value of separator, as (re)defined by \cmd{readarraysepchar}. + +\textbf{Defunct} + +The following macros are no longer supported. + +\itshape +\rl\vb|\converttilde|\\ +\rl\vb|\record|index +\upshape + +Since the package now supports arbitrary parsing separators, + there is no need for the function of \cmd{converttilde}. +However, were one desiring to parse, while treating hard spaces as spaces, + this can be simply achieved under V2.0 \rdar{} by setting the + parsing character as either a space or a hard space, using + \vb:readarraysepchar{ ||~}:. +Likewise, the indirect addressing (using a romannumeral \textit{index}) + provided by the internal command \cmd{record}\textit{index} is fully + superceded by the ability to directly address any record of \rdar's + 1-D record arrays. -\begin{verbbox}[] -\showargs[4] -\end{verbbox} -\begin{tabular}{l} -\theverbbox -\end{tabular} - -yields the following result: - -\showargs[4] - -Note that the 37$^{th}$ argument is non-printing and represents the -residual linefeed left over fromt he \vb|\def| of \vb|\dataC|. A -similar residual argument is also left by the \vb|\readdef| command. -It can be eliminated if the last record of the \vb|\readdef| input -file (or the last record of the \vb|\def| command) ends with a -\vb|%| symbol, so as to discard the final linefeed prior to the -end-of-file (or \vb|}|). - -As mentioned earlier, the flag -\vb|converttilde|\margcmd{converttilde}, by default ``false,'' can be -set to \vb|\def\converttilde{T}| so as to tell \vb|\getargsC| to -treat hardspaces as ordinary spaces. \section{Acknowledgements} -The author would like to thank Dr. David Carlisle for his assistance in +I am profoundly thankful to Christian Tellechea for using + my simplistic (read ``deficient'') \textsf{getargs} package to + inspire his effort in creating the powerful \loi{} package. +It is precisely the tool I have sought for a long time, and I have + adapted its use into the workings of this package. + +I would like to thank Dr. David Carlisle for his assistance in helping the author rewrite the \vb|\getargs| command, originally found in the \textsf{stringstrings} package. To distinguish the two versions, -and in deference to him, it is herein named \vb|\getargsC|. +and in deference to him, it is herein named \vb|\getargsC|. However, +as of V2.0, its presence is vestigial, having instead been superceded with +the \loi{} package macros. + +I am likewise grateful to Ken Kubota, who suggested moving the + \vb|\newread| outside of \vb|\readdef|, so as not to prematurely + exhaust the 16 available file streams. \clearpage - \section{Code Listing} -\verbatiminput{readarray.sty} - +\verbfilenobox[\footnotesize]{readarray.sty} \end{document} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/readarray.doc.tlpobj new/tlpkg/tlpobj/readarray.doc.tlpobj --- old/tlpkg/tlpobj/readarray.doc.tlpobj 2016-04-14 19:44:41.000000000 +0200 +++ new/tlpkg/tlpobj/readarray.doc.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -1,9 +1,9 @@ name readarray.doc category Package -revision 30489 +revision 42467 shortdesc doc files of readarray relocated 1 -docfiles size=63 +docfiles size=132 RELOC/doc/latex/readarray/README RELOC/doc/latex/readarray/readarray.pdf RELOC/doc/latex/readarray/readarray.tex ++++++ readarray.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tex/latex/readarray/readarray.sty new/tex/latex/readarray/readarray.sty --- old/tex/latex/readarray/readarray.sty 2013-05-15 23:52:42.000000000 +0200 +++ new/tex/latex/readarray/readarray.sty 2016-11-25 19:33:58.000000000 +0100 @@ -1,7 +1,9 @@ +\def\readarrayPackageVersion{2.0} +\def\readarrayPackageDate{2016/11/07} \ProvidesPackage{readarray} -[2013/05/09 v1.2 -Routines for inputting array data and recalling it on an -element-by-element basis. Currently supports 2-D and 3-D array] +[\readarrayPackageDate\ \readarrayPackageVersion\ % +Routines for inputting 2D and 3D array data and recalling it on an +element-by-element basis.] % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -16,14 +18,23 @@ % The Current Maintainer of this work is Steven B. Segletes. % % Revisions: -% v1.01 Documentation revision -% v1.1 Added \csname record\roman{@row}\endcsname to \readdef +% v1.01 -Documentation revision +% v1.1 -Added \csname record\roman{@row}\endcsname to \readdef % v1.2 -Corrected the [truncated] LPPL license info % -Added \arrayij and \arrayijk, which can be put into \edef % -Used \romannumeral in preference to \roman{}, when possible, % to avoid unnecessary use of counters. -\usepackage{ifthen} -\usepackage{ifnextok} +% v1.3 -Moved \newread outside of \readdef, so as not to exhaust the +% 16 allotted file streams (Thanks to Ken Kubota for the tip). +% v2.0 -Converted parsing to listofitems package. This allows for +% ANY parsing character or combination of characters (via logical OR). +% -Replaced all \protected@edef's with appropriately expanded \def's. +% -Use listofitems package in preference to \getargsC. +% -Deprecated \Arrayijk, \arrayijk, \Arrayij, & \arrayij. Direct +% access now preferred, e.g., \xyz[2,3,1]. +% -Deprecated most other commands in favor of a more natural syntax. +\RequirePackage{ifthen} +\RequirePackage{listofitems}[2016-10-22] % \newcounter{@index} \newcounter{@plane} @@ -31,20 +42,156 @@ \newcounter{@col} \newcounter{use@args} \newcounter{@record} -\def\the@rule{\rule{.8ex}{1.6ex}}% +\newcounter{arg@index} +\newcounter{break@count} +\newcounter{index@count} +\newcounter{loop@count} +\newtoks\Arg@toks +\newtoks\@arrayident@toks +\newread\rdar@file +% +\newcommand\readdef[2]{\@readdef{#1}{#2}{ArrayRecord}} +% +\newcommand\readrecordarray[2]{% + \edef\@arrayident{\rdar@macroname#2}% + \def\ra@TermA{\@readdef{#1}}% + \def\ra@TermB{\expandafter\ra@TermA\csname\@arrayident def\endcsname}% + \expandafter\ra@TermB\expandafter{\@arrayident}% +} +% +\newcommand\readarray{\@ifstar{\read@array@newsyntax[*]}{\read@array@newsyntax[]}} +% +\def\arraytomacro#1[#2]#3{% + \edef\@arrayident{\rdar@macroname#1[#2]}% + \@arrayident@toks=\expandafter\expandafter\expandafter{\csname\@arrayident\endcsname}% + \expandafter\def\expandafter#3\expandafter{\the\@arrayident@toks}% +} +% +\newcommand\readarraysepchar[1]{\def\read@array@sepchar{#1}} +% +\def\nocheckbounds{\def\rootmacro@aux##1##2##3{##1% + }\typeout{readarray: bounds checking OFF}% +} +% +\def\checkbounds{\def\rootmacro@aux##1##2##3{##1% + \expandafter\ifx##1\relax\readarrayboundfailmsg% + \setbox0=\hbox{\typeout{readarray Warning: ##1 out of bounds.}}% + \fi% + }\typeout{readarray: bounds checking ON}% +} % -\newcommand\readArrayijk[4]{% - \getargsC{#1}% - \setcounter{@plane}{\numexpr(\narg/#4/#3)}% - \setcounter{use@args}{\numexpr\arabic{@plane}*#3*#4}% - \ifthenelse{\arabic{use@args} > \narg}{% +\def\hypercheckbounds{\def\rootmacro@aux##1##2##3{##1% + \expandafter\ifx##1\relax\readarrayboundfailmsg% + \typeout{readarray Warning: ##1 out of bounds:}% + \fi% + \setcounter{index@count}{0}% + \parse@index##3,\relax% + \setcounter{loop@count}{0}% + \whiledo{\value{loop@count}<\value{index@count}}{% + \stepcounter{loop@count}% + \ifnum\csname parsed@index[\theloop@count]\endcsname<0% + \relax\typeout{\nonposmessage{##2}{##3}}\fi% + }% + \ifnum \value{index@count}=1\relax% + \ifnum\csname parsed@index[1]\endcsname>% + \csname##2CELLS\endcsname\relax\typeout{\recordmessage{##2}{##3}}\fi% + \fi + \ifnum \value{index@count}=2\relax% + \ifnum\csname parsed@index[1]\endcsname>% + \csname##2ROWS\endcsname\relax\typeout{\rowmessage{##2}{% + \csname parsed@index[1]\endcsname}}\fi% + \ifnum\csname parsed@index[2]\endcsname>% + \csname##2COLS\endcsname\relax\typeout{\colmessage{##2}{% + \csname parsed@index[2]\endcsname}}\fi% + \fi + \ifnum \value{index@count}=3\relax% + \ifnum\csname parsed@index[1]\endcsname>% + \csname##2PLANES\endcsname\relax\typeout{\planemessage{##2}{% + \csname parsed@index[1]\endcsname}}\fi% + \ifnum\csname parsed@index[2]\endcsname>% + \csname##2ROWS\endcsname\relax\typeout{\rowmessage{##2}{% + \csname parsed@index[2]\endcsname}}\fi% + \ifnum\csname parsed@index[2]\endcsname>% + \csname##2COLS\endcsname\relax\typeout{\colmessage{##2}{% + \csname parsed@index[3]\endcsname}}\fi% + \fi% + }\typeout{readarray: bounds hyperchecking ON}% +} +% +\def\rdar@macroname{\expandafter\@gobble\string} +% +\def\getArg@toks[#1]{\Arg@toks\expandafter\expandafter\expandafter{\Arg@list[#1]}} +% +\newcommand\@readdef[3]{% + \clear@array{#3}% + \edef\former@recordcount{\csname #3CELLS\endcsname}% + \def\first@row{T}% + \def\first@plane{T}% + \catcode\endlinechar=9 % + \def#2{}% + \setcounter{@record}{0}% + \openin\rdar@file=#1% + \loop\unless\ifeof\rdar@file% + \read\rdar@file to\rdar@fileline % Reads a line of the file into \rdar@fileline% + \addtocounter{@record}{1}% + \expandafter\g@addto@macro\expandafter#2\expandafter{\rdar@fileline}% + \ifthenelse{\equal{\rdar@fileline}{}}{}{\expandafter\g@addto@macro% + \expandafter#2\expandafter{\read@array@sepchar}}% + \if T\first@row\read@array{#2}\setcounter{@col}{\numexpr(\Arg@listlen-1)}% + \edef\ncols{\arabic{@col}}\def\first@row{F}\setcounter{@row}{1}% + \else% + \if T\first@plane% + \ifthenelse{\equal{\rdar@fileline}{}}{% + \edef\nrows{\arabic{@row}}\def\first@plane{F}% + }{% + \addtocounter{@row}{1}% + }% + \fi% + \fi% + \def\record@name{\csname #3[\the@record]\endcsname}% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter% + \expandafter\def\expandafter\record@name\expandafter{\rdar@fileline}% + \repeat% + \edef\nrecords{\arabic{@record}}% + \expandafter\edef\csname #3PLANES\endcsname{0}% + \expandafter\edef\csname #3ROWS\endcsname{\nrecords}% + \expandafter\edef\csname #3COLS\endcsname{0}% + \expandafter\edef\csname #3CELLS\endcsname{\nrecords}% + \closein\rdar@file% + \catcode\endlinechar=5 % + \define@rootmacro{#3}% +} +% +\def\read@array@newsyntax[#1]#2#3[#4,#5]{% + \edef\@arrayident{\rdar@macroname#3}% + \setcounter{index@count}{0}% + \parse@index#5,\relax% + \ifnum\value{index@count}=1\relax% + \def\ra@TermA{\readArrayij#1{#2}}% + \edef\ra@TermB{{\@arrayident}{\csname parsed@index[1]\endcsname}}% + \expandafter\ra@TermA\ra@TermB% + \else + \ifnum\value{index@count}=2\relax% + \def\ra@TermA{\readArrayijk#1{#2}}% + \edef\ra@TermB{{\@arrayident}{\csname parsed@index[1]\endcsname}% + {\csname parsed@index[2]\endcsname}}% + \expandafter\ra@TermA\ra@TermB% + \fi\fi +} +% +\newcommand\read@Arrayijk[5][]{% + \clear@array{#3}% + \read@array[#1]{#2}% + \setcounter{@plane}{\numexpr(\Arg@listlen/#5/#4)}% + \setcounter{use@args}{\numexpr\arabic{@plane}*#4*#5}% + \ifthenelse{\arabic{use@args} > \Arg@listlen}{% \addtocounter{@plane}{-1}% - \setcounter{use@args}{\numexpr\arabic{@plane}*#3*#4}% + \setcounter{use@args}{\numexpr\arabic{@plane}*#4*#5}% }{}% - \expandafter\edef\csname#2PLANES\endcsname{\arabic{@plane}}% - \expandafter\edef\csname#2ROWS\endcsname{#3}% - \expandafter\edef\csname#2COLS\endcsname{#4}% - \expandafter\edef\csname#2CELLS\endcsname{\arabic{use@args}}% + \expandafter\edef\csname#3PLANES\endcsname{\arabic{@plane}}% + \expandafter\edef\csname#3ROWS\endcsname{#4}% + \expandafter\edef\csname#3COLS\endcsname{#5}% + \expandafter\edef\csname#3CELLS\endcsname{\arabic{use@args}}% \setcounter{@index}{0}% \setcounter{@plane}{1}% \setcounter{@row}{1}% @@ -52,193 +199,229 @@ \whiledo{\value{@index} < \value{use@args}}{% \addtocounter{@index}{1}% \addtocounter{@col}{1}% - \ifthenelse{\value{@col} > #4}% + \ifthenelse{\value{@col} > #5}% {\addtocounter{@row}{1}% - \addtocounter{@col}{-#4}}% + \addtocounter{@col}{-#5}}% {}% - \ifthenelse{\value{@row} > #3}% + \ifthenelse{\value{@row} > #4}% {\addtocounter{@plane}{1}% - \addtocounter{@row}{-#3}}% + \addtocounter{@row}{-#4}}% {}% - \expandafter\protected@edef% - \csname#2X\roman{@plane}X\roman{@row}X\roman{@col}\endcsname% - {\expandafter\csname arg\roman{@index}\endcsname}% + \def\arg@name{\csname#3[\the@plane,\the@row,\the@col]\endcsname}% + \getArg@toks[\the@index]% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter% + \expandafter\def\expandafter\arg@name\expandafter{\the\Arg@toks}% }% + \define@rootmacro{#3}% } % -\newcommand\readArrayij[3]{% - \getargsC{#1}% - \setcounter{@row}{\numexpr(\narg/#3)}% - \setcounter{use@args}{\numexpr\arabic{@row}*#3}% - \ifthenelse{\arabic{use@args} > \narg}{% +\newcommand\read@Arrayij[4][]{% + \clear@array{#3}% + \read@array[#1]{#2}% + \setcounter{@row}{\numexpr(\Arg@listlen/#4)}% + \setcounter{use@args}{\numexpr\arabic{@row}*#4}% + \ifthenelse{\arabic{use@args} > \Arg@listlen}{% \addtocounter{@row}{-1}% - \setcounter{use@args}{\numexpr\arabic{@row}*#3}% + \setcounter{use@args}{\numexpr\arabic{@row}*#4}% }{}% - \expandafter\edef\csname#2PLANES\endcsname{1}% - \expandafter\edef\csname#2ROWS\endcsname{\arabic{@row}}% - \expandafter\edef\csname#2COLS\endcsname{#3}% - \expandafter\edef\csname#2CELLS\endcsname{\arabic{use@args}}% + \expandafter\edef\csname#3PLANES\endcsname{0}% + \expandafter\edef\csname#3ROWS\endcsname{\arabic{@row}}% + \expandafter\edef\csname#3COLS\endcsname{#4}% + \expandafter\edef\csname#3CELLS\endcsname{\arabic{use@args}}% \setcounter{@index}{0}% \setcounter{@row}{1}% \setcounter{@col}{0}% \whiledo{\value{@index} < \value{use@args}}{% \addtocounter{@index}{1}% \addtocounter{@col}{1}% - \ifthenelse{\value{@col} > #3}% + \ifthenelse{\value{@col} > #4}% {\addtocounter{@row}{1}% - \addtocounter{@col}{-#3}}% + \addtocounter{@col}{-#4}}% {}% - \expandafter\protected@edef% - \csname#2X\roman{@row}X\roman{@col}\endcsname% - {\expandafter\csname arg\roman{@index}\endcsname}% + \def\arg@name{\csname#3[\the@row,\the@col]\endcsname}% + \getArg@toks[\the@index]% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter% + \expandafter\def\expandafter\arg@name\expandafter{\the\Arg@toks}% }% + \define@rootmacro{#3}% } % -\def\nonposrecordmessage{{\tiny Only positive showrecords permitted}} -\def\recordmessage#1{{\tiny RECORD=#1 exceeds records read}} -% -\def\nonposmessage{{\tiny Only positive array indices permitted}} -\def\planemessage#1#2{{\tiny PLANE=#2 exceeds limit for #1}} -\def\rowmessage#1#2{{\tiny ROW=#2 exceeds limit for #1}} -\def\colmessage#1#2{{\tiny COL=#2 exceeds limit for #1}} -% -\newcommand\arrayijk[4]{% - \csname#1X\romannumeral#2X\romannumeral#3X\romannumeral#4\endcsname% -} -% -\newcommand\Arrayijk[5][$]{% - \ifthenelse{\value{@plane}<1 \OR \value{@row}<1 \OR \value{@col}<1}{% - \if$#1\nonposmessage\else#1\fi}{% - \ifthenelse{#3 > \csname#2PLANES\endcsname}{% - \if$#1\planemessage{#2}{#3}\else#1\fi}{% - \ifthenelse{#4 > \csname#2ROWS\endcsname}{% - \if$#1\rowmessage{#2}{#4}\else#1\fi}{% - \ifthenelse{#5 > \csname#2COLS\endcsname}{% - \if$#1\colmessage{#2}{#5}\else#1\fi}{% - \csname#2X\romannumeral#3X\romannumeral#4X\romannumeral#5\endcsname}% +\newcommand\clear@array[1]{% + \expandafter\ifx\csname #1\endcsname\relax\else% + \setcounter{@row}{0}% + \whiledo{\value{@row}<\csname #1ROWS\endcsname}{% + \stepcounter{@row}% + \ifnum\csname #1COLS\endcsname=0\relax% + \expandafter\let\csname #1[\the@row]\endcsname\relax% + \else + \setcounter{@col}{0}% + \whiledo{\value{@col}<\csname #1COLS\endcsname}{% + \stepcounter{@col}% + \ifnum\csname #1PLANES\endcsname=0\relax% + \expandafter\let\csname #1[\the@row,\the@col]\endcsname\relax% + \else + \setcounter{@plane}{0}% + \whiledo{\value{@plane}<\csname #1PLANES\endcsname}{% + \stepcounter{@plane}% + \expandafter% + \let\csname #1[\the@plane,\the@row,\the@col]\endcsname\relax% + }% + \fi% }% - }% - }% -} -% -\newcommand\arrayij[3]{% - \csname#1X\romannumeral#2X\romannumeral#3\endcsname% + \fi% + }% + \fi% } % -\newcommand\Arrayij[4][$]{% - \ifthenelse{\value{@row}<1 \OR \value{@col}<1}{% - \if$#1\nonposmessage\else#1\fi}{% - \ifthenelse{#3 > \csname#2ROWS\endcsname}{% - \if$#1\rowmessage{#2}{#3}\else#1\fi}{% - \ifthenelse{#4 > \csname#2COLS\endcsname}{% - \if$#1\colmessage{#2}{#4}\else#1\fi}{% - \csname#2X\romannumeral#3X\romannumeral#4\endcsname}% - }% - }% +\newcommand\read@array[2][]{% + \bgroup% + \expandafter\setsepchar\expandafter{\read@array@sepchar}% + \greadlist#1\Arg@list{#2}% + \egroup% + \edef\Arg@listCELLS{\Arg@listlen}% +} +% +\def\define@rootmacro#1{% + \expandafter\def\csname#1\endcsname[##1]{% + \expandafter\rootmacro@aux\csname #1[##1]\endcsname{#1}{##1}}% +} +% +\def\parse@index#1,#2\relax{% + \stepcounter{index@count}% + \expandafter\gdef\csname parsed@index[\theindex@count]\endcsname{#1}% + \ifx\relax#2\relax\else\parse@index#2\relax\fi% +} +% INITIALIZATION +\readarraysepchar{ } +\nocheckbounds +% +\def\nonposmessage#1#2{Negative index [#2] impermissable for #1.} +\def\recordmessage#1#2{RECORD=#2 exceeds bounds(=\csname#1CELLS\endcsname) for #1.} +\def\planemessage#1#2{PLANE=#2 exceeds bounds(=\csname#1PLANES\endcsname) for #1.} +\def\rowmessage#1#2{ROW=#2 exceeds bounds(=\csname#1ROWS\endcsname) for #1.} +\def\colmessage#1#2{COL=#2 exceeds bounds(=\csname#1COLS\endcsname) for #1.} +% +\def\the@showargs@rule{\kern.2pt\rule{.8ex}{1.6ex}\hspace{.2pt}}% +\def\readarrayboundfailmsg{?}% DISPLAYED WHEN ARRAY CALL OUT OF BOUNDS +% +% SUPPORT/DEBUG ROUTINES +% +% \arraydump INITIALIZATIONS +\def\row@spacer{\\} +\def\row@msg{\the@showargs@rule\hfill{\scriptsize\scshape$<$\row@sign~\arabic{@row}$>$}} +\def\header@msg{{\bfseries\ra@rank:}~} +\def\last@row{\\} +\def\plane@msg{\plane@sign\hrulefill\mbox{}\\} +\def\close@out{} +% +\newcommand\arraydump[1]{% + \edef\@arrayident{\rdar@macroname#1}% + \expandafter\ifx\csname\@arrayident\endcsname\relax\else% + \edef\ra@TmpA{\csname\@arrayident PLANES\endcsname}% + \edef\ra@TmpB{\csname\@arrayident COLS\endcsname}% + \def\ra@rank{3-D}% + \ifnum\ra@TmpA=0\relax\def\ra@TmpA{1}\def\plane@sign{\mbox{}}\def\ra@rank{2-D}% + \else\def\plane@sign{{\scriptsize\scshape Plane \arabic{@plane}}}\fi% + \ifnum\ra@TmpB=0\relax\def\ra@TmpB{1}\def\row@sign{Record}\def\ra@rank{1-D}% + \else\def\row@sign{Row}\fi% + \par\noindent\header@msg% + \setcounter{@plane}{0}% + \whiledo{\value{@plane}<\ra@TmpA}{% + \stepcounter{@plane}% + \plane@msg% + \setcounter{@row}{0}% + \whiledo{\value{@row}<\csname\@arrayident ROWS\endcsname}{% + \ifnum\value{@row}=0\relax\else\row@spacer\fi% + \stepcounter{@row}% + \setcounter{@col}{0}% + \whiledo{\value{@col}<\ra@TmpB}{% + \the@showargs@rule% + \stepcounter{@col}% + \ifnum\csname\@arrayident COLS\endcsname=0\relax% + #1[\the@row]% + \else% + \ifnum\csname\@arrayident PLANES\endcsname=0\relax% + #1[\the@row,\the@col]% + \else% + #1[\the@plane,\the@row,\the@col]% + \fi% + \fi% + }\row@msg% + }\last@row% + }\close@out\mbox{}\hrulefill\mbox{}\par% + \fi% +} +% +\newcommand\scalardump[1]{\bgroup% + \def\row@spacer{}% + \def\row@msg{}% + \def\header@msg{{\bfseries\csname\@arrayident CELLS\endcsname\ ELEMENTS:}% + ~\hrulefill\mbox{}\\}% + \def\last@row{}% + \def\plane@msg{}% + \def\close@out{\the@showargs@rule\\}% + \arraydump#1\egroup% +} +% +% DEPRECATED COMMANDS (NOT PREFERRED EMBODIMENT OF PACKAGE SYNTAX) +% +\newcommand\readArrayijk{\@ifstar{\read@Arrayijk[*]}{\read@Arrayijk}} +\newcommand\readArrayij{\@ifstar{\read@Arrayij[*]}{\read@Arrayij}} +\newcommand\arrayijk[4]{\csname#1[#2,#3,#4]\endcsname} +\newcommand\arrayij[3]{\csname#1[#2,#3]\endcsname} +\newcommand\Arrayijk[5][\relax]{% + \bgroup% + \ifx\relax#1\else\def\readarrayboundfailmsg{#1}\fi\csname#2\endcsname[#3,#4,#5]% + \egroup% +} +\newcommand\Arrayij[4][\relax]{% + \bgroup% + \ifx\relax#1\else\def\readarrayboundfailmsg{#1}\fi\csname#2\endcsname[#3,#4]% + \egroup% } -% \newcommand\copyrecords[1]{% + \clear@array{#1}% + \edef\former@recordcount{\csname #1CELLS\endcsname}% \setcounter{@record}{0}% \whiledo{\value{@record} < \nrecords}{% \addtocounter{@record}{1}% - \expandafter\protected@edef\csname#1X\roman{@record}Xi\endcsname{% - \csname record\roman{@record}\endcsname}% + \def\arg@name{\csname#1[\the@record]\endcsname}% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter% + \expandafter\def\expandafter\arg@name\expandafter{% + \csname ArrayRecord[\the@record]\endcsname}% }% - \expandafter\edef\csname#1PLANES\endcsname{1}% + \expandafter\edef\csname#1PLANES\endcsname{0}% \expandafter\edef\csname#1ROWS\endcsname{\nrecords}% - \expandafter\edef\csname#1COLS\endcsname{1}% + \expandafter\edef\csname#1COLS\endcsname{0}% \expandafter\edef\csname#1CELLS\endcsname{\nrecords}% + \define@rootmacro{#1}% } -% -\newcommand\showrecord[2][$]{% - \ifthenelse{#2<1}{% - \if$#1\nonposrecordmessage\else#1\fi}{% - \ifthenelse{#2 > \nrecords}{% - \if$#1\recordmessage{#2}\else#1\fi}{% - \csname record\romannumeral#2\endcsname}% - }% -} -% -\newcommand\readdef[2]{% -\def\first@row{T}% -\def\first@plane{T}% -\catcode\endlinechar=10\relax% -\def#2{}% -\setcounter{@record}{0}% -\newread\file% -\openin\file=#1% -\loop\unless\ifeof\file% - \read\file to\fileline % Reads a line of the file into \fileline% - \addtocounter{@record}{1}% - \protected@edef#2{#2\fileline}% - \if T\first@row\getargsC{#2}\setcounter{@col}{\numexpr(\narg-1)}% - \edef\ncols{\arabic{@col}}\def\first@row{F}\setcounter{@row}{1}% - \else% - \if T\first@plane\getargsC{\fileline}\ifthenelse{\equal{\narg}{1}}{% - \edef\nrows{\arabic{@row}}\def\first@plane{F}}{% - \addtocounter{@row}{1}}% - \fi% - \fi% - \expandafter\protected@edef\csname record\roman{@record}\endcsname{% - \fileline}% -\repeat% -\edef\nrecords{\arabic{@record}}% -\closein\file% -\catcode\endlinechar=5\relax% -} -% -\newcommand\showargs[1][0]{% - narg=\narg:~% - \the@rule% - \setcounter{arg@index}{0}% - \setcounter{break@count}{0}% - \whiledo{\value{arg@index} < \narg}{% - \addtocounter{arg@index}{1}% - \addtocounter{break@count}{1}% - \csname arg\roman{arg@index}\endcsname% - \the@rule% - \ifthenelse{\equal{#1}{\value{break@count}}}{% - \ifthenelse{\equal{\value{arg@index}}{\narg}}{}{% - \newline\the@rule\addtocounter{break@count}{-#1}}% - }% - {}% +\newcommand\showargs[1][0]{\bgroup% + \def\Arg@listPLANES{0}% + \def\Arg@listCOLS{0}% + \let\Arg@listROWS\Arg@listCELLS% + \scalardump\Arg@list\egroup% +} +\newcommand\showrecord[2][\relax]{% + \bgroup\ifx\relax#1\else\def\readarrayboundfailmsg{#1}\fi\ArrayRecord[#2]\egroup% +} +% The support routine \getargs{} is provided for backward compatibility. +% It is preferable to directly use facilities of the +% listofitems package to accomplish these tasks. +\def\getargsC#1{% + \bgroup% + \expandafter\setsepchar\expandafter{\read@array@sepchar}% + \greadlist\Arg@list{#1}% + \egroup% + \edef\narg{\Arg@listlen}% + \let\Arg@listCELLS\narg% + \setcounter{@index}{0}% + \whiledo{\value{@index}<\narg}{% + \stepcounter{@index}% + \expandafter\edef\csname arg\romannumeral\value{@index}\endcsname{% + \Arg@list[\value{@index}]}% }% - \setcounter{arg@index}{0}% } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% The \getargsC macro mimics the behavior of the \getargs macro -% of the stringstrings package, but runs faster, and can handle -% arbitrary tokens. For the development of \getargsC, significant -% assistance was provided by David Carlisle, for which the author is -% most appreciative. -% http://tex.stackexchange.com/questions/101604/ -% parsing-strings-containing-diacritical-marks-macros -% -\def\string@end{$\SaveHardspace} -\def\converttilde{F} -\newcounter{arg@index} -\newcounter{break@count} -\let\SaveHardspace~%%% -% -\def\getargsC#1{% - \if T\converttilde\def~{ }\else\catcode`~=12\fi - \protected@edef\the@string{#1}% - \setcounter{arg@index}{0}% - \lowercase{\expandafter\parse@Block\the@string} \string@end - \let~\SaveHardspace% - \catcode`~=13 -} -% -\def\parse@Block#1 {% - \stepcounter{arg@index}% - \@namedef{arg\roman{arg@index}}{#1}% - \futurelet\tmp\parse@Block@} -% -\def\parse@Block@{% -\ifx\tmp\string@end\edef\narg{\thearg@index}\expandafter\@gobble -\else\expandafter\parse@Block\fi} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/readarray.tlpobj new/tlpkg/tlpobj/readarray.tlpobj --- old/tlpkg/tlpobj/readarray.tlpobj 2016-04-14 19:44:41.000000000 +0200 +++ new/tlpkg/tlpobj/readarray.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -1,6 +1,6 @@ name readarray category Package -revision 30489 +revision 42467 shortdesc Read, store and recall array-formatted data relocated 1 longdesc The package allows the user to input formatted data into @@ -11,10 +11,11 @@ longdesc data is called for, the package proves particularly useful when longdesc elements of multiple arrays must be recallable and dynamically longdesc combined at time of compilation, rather than in advance. -runfiles size=2 +runfiles size=4 RELOC/tex/latex/readarray/readarray.sty +catalogue-also getargs catalogue-ctan /macros/latex/contrib/readarray -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-11-15 23:30:18 +0100 catalogue-license lppl1.3 catalogue-topics data-manip -catalogue-version 1.2 +catalogue-version 2.0 ++++++ realboxes.doc.tar.xz ++++++ ++++++ realboxes.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/realboxes.tlpobj new/tlpkg/tlpobj/realboxes.tlpobj --- old/tlpkg/tlpobj/realboxes.tlpobj 2016-04-14 19:44:41.000000000 +0200 +++ new/tlpkg/tlpobj/realboxes.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -16,7 +16,7 @@ runfiles size=3 RELOC/tex/latex/realboxes/realboxes.sty catalogue-ctan /macros/latex/contrib/realboxes -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics boxing catalogue-version 0.2 ++++++ realscripts.doc.tar.xz ++++++ ++++++ realscripts.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/realscripts.tlpobj new/tlpkg/tlpobj/realscripts.tlpobj --- old/tlpkg/tlpobj/realscripts.tlpobj 2016-04-14 19:44:41.000000000 +0200 +++ new/tlpkg/tlpobj/realscripts.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -14,7 +14,7 @@ runfiles size=2 RELOC/tex/latex/realscripts/realscripts.sty catalogue-ctan /macros/latex/contrib/realscripts -catalogue-date 2016-02-13 06:59:36 +0100 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics off catalogue-version 0.3d ++++++ rec-thy.doc.tar.xz ++++++ ++++++ rec-thy.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rec-thy.tlpobj new/tlpkg/tlpobj/rec-thy.tlpobj --- old/tlpkg/tlpobj/rec-thy.tlpobj 2016-04-14 19:44:42.000000000 +0200 +++ new/tlpkg/tlpobj/rec-thy.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -8,7 +8,7 @@ runfiles size=10 RELOC/tex/latex/rec-thy/rec-thy.sty catalogue-ctan /macros/latex/contrib/rec-thy -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license pd catalogue-topics maths catalogue-version 1.3 ++++++ recipe.doc.tar.xz ++++++ ++++++ recipe.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/recipe.tlpobj new/tlpkg/tlpobj/recipe.tlpobj --- old/tlpkg/tlpobj/recipe.tlpobj 2016-04-14 19:44:42.000000000 +0200 +++ new/tlpkg/tlpobj/recipe.tlpobj 2017-04-14 17:59:43.000000000 +0200 @@ -10,7 +10,7 @@ RELOC/tex/latex/recipe/recipe.cls catalogue-also recipecard recipebook catalogue-ctan /macros/latex/contrib/recipe -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license pd catalogue-topics cooking catalogue-version 0.9 ++++++ recipebook.doc.tar.xz ++++++ ++++++ recipebook.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/recipebook.tlpobj new/tlpkg/tlpobj/recipebook.tlpobj --- old/tlpkg/tlpobj/recipebook.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/recipebook.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -14,6 +14,6 @@ RELOC/tex/latex/recipebook/RecipeBook.cls catalogue-also recipe recipecard catalogue-ctan /macros/latex/contrib/recipebook -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics cooking class ++++++ recipecard.doc.tar.xz ++++++ ++++++ recipecard.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/recipecard.tlpobj new/tlpkg/tlpobj/recipecard.tlpobj --- old/tlpkg/tlpobj/recipecard.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/recipecard.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -10,7 +10,7 @@ RELOC/tex/latex/recipecard/recipecard.cls catalogue-also recipe recipebook catalogue-ctan /macros/latex/contrib/recipecard -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics cooking catalogue-version 2.0 ++++++ rectopma.doc.tar.xz ++++++ ++++++ rectopma.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rectopma.tlpobj new/tlpkg/tlpobj/rectopma.tlpobj --- old/tlpkg/tlpobj/rectopma.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/rectopma.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -9,6 +9,6 @@ runfiles size=1 RELOC/tex/latex/rectopma/rectopma.sty catalogue-ctan /macros/latex/contrib/rectopma -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics macro-supp ++++++ recycle.doc.tar.xz ++++++ ++++++ recycle.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/recycle.tlpobj new/tlpkg/tlpobj/recycle.tlpobj --- old/tlpkg/tlpobj/recycle.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/recycle.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -14,6 +14,6 @@ RELOC/fonts/type1/public/recycle/recycle.pfb RELOC/tex/latex/recycle/recycle.sty catalogue-ctan /fonts/recycle -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license gpl catalogue-topics font font-mf font-type1 font-specialist ++++++ refcheck.doc.tar.xz ++++++ ++++++ refcheck.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/refcheck.tlpobj new/tlpkg/tlpobj/refcheck.tlpobj --- old/tlpkg/tlpobj/refcheck.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/refcheck.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -11,7 +11,7 @@ runfiles size=3 RELOC/tex/latex/refcheck/refcheck.sty catalogue-ctan /macros/latex/contrib/refcheck -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license gpl catalogue-topics label-ref debug-supp catalogue-version 1.9.1 ++++++ refenums.doc.tar.xz ++++++ Binary files old/doc/latex/refenums/README.pdf and new/doc/latex/refenums/README.pdf differ Binary files old/doc/latex/refenums/demo.pdf and new/doc/latex/refenums/demo.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/refenums.doc.tlpobj new/tlpkg/tlpobj/refenums.doc.tlpobj --- old/tlpkg/tlpobj/refenums.doc.tlpobj 2016-04-14 19:44:43.000000000 +0200 +++ new/tlpkg/tlpobj/refenums.doc.tlpobj 2017-05-01 02:08:35.000000000 +0200 @@ -1,11 +1,12 @@ name refenums.doc category Package -revision 32562 +revision 44131 shortdesc doc files of refenums relocated 1 -docfiles size=25 +docfiles size=56 RELOC/doc/latex/refenums/LICENSE RELOC/doc/latex/refenums/README.md + RELOC/doc/latex/refenums/README.pdf RELOC/doc/latex/refenums/demo.pdf RELOC/doc/latex/refenums/demo.tex RELOC/doc/latex/refenums/test/demo-sec-param.tex ++++++ refenums.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/refenums.tlpobj new/tlpkg/tlpobj/refenums.tlpobj --- old/tlpkg/tlpobj/refenums.tlpobj 2016-04-14 19:44:44.000000000 +0200 +++ new/tlpkg/tlpobj/refenums.tlpobj 2017-05-01 02:08:35.000000000 +0200 @@ -1,6 +1,6 @@ name refenums category Package -revision 32562 +revision 44131 shortdesc Define reference labels items with names of their own relocated 1 longdesc The package provides commands to define enumerable items with a @@ -13,7 +13,7 @@ runfiles size=2 RELOC/tex/latex/refenums/refenums.sty catalogue-ctan /macros/latex/contrib/refenums -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2017-04-18 05:31:40 +0200 catalogue-license lppl1.3 catalogue-topics label-ref -catalogue-version 1.1.1 +catalogue-version 1.1.2 ++++++ reflectgraphics.doc.tar.xz ++++++ ++++++ reflectgraphics.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/reflectgraphics.tlpobj new/tlpkg/tlpobj/reflectgraphics.tlpobj --- old/tlpkg/tlpobj/reflectgraphics.tlpobj 2016-04-19 17:46:18.000000000 +0200 +++ new/tlpkg/tlpobj/reflectgraphics.tlpobj 2017-04-14 17:59:44.000000000 +0200 @@ -9,7 +9,7 @@ runfiles size=2 RELOC/tex/latex/reflectgraphics/reflectgraphics.sty catalogue-ctan /macros/latex/contrib/reflectgraphics -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics graphics-manip catalogue-version 0.2c ++++++ refman.doc.tar.xz ++++++ ++++++ refman.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/refman.tlpobj new/tlpkg/tlpobj/refman.tlpobj --- old/tlpkg/tlpobj/refman.tlpobj 2016-04-14 19:44:45.000000000 +0200 +++ new/tlpkg/tlpobj/refman.tlpobj 2017-04-14 17:59:45.000000000 +0200 @@ -12,7 +12,7 @@ RELOC/tex/latex/refman/refart.cls RELOC/tex/latex/refman/refrep.cls catalogue-ctan /macros/latex/contrib/refman -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics class catalogue-version 2.0e ++++++ refstyle.doc.tar.xz ++++++ ++++++ refstyle.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/refstyle.tlpobj new/tlpkg/tlpobj/refstyle.tlpobj --- old/tlpkg/tlpobj/refstyle.tlpobj 2016-04-14 19:44:46.000000000 +0200 +++ new/tlpkg/tlpobj/refstyle.tlpobj 2017-04-14 17:59:46.000000000 +0200 @@ -18,7 +18,7 @@ RELOC/tex/latex/refstyle/refstyle.cfg RELOC/tex/latex/refstyle/refstyle.sty catalogue-ctan /macros/latex/contrib/refstyle -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics label-ref catalogue-version 0.5 ++++++ regcount.doc.tar.xz ++++++ ++++++ regcount.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/regcount.tlpobj new/tlpkg/tlpobj/regcount.tlpobj --- old/tlpkg/tlpobj/regcount.tlpobj 2016-04-14 19:44:46.000000000 +0200 +++ new/tlpkg/tlpobj/regcount.tlpobj 2017-04-14 17:59:46.000000000 +0200 @@ -10,7 +10,7 @@ runfiles size=1 RELOC/tex/latex/regcount/regcount.sty catalogue-ctan /macros/latex/contrib/regcount -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics debug-supp catalogue-version 1.0 ++++++ regexpatch.doc.tar.xz ++++++ ++++++ regexpatch.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/regexpatch.tlpobj new/tlpkg/tlpobj/regexpatch.tlpobj --- old/tlpkg/tlpobj/regexpatch.tlpobj 2016-05-17 03:19:57.000000000 +0200 +++ new/tlpkg/tlpobj/regexpatch.tlpobj 2017-04-14 17:59:46.000000000 +0200 @@ -11,7 +11,7 @@ runfiles size=7 RELOC/tex/latex/regexpatch/regexpatch.sty catalogue-ctan /macros/latex/contrib/regexpatch -catalogue-date 2016-05-15 21:45:49 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics macro-supp catalogue-version 0.2b ++++++ register.doc.tar.xz ++++++ ++++++ register.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/register.tlpobj new/tlpkg/tlpobj/register.tlpobj --- old/tlpkg/tlpobj/register.tlpobj 2016-04-14 19:44:47.000000000 +0200 +++ new/tlpkg/tlpobj/register.tlpobj 2017-04-14 17:59:47.000000000 +0200 @@ -16,7 +16,7 @@ runfiles size=3 RELOC/tex/latex/register/register.sty catalogue-ctan /macros/latex/contrib/register -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics engineering comp-sci comp-net catalogue-version 1.6 ++++++ regstats.doc.tar.xz ++++++ ++++++ regstats.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/regstats.tlpobj new/tlpkg/tlpobj/regstats.tlpobj --- old/tlpkg/tlpobj/regstats.tlpobj 2016-04-14 19:44:47.000000000 +0200 +++ new/tlpkg/tlpobj/regstats.tlpobj 2017-04-14 17:59:47.000000000 +0200 @@ -11,7 +11,7 @@ RELOC/tex/latex/regstats/regstats.sty catalogue-also regcount catalogue-ctan /macros/latex/contrib/regstats -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics debug-supp catalogue-version 1.0h ++++++ reledmac.doc.tar.xz ++++++ ++++ 1668 lines of diff (skipped) ++++++ reledmac.tar.xz ++++++ ++++ 5337 lines of diff (skipped) ++++++ relenc.doc.tar.xz ++++++ ++++++ relenc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/relenc.tlpobj new/tlpkg/tlpobj/relenc.tlpobj --- old/tlpkg/tlpobj/relenc.tlpobj 2016-04-14 19:44:51.000000000 +0200 +++ new/tlpkg/tlpobj/relenc.tlpobj 2017-04-14 17:59:49.000000000 +0200 @@ -17,6 +17,6 @@ RELOC/tex/latex/relenc/t1renc.def RELOC/tex/latex/relenc/t1rzcm.fd catalogue-ctan /macros/latex/contrib/relenc -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1 catalogue-topics font-devel ++++++ relsize.doc.tar.xz ++++++ ++++++ relsize.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/relsize.tlpobj new/tlpkg/tlpobj/relsize.tlpobj --- old/tlpkg/tlpobj/relsize.tlpobj 2016-04-14 19:44:51.000000000 +0200 +++ new/tlpkg/tlpobj/relsize.tlpobj 2017-04-14 17:59:49.000000000 +0200 @@ -9,7 +9,7 @@ runfiles size=4 RELOC/tex/latex/relsize/relsize.sty catalogue-ctan /macros/latex/contrib/relsize -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license pd catalogue-topics font-sel macro-supp catalogue-version 4.1 ++++++ reotex.doc.tar.xz ++++++ ++++++ reotex.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/reotex.tlpobj new/tlpkg/tlpobj/reotex.tlpobj --- old/tlpkg/tlpobj/reotex.tlpobj 2016-04-14 19:44:52.000000000 +0200 +++ new/tlpkg/tlpobj/reotex.tlpobj 2017-04-14 17:59:49.000000000 +0200 @@ -8,7 +8,7 @@ runfiles size=6 RELOC/tex/latex/reotex/reotex.sty catalogue-ctan /graphics/pgf/contrib/reotex -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics diagram pgf-tikz catalogue-version 1.1 ++++++ repeatindex.doc.tar.xz ++++++ ++++++ repeatindex.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/repeatindex.tlpobj new/tlpkg/tlpobj/repeatindex.tlpobj --- old/tlpkg/tlpobj/repeatindex.tlpobj 2016-04-14 19:44:52.000000000 +0200 +++ new/tlpkg/tlpobj/repeatindex.tlpobj 2017-04-14 17:59:49.000000000 +0200 @@ -10,7 +10,7 @@ RELOC/makeindex/repeatindex/repeatindex.ist RELOC/tex/latex/repeatindex/repeatindex.sty catalogue-ctan /macros/latex/contrib/repeatindex -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl catalogue-topics index catalogue-version 0.01 ++++++ repere.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/metapost/repere/README new/doc/metapost/repere/README --- old/doc/metapost/repere/README 2013-12-20 23:01:27.000000000 +0100 +++ new/doc/metapost/repere/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -repere.mp - -This package provides MetaPost macros for drawing in a coordinate system : -- axis, grids -- points, vectors -- functions (curves, tangents, integrals, sequences) -- statistic diagrams - -The doc is in french, sorry for that - -License LPPL - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/metapost/repere/README.md new/doc/metapost/repere/README.md --- old/doc/metapost/repere/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/doc/metapost/repere/README.md 2017-05-12 00:45:29.000000000 +0200 @@ -0,0 +1,13 @@ +Package repere - Version 17.05 - May 10, 2017 + +This package provides MetaPost macros for drawing secondary school mathematics figures in a coordinate system : +- axis, grids +- points, vectors +- functions (curves, tangents, integrals, sequences) +- statistic diagrams +- plane geometry (polygons, circles) + +The doc is in french... + +License LPPL 1.3 + Binary files old/doc/metapost/repere/repere-doc.pdf and new/doc/metapost/repere/repere-doc.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/metapost/repere/repere-doc.tex new/doc/metapost/repere/repere-doc.tex --- old/doc/metapost/repere/repere-doc.tex 2013-12-20 23:01:27.000000000 +0100 +++ new/doc/metapost/repere/repere-doc.tex 2017-05-12 00:45:29.000000000 +0200 @@ -1,5 +1,8 @@ \documentclass[11pt,a4paper,french]{article} -% to compile this doc (needs geometriesyr16.mp http://melusine.eu.org/syracuse/poulecl/macros/): +% Needs geometriesyr16.mp +%http://melusine.eu.org/syracuse/poulecl/geometriesyr16/distrib/geometriesyr1... + +% To compile: % (pdf)latex repere-doc.tex % mpost repere-doc.mp % mpost repere-doc.mp @@ -11,9 +14,12 @@ \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{textcomp} + \usepackage{mathtools} \usepackage{geometry} \geometry{twoside,hmargin=2cm,vmargin={1.5cm,1.8cm},includefoot} + + \usepackage[bottom]{footmisc} \usepackage{mflogo} @@ -51,7 +57,8 @@ \lstset{columns=flexible,% language=MetaPost,% showstringspaces=false,% - basicstyle=\ttfamily} + basicstyle=\ttfamily, + literate={é}{{\'e}}1} \usepackage{babel} @@ -219,7 +226,7 @@ \title{Documentation de \texttt{repere.mp}} \date{\today} \author{Olivier \textsc{Péault}% -\footnote{E-mail : \href{mailto:o.peault@gmail.com}{\texttt{o.peault@gmail.com}}}} +\footnote{E-mail : \href{mailto:o.peault@posteo.net}{\texttt{o.peault@posteo.net}}}} \maketitle \setcounter{tocdepth}{2} @@ -233,7 +240,6 @@ \begin{codecache} input geometriesyr16; -input latexmp; input repere; \end{codecache} @@ -241,12 +247,12 @@ \section{Utilisation du fichier} Les macros du fichier \verb+repere.mp+ ont pour but de simplifier la création de figures dans un repère du plan avec \MP{}. L'idée de départ est de coller le plus possibles aux besoins de l'enseignement secondaire de mathématiques. -Il est possible d'utiliser \verb+repere+ et \verb+geometriesyr+ (les macros de Christophe \textsc{Poulain} pour la géométrie disponibles à l'adresse \url{http://melusine.eu.org/syracuse/poulecl/macros/}) dans une même figure comme le montrent les exemples page \pageref{exgeom}. +Il est possible d'utiliser \verb+repere+ et \verb+geometriesyr+ (les macros de Christophe \textsc{Poulain} pour la géométrie disponibles à l'adresse \url{http://melusine.eu.org/syracuse/poulecl/macros/}) dans une même figure comme le montre l'exemple page \pageref{exgeom}. -Le fichier \verb+repere.mp+ doit être placé dans un répertoire accessible à \MP{} (Par ex. le répertoire \verb+metapost+ du \verb+texmf+ local). De plus, la ligne \verb+input repere;+ doit apparaître dans le document contenant les figures. +Le fichier \verb+repere.mp+ doit être placé dans un répertoire accessible à \MP{} (Par ex. le répertoire \verb+metapost+ du \verb+texmf+). De plus, la ligne \verb+input repere;+ doit apparaître dans le document contenant les figures. -Certaines des étiquettes (noms de points, de courbes, de vecteurs...) sont composées automatiquement au format \LaTeX{} mais la compilation peut devenir assez longue pour un nombre important de figures car un fichier est créé et compilé automatiquement par \MP{} pour chaque étiquette. Il est alors possible d'utiliser le fichier \verb+latexmp.mp+ à condition de placer l'instruction \verb+input latexmp;+ avant l'instruction \verb+input repere;+. Attention, utiliser \verb+latexmp.mp+ oblige à compiler deux fois les documents. +Les étiquettes (noms de points, de courbes, de vecteurs...) sont composées automatiquement au format \LaTeX{} avec le package \verb+latexmp.mp+. Il est donc nécessaire de compiler deux fois les documents. \section{Repère utilisateur} @@ -325,8 +331,6 @@ \end{description} -Les axes sont dessinés, gradués et étiquetés par défaut sur toute la longueur du repère utilisateur. Pour des valeurs différentes on peut utiliser les macros suivantes : - \begin{exemple} @@ -362,6 +366,9 @@ fin; \end{exemple} + + + \subsubsection{Réglages des axes} Les axes sont dessinés, gradués et étiquetés par défaut sur toute la longueur du repère utilisateur. Pour des valeurs différentes on peut utiliser les macros suivantes : @@ -438,6 +445,8 @@ \begin{description} \item[axexpart.pos(x1,lab1,x2,lab2,...)] graduation et étiquetage partiels de l'axe des abscisses pour les valeurs \verb+x1+, \verb+x2+... et les étiquettes \verb+lab1+, \verb+lab2+... à la position \verb+pos+. Si \verb+pos+ est omis, les étiquettes sont placées à la position \verb+bot+. Les étiquettes peuvent être soit des chaînes de caractères ("aa", "bonjour"), soit des expressions du type \verb+btex $\pi$ etex+ (ou \verb|LaTeX("$\pi$")| voir page \pageref{latex}), soit d'autres figures. Si \verb+labn+ est omis, la valeur de \verb+xn+ sera utilisée comme étiquette. Pour obtenir une graduation sans étiquette, on peut utiliser la chaîne vide \verb+""+. +On peut désactiver le dessin de la graduation en donnant la valeur \verb|false| à \verb|boolgradxpart|. + \item[axeypart.pos(y1,lab1,y2,lab2,...)] même chose sur l'axe des ordonnées. Si \verb+pos+ est omis, les étiquettes sont placées à la position \verb+lft+. \end{description} @@ -560,12 +569,15 @@ fin; \end{exemple} + + + \section{Points, vecteurs} \subsection{Points} \label{points} \begin{description} -\item[\_c(x,y)] désigne le point (ou le vecteur) de coordonnées cartésiennes \verb+x+ et \verb+y+ dans le repère utilisateur. +\item[(x,y)] désigne le point (ou le vecteur) de coordonnées cartésiennes \verb+x+ et \verb+y+ dans le repère utilisateur. \item[pol(r,t)] désigne le point (ou le vecteur) de coordonnées $(r\cos t;r\sin t)$ dans le repère utilisateur. @@ -587,8 +599,8 @@ \begin{exemple}[0.6] repere(-3,3,0.9cm,-2.5,5,0.9cm); pair A,B,C[],D,E,F; -A=_c(1,1);B=_c(2,3); -D=_c(-2,-1);E=_c(-1,-1);F=_c(-1,-2); +A=(1,1);B=(2,3); +D=(-2,-1);E=(-1,-1);F=(-1,-2); draw axes(1,0); marque_p:="";drawoptions(withcolor magenta); nomme.llft(A);nomme.top(B);draw A--B; @@ -596,16 +608,19 @@ pointe(D,E,F); marque_p:="creux";drawoptions(withcolor orange); nomme.bot(pol(sqrt(2),-pi/4), - LaTeX("$\sqrt{2}e^{-i\frac{\pi}{4}}$")); -nomme.bot(_c(-1.5,1),LaTeX("$(-1,5;1)$")); + "$\sqrt{2}e^{-i\frac{\pi}{4}}$"); +nomme.bot((-1.5,1),"$(-1,5;1)$"); marque_p:="plein";drawoptions(withcolor violet); for i=2 upto 4: - C[i]=_c(-3+i/2,i);nomme.lft(C[i]); + C[i]=(-3+i/2,i);nomme.lft(C[i]); endfor draw cadre; fin; \end{exemple} + + + \subsection{Vecteurs} \begin{description} \item[vecteur.pos(A,u,nom)] figure formée du représentant du vecteur \verb+u+ d'origine \verb+A+ ainsi que de \verb+nom+ placé à la position \verb+pos+ par rapport au milieu de la flèche. Si \verb+nom+ est une chaine de caractère, il sera affiché avec une flèche. Si \verb+nom+ est omis, \verb+u+ surmonté d'une flèche est utilisé. S'il s'agit d'un élément d'un tableau de points (\verb+u1+, \verb+u2+...), le nombre est affiché en indice. @@ -615,8 +630,8 @@ \begin{exemple}[0.6] repere(-1,5.5,0.7cm,-4,4,0.8cm); pair A,B,C[],u,v,w[]; -u=_c(2,2);v=_c(2,-1); -A=_c(1,1);B=A+u; +u=(2,2);v=(2,-1); +A=(1,1);B=A+u; draw axes(1,0); draw base(O,i,j); drawoptions(withcolor cyan); @@ -627,7 +642,7 @@ LaTeX("$\vect{u}+\vect{v}$")); drawoptions(withcolor marine); for i=1 upto 3: - C[i]=_c(1,i-4);w[i]=_c(1.5,0.5*i-1); + C[i]=(1,i-4);w[i]=(1.5,0.5*i-1); draw vecteur.bot(C[i],w[i]); endfor draw cadre; @@ -635,6 +650,7 @@ \end{exemple} + \section{Droites, courbes...} \subsection{Droites} @@ -652,7 +668,7 @@ \begin{exemple}[0.65] repere(-2,3,1cm,-2,3,1cm); pair A,B; -A=_c(-0.5,-1);B=_c(1.5,1.5); +A=(-0.5,-1);B=(1.5,1.5); draw axes(1,0); nomme.ulft(A); nomme.lrt(B); @@ -669,9 +685,13 @@ \verb|vardef f(expr x)=2x+1 enddef;|) et de définir des courbes passant par des points donnés (\verb+A..B..C+). Ces possibilités sont utilisées dans les macros qui suivent. \begin{description} -\item[courbefonc(f,xmin,xmax,n) ou courbefonc(f)(xmin,xmax,n)] courbe représentant la fonction \verb+f+ entre \verb+xmin+ et \verb+xmax+ en utilisant \verb+n+ points d'interpolation. +\item[courbefonc(f)()] courbe représentant la fonction $f$ sur l'intervalle définissant le repère. -\item[courbepoints(f,xmin,xmax,n)] ne trace que les \verb+n+ points sans les relier. Les points sont dessinés en fonction de la valeur de \verb+marque_p+ (voir \ref{points}). +\item[courbefonc(f)(xmin,xmax)] courbe représentant la fonction $f$ sur l'intervalle $[xmin;xmax]$. + +\item[courbefonc(f)(xmin,xmax,n)] courbe représentant la fonction $f$ sur l'intervalle $[xmin;xmax]$ en utilisant \verb+n+ points d'interpolation. La valeur par défaut de \verb|n| est 60. + +\item[courbepoints(f)(xmin,xmax,n)] ne trace que les \verb+n+ points sans les relier. Les points sont dessinés en fonction de la valeur de \verb+marque_p+ (voir \ref{points}). \item[fonccourbe.p(x)] image de \verb+x+ par la fonction dont la courbe représentative est le chemin \verb+p+. La macro renvoie 0 si la fonction n'est pas définie. @@ -686,11 +706,11 @@ path C_f; draw axes(1,1); drawoptions(withcolor moutarde); -C_f=courbefonc(f)(-2,5,50); +C_f= courbefonc(f)(); draw C_f withpen pencircle scaled 1; nomme.llft(C_f,4.7); drawoptions(withcolor beige); -draw courbepoints(g,0,4,9); +draw courbepoints(g)(0,4,9); fin; \end{exemple} @@ -708,10 +728,10 @@ path p,C_f; pair I[],A[]; vardef f(expr x)= x**2-2x enddef; -p=_c(-2,-2).._c(-1,1).._c(0,2).._c(1,1) - .._c(2,-2).._c(3,-3).._c(3.5,-2.5) - .._c(4,-1); -C_f=courbefonc(f,-2,4,40); +p=(-2,-2)..(-1,1)..(0,2)..(1,1) + ..(2,-2)..(3,-3)..(3.5,-2.5) + ..(4,-1); +C_f= courbefonc(f)(-2,2.5); draw axes(1,1); drawoptions(withpen pencircle scaled 1); draw p withcolor bleu; @@ -729,7 +749,7 @@ \begin{description} \item[marquepointcourbe(p,x1,x2,...)] marque les points de la courbe \verb+p+ d'abscisses \verb+x1+, \verb+x2+... La marque dépend de la valeur de \verb+marque_p+. -\item[marquepointchemin(p,n1,n2,...)] dans le cas d'un chemin défini par \verb+A..B..C..+, marque le \verb+n1+ème point, le \verb+n2+ième point... La marque dépend de la valeur de \verb+marque_p+. Attention, le premier point est numéroté 0. +\item[marquepointchemin(p,n1,n2,...)] dans le cas d'un chemin défini par \verb+A..B..C..+, marque le \verb+n1+-ième point, le \verb+n2+-ième point... La marque dépend de la valeur de \verb+marque_p+. Attention, le premier point est numéroté 0. \end{description} @@ -740,10 +760,10 @@ path p,C_f; pair I[],A[]; vardef f(expr x)= x**2-2x enddef; -p=_c(-2,-2).._c(-1,1).._c(0,2) - .._c(1,1).._c(2,-2).._c(3,-3) - .._c(3.5,-2.5).._c(4,-1); -C_f=courbefonc(f,-2,4,40); +p=(-2,-2)..(-1,1)..(0,2) + ..(1,1)..(2,-2)..(3,-3) + ..(3.5,-2.5)..(4,-1); +C_f= courbefonc(f)(-2,3); draw axes(1,1); drawoptions(withpen pencircle scaled 1); draw p withcolor bleu; @@ -755,6 +775,45 @@ \end{exemple} +\subsection{Nommage automatique des courbes} +\begin{description} +\item[nomme(p,nom)] affiche \verb|nom| au niveau d'un point d'intersection de \verb|p| et du contour de la figure. Ce point est choisi en fonction de la chaine \verb|prefnomme| qui peut prendre les valeurs \verb|"right"| (valeur par défaut), \verb|"left"|, \verb|"top"| ou \verb|"bottom"|. +\end{description} + +\begin{exemple} +prefnomme:="left"; + +repere(-5,5,0.7cm,-5,5,0.7cm); +path d,C_f; +d=droite(-1,3); +vardef f(expr x)=0.5(x**2)-x -4 enddef; +C_f=courbefonc(f)(); +draw axes(1,1); +draw d epaisseur 1 couleur bleu; +draw C_f epaisseur 1 couleur bleu; +nomme(d,"$d_2$") couleur bleu; +nomme(C_f) couleur bleu; +draw cadre; +fin; +\end{exemple} + +\begin{exemple} +prefnomme:="bottom"; + +repere(-5,5,0.7cm,-5,5,0.7cm); +path d,C_f; +d=droite(-1,3); +vardef f(expr x)=0.5(x**2)-x -4 enddef; +C_f=courbefonc(f)(); +draw axes(1,1); +draw d epaisseur 1 couleur bleu; +draw C_f epaisseur 1 couleur bleu; +nomme(d,"$d_2$") couleur bleu; +nomme(C_f) couleur bleu; +draw cadre; +fin; +\end{exemple} + \subsection{Dérivée et tangentes} \begin{description} \item[der.p(x)] image de \verb+x+ par la dérivée de la fonction dont la courbe représentative est \verb+p+. @@ -773,16 +832,16 @@ \begin{exemple} repere(-2.5,4.5,1cm,-3.5,2.5,1cm); path p,q; -p=_c(-2,-2){dir 60}.._c(-1,1) - .._c(0,2){right}.._c(1,1).._c(2,-2) - .._c(3,-3){right}.._c(4,-2){(1,2)}; -q=courbefonc(der.p,-1,4,40); +p=(-2,-2){dir 60}..(-1,1) + ..(0,2){right}..(1,1)..(2,-2) + ..(3,-3){right}..(4,-2){(1,2)}; +q= courbefonc(der.p)(-1,4); draw axes(1,1); drawoptions(withpen pencircle scaled 1); draw p withcolor bleu; -nomme.rt(p,0.7,LaTeX("$y=f(x)$")); +nomme.rt(p,0.7,"$y=f(x)$"); draw q withcolor rouge; -nomme.lft(q,3.7,LaTeX("$y=f'(x)$")); +nomme.lft(q,3.7,"$y=f'(x)$"); drawoptions(withpen pencircle scaled 1 withcolor violet); draw tangente.double(p,0); @@ -823,7 +882,7 @@ repere(-2,4.5,1cm,-1,4,1cm); vardef f(expr x)=sqrt(2*x+4) enddef; path C_f,sr; -C_f=courbefonc(f,-2,5,50); +C_f= courbefonc(f)(); sr=suiterec(f,0,3,-1.2); draw axes(1,0); drawoptions(withpen pencircle scaled 1); @@ -840,7 +899,7 @@ repere(-0.5,5,1cm,-0.5,5,1cm); vardef f(expr x)=4-0.8*x enddef; path C_f,sr; -C_f=courbefonc(f,-1,5,10); +C_f= courbefonc(f)(); sr=suiterec(f,0,5,0.2); draw axes(1,0); drawoptions(withpen pencircle scaled 1); @@ -858,7 +917,6 @@ - \section{Surfaces} \subsection{Calcul intégral} @@ -874,8 +932,8 @@ vardef f(expr x)= -(x/4)**3+0.75x enddef; vardef g(expr x)= -((x-2)**2)/9+4 enddef; path C_f,C_g,p,q; -C_f:=courbefonc(f,-3.5,6,40); -C_g:=courbefonc(g,-3.5,6,40); +C_f:= courbefonc(f)(); +C_g:= courbefonc(g)(); p:=entrecourbes(C_f,C_g,-2,1); q:=souscourbe(C_f,3,5); fill p withcolor 0.5Violet; @@ -902,7 +960,7 @@ -((x-2)**4)/32+((x-2)**2)/2+1 enddef; path Cf,r[]; -Cf=courbefonc(f,-2.5,6.5,50); +Cf= courbefonc(f)(); r1=rectangles.max(Cf,2,5.5,8); r2=rectangles.min(Cf,2,5.5,8); r3=rectangles.droite(Cf,-2,1,10); @@ -947,50 +1005,7 @@ fin; \end{exemple} -\subsection{Remplissage} -Pour remplir des chemins fermés avec autre chose que de la couleur, \verb+repere+ permet l'utilisation de la syntaxe \verb+fill p avec motif+ où \verb+motif+ est un des motifs décrits ci-dessous. Cette instruction peut être complétée par des options de dessin (\verb+withpen+, \verb+withcolor+...). - -\begin{description} -\item[hachures(pas,angle)] hachures espacées de \verb+pas+ et formant un angle en degrés de \verb+angle+ avec l'horizontale. Si les valeurs sont omises, \verb|pas| vaut 5 et \verb+angle+ vaut 60. - - -\item[briques(larg,haut,dec)] briques de largeur \verb+larg+, de hauteur \verb+haut+ et décalées d'une ligne à l'autre de \verb+dec+. Si les valeurs sont omises, \verb|larg| vaut 12, \verb|haut| vaut 6 et \verb+dec+ vaut 6. - -\item[vagues(per,amp,dec)] (d'après le manuel de l'utilisateur) \og vagues \fg{} de période \verb+per+, d'amplitude \verb+amp+ et décalées d'une ligne à l'autre de \verb+dec+. Si les valeurs sont omises, \verb|per| vaut 20, \verb|amp| vaut 3 et \verb+dec+ vaut 10. -\end{description} - - - -\begin{exemple}[0.55] -repere(-1.5,4.5,1cm,-1.5,7.5,1cm); -path c[];picture lab;numeric u;u:=3cm; -c1=fullcircle scaled 2.5cm; -for k=1 upto 6: - i:=(k-1) mod 2;j:=(k-1) div 2; - c[k]:=c1 shifted (u*i,u*j); -endfor; -fill c1 withcolor lime; -fill c1 avec hachures(10,30) dashed evenly; -fill c2 withcolor lime; -fill c2 avec hachures(); -fill c3 withcolor (0,0.65,0.8,0.48); -fill c3 avec briques(15,5,4); -fill c4 withcolor (0,0.65,0.8,0.48); -fill c4 avec briques(); -fill c5 withcolor (1,0,0,0.2); -fill c5 avec vagues(30,10,20) - withpen pencircle scaled 2; -fill c6 withcolor (1,0,0,0.2); -fill c6 avec vagues(); -for k=1 upto 6: - i:=(k-1) mod 2;j:=(k-1) div 2; - draw c[k]; - lab:=thelabel("c"&decimal(k),u*(i,j)); - unfill bbox lab;draw lab; -endfor; -fin; -\end{exemple} @@ -1015,15 +1030,14 @@ repere(-1.5,3.5,1cm,-2.2,2.5,1cm); path Cf; pair A[]; vardef f(expr x)= x**2-2x-0.5 enddef; -Cf=courbefonc(f,-2,4,40); +Cf= courbefonc(f)(); ptantecedents(A,2,Cf); draw axes(1,1); draw Cf withpen pencircle scaled 1 withcolor bleu; drawoptions(dashed evenly withcolor rouge); -draw projectionaxes(_c(1.3,f(1.3)), - LaTeX("$x$"),LaTeX("$f(x)$")); -draw projectionx.urt(A1,LaTeX("$x_1$")); -draw projectionx.llft(A2,LaTeX("$x_2$"),-6); +draw projectionaxes((1.3,f(1.3)),"$x$","$f(x)$"); +draw projectionx.urt(A1,"$x_1$"); +draw projectionx.llft(A2,"$x_2$",-6); draw A1--A2; fin; \end{exemple} @@ -1040,23 +1054,23 @@ repere(-1,5,0.9cm,-1,4.5,1cm); vardef f(expr x)=x**2-5x+7 enddef; draw axes(1,1); -draw courbefonc(f,-1,5,50) +draw courbefonc(f)() withpen pencircle scaled 1 withcolor bleu; drawoptions(dashed evenly withcolor rouge); -draw projectionx.bot(_c(1,f(1))); -draw projectiony.llft(_c(2.5,f(2.5)),"0,75"); -draw projectionaxes(_c(4,f(4))); +draw projectionx.bot((1,f(1))); +draw projectiony.llft((2.5,f(2.5)),"0,75"); +draw projectionaxes((4,f(4))); drawoptions(withcolor violet); draw intervallex.OF(1,4); draw intervalley.FF(0.75,3); -label(LaTeX("$f(]1;4])=[0,75;3]$"),_c(2.5,4)); +label("$f(]1;4])=[0,75;3]$",(2.5,4)); draw cadre; fin; \end{exemple} -\section{Statistiques} +\section{Statistiques et probabilités} \subsection{Boite à moustache} \begin{description} @@ -1086,27 +1100,322 @@ draw projboitemoustache.bot(1) dashed evenly; drawoptions(withcolor blue); draw boitemoustache(0,3.14,6,8,10,2cm,0.7cm); - draw projboitemoustache.bot(0.00456,"$\pi$","$\num{2x3}$","$x$","Max") - dashed evenly; + draw projboitemoustache.bot(0.0456,"$\pi$","$\num{2x3}$","$x$","Max") dashed evenly; fin; \end{exemplev} + +\subsection{Diagrammes} +\begin{description} +\item[diagrammebatons((v1,e1),(v2,e2),...(vn,en))] Figure formée des \verb|n| segments joignant les points \verb|(v1,e1),(v2,e2),...(vn,en)| et leur projeté sur l'axe des abscisses. Les bâtons sont surmontés d'un point dont le diamètre est égal à la largeur des segments multiplié par \verb|diampointsbatons|. \verb|diampointsbatons| est égal à 5 par défaut. On peut lui donner la valeur 0 pour ne pas avoir ces points. +\end{description} + +\begin{exemple}[0.6] +repere(-0.5,5,1cm,-0.5,5,1cm); + picture diag; + draw axes(1,1); + diag:=diagrammebatons((1,2),(2,4),(3,2),(4,1)); + draw diag epaisseur 2 withcolor rouge; +fin +\end{exemple} + + +\begin{description} +\item[diagrammebarres((a1,h1),(a2,h2),...(an,hn))] Figure formée de \verb|n| barres rectangulaires de hauteurs \verb|h1| \dots \verb|hn| aux abscisses \verb|a1| \dots \verb|an|. La largeur de ces barres est le nombre \verb|largbarres| qui vaut \verb|20bp| par défaut. +\end{description} + +\begin{exemple}[0.6] +repere(-0.5,5,1cm,-0.5,5,1cm); + path diag; + draw axey(1,1); + diag:=diagrammebarres((1,2),(2,4),(3,2),(4,1)); + fill diag withcolor cyan; + draw diag epaisseur 1 withcolor marine; + flecheaxe:=false; + draw axex(0,0); + boolgradxpart:=false; + draw axexpart.bot(1,"A",2,"B",3,"C",4,"D"); +fin +\end{exemple} + +\subsection{Probabilités} + +Quelques fonctions mathématiques sont proposées. Pour les grandes valeurs, on dépasse rapidement les capacités de \MP. Il est dans ce cas conseillé de compiler en utilisant la ligne de commande \verb|mpost -numbersystem="decimal" <fichier>.mp|. + + +\begin{description} +\item[factorielle(n)] Entier égal à $n!$. +\item[binom(n,k)] Entier égal à $\binom{n}{k}$. +\item[binomiale(n,p,k)] $P(X=k)$ pour $X$ suivant la loi binomiale de paramètres $n$ et $p$. +\item[diagrammebinomiale(n,p)] Diagramme en bâtons de la loi binomiale de paramètres $n$ et $p$. +\item[diagrammeuniforme(n,m)] Diagramme en bâtons de la loi uniforme discrète sur les entiers consécutifs de \verb|n| à \verb|m|. +\item[diagrammegeometrique(p)] Diagramme en bâtons de la loi géométrique de paramètre \verb|p|. +\item[diagrammepoisson(lambda)] Diagramme en bâtons de la loi de Poisson de moyenne \verb|lambda|. +\end{description} + + +\begin{exemple} +repere(-2,16,0.45cm,-0.1,0.25,15cm); +setall(0,16,0,0.25); +draw axex(1,1); +draw axey(0.1,0.1); +picture diag; +diampointsbatons:=0; +diag:=diagrammebinomiale(15,0.6); +draw diag withcolor vertfonce epaisseur 4; +fin; +\end{exemple} + +\begin{codecache} +diampointsbatons:=5; +\end{codecache} + +\begin{exemple} +repere.larg(-2,10,8cm,-0.1,0.5,6cm); + setall(0,10,0,0.5); + draw axex(1,1); + draw axey(0.05,0.05); + draw diagrammegeometrique(0.4) + epaisseur 2 couleur bleu; +fin; +\end{exemple} + +\begin{exemple} +repere(-2,16,0.45cm,-0.1,0.25,15cm); +setall(0,16,0,0.25); +draw axex(1,1); +draw axey(0.1,0.1); +picture diag; +diampointsbatons:=0; +diag:=diagrammepoisson(6); +draw diag withcolor orange epaisseur 4; +fin; +\end{exemple} + +\begin{description} +\item[densitenormale(mu,sigma,a,b)] Courbe représentant la densité de la loi normale de moyenne \verb|mu| et d'écart type \verb|sigma| entre \verb|a| et \verb|b|. Si \verb|a| et \verb|b| sont omis, le tracé est fait sur l'intervalle définissant le repère. +\item[densiteexponentielle(lambda)] Courbe représentant la densité de la loi normale de paramètre \verb|lambda|. +\end{description} + +\begin{codecache} +prefnomme:="top"; +\end{codecache} + +\begin{exemple}[0.45] +repere(-4,32,0.23cm,-0.01,0.12,46cm); + draw axex(2,2); + draw axey(0.02,0.02); + path C,d; + C=densitenormale(16,4); + fill souscourbe(C,0,14) couleur gris; + draw souscourbe(C,0,14); + draw C epaisseur 2 couleur rouge; + d=droite(16); + draw d dashed evenly; + drawarrow (5,0.06)--(11,0.02); + label.top("$P(X\leq 14)$",(5,0.06)); + nomme(d,"$\mu$"); +fin; +\end{exemple} + +\begin{exemple} +repere.larg(-1,9,8cm,-0.05,0.6,6cm); + setall(0,9,0,0.6); + draw axex(1,1); + draw axey(0.1,0.1); + path C,D; + C=densiteexponentielle(0.5); + D=densiteexponentielle(0.3); + draw C epaisseur 2 couleur rouge; + draw D epaisseur 2 couleur violet; +fin; +\end{exemple} + + +\section{Géométrie} +Certaines des macros suivantes sont largement inspirées des macros de \verb|geometriesyr16.mp| de Christophe \bsc{Poulain}. + +\subsection{Polygones} +\begin{description} +\item[polygone(A,B,C,...)] Chemin fermé représentant le polygone $ABC...$ + +\item[triangle(A,B,C)] Cas particulier du précédent. Chemin fermé représentant le triangle $ABC$. + +\item[parallélogramme(A,B,C)] Chemin fermé représentant $ABCD$ où $D$ est le quatrième point du parallélogramme. + +\item[polygoneregulier(A,B,n)] Chemin fermé représentant le polygone régulier de sens direct à $n$ côtés dont un des côtés est $[AB]$. + +\item[equilateral(A,B)] Cas particulier du précédent. Triangle équilatéral de sens direct de côté $[AB]$. + +\item[carre(A,B)] Autre cas particulier. Carré de sens direct de côté $[AB]$. + +\item[sommetpolygoneregulier(A,B,n,i)] Sommet numéro $i$ du polygone régulier à $n$ côtés dont un des côtés est $[AB]$. $A$ est le sommet numéro 1 et $B$ est le sommet numéro 2. +\end{description} + +\begin{exemple}[0.51] +repere(-1,5,1cm,-1,4,1cm); +draw axes(1,1); +pair A,B,C,D,E,F,G; +A=(0,1);B=(2,0);C=(4,2);D=(3,3);E=(1,3); +F=(4,0);G=(3,2); +fill triangle(A,F,G) withcolor orange; +draw triangle(A,F,G); +draw polygone(A,B,C,D,E); +draw parallelogramme(D,G,E) withcolor vert; +fin; +\end{exemple} + + +\begin{exemple}[0.53] +repere(-1,5,1cm,-1,4,1cm); +draw axes(1,1); +pair A,B,M; +A=(1,1);B=(3,0.5); +fill polygoneregulier(A,B,5) withcolor bleu; +fill equilateral(A,B) withcolor cyan; +draw polygoneregulier(A,B,5); +M=sommetpolygoneregulier(A,B,5,3); +nomme.rt(M); +draw equilateral(A,B); +fin; +\end{exemple} + +\subsection{Cercles et arcs} + +\begin{description} +\item[cercle(A,B,C)] Cercle circonscrit au triangle $ABC$. +\item[cercle(O,A)] Cercle de centre $O$ passant par $A$. +\item[cercle(O,r)] Cercle de centre $O$ et de rayon $r$. L'unité de longueur est l'unité de l'axe des abscisses. +\item[arccercle(A,O,B)] Arc de cercle de sens direct de centre $O$, passant par $A$ et s'appuyant sur la demi-droite $[OB)$. +\end{description} + + +\begin{exemple} +repere(-1,5,1cm,-0.5,4,1cm); +draw axes(1,1); +pair A,B,C; +A=(1,1);B=(2,0);C=(3.5,2); +nomme.lft(A);nomme.urt(C);nomme.top(B); +draw triangle(A,B,C) withcolor bleu; +draw cercle(A,B,C) withcolor marine; +draw A--B withcolor rouge epaisseur 1; +draw cercle(A,B) withcolor rouge; +fin; +\end{exemple} + + +\begin{exemple} +repere(-1,5,1cm,-2,8,0.5cm); +draw axes(1,1); +pair A,M,B; +A=(2,2);M=(2,6);B=(3,2); +nomme.bot(A);nomme.rt(B);nomme.top(M); +draw B--A--M; +draw cercle(A,2); +draw arccercle(B,A,M); +fin; +\end{exemple} + + + +\subsection{Codage des segments et des angles} + +\begin{description} +\item[marqueangle(A,O,B,n)] Figure formée de \verb|n| arcs de cercle de centre $O$ et de rayon moyen \verb|taille_marque_a| (qui vaut par défaut \verb|0.4cm|) permettant de marquer l'angle géométrique $\widehat{AOB}$. Les arcs son séparés de \verb|sep_marque_a| qui vaut par défaut \verb|1.5|. + +Il s'agit d'un chemin fermé qui peut donc être rempli. + +\item[marqueangle(A,O,B)] Arc de cercle de centre \verb|O| et de rayon \verb|taille_marque_a| permettant de marquer l'angle orienté avec \verb|drawarrow|. + +\item[nomme.pos(A,O,B,texte)] Place le texte entre \verb|A| et \verb|B|, à une distance \verb|taille_marque_a| du centre, à la position \verb|pos|. +\end{description} + + +\begin{exemple} +repere(-2,12,0.4cm,-2,10,0.4cm); +pair A,B,C; +A=(1,2);B=(11,2);C=(8,9); +draw axes(0,0); +draw triangle(A,B,C); +nomme.llft(A);nomme.lrt(B);nomme.top(C); +fill marqueangle(C,B,A,3) withcolor red; +draw marqueangle(C,B,A,3); +drawarrow marqueangle(A,C,B); +fill marqueangle(B,A,C,1) withcolor vert; +draw marqueangle(B,A,C,1); +nomme.rt(B,A,C,"\ang{45}"); +fin; +\end{exemple} + +\begin{description} +\item[marqueangledroit(A,O,B)] Chemin fermé permettant de marquer l'angle droit $\widehat{AOB}$ sous forme d'un losange (il s'agit donc d'un carré si l'angle est réellement droit). Le côté du losange est \verb|taille_marque_ad| et vaut \verb|0.3cm| par défaut. +\item[marquesegment(A,B,n)] Figure formées de \verb|n| marques sur le segment $[AB]$. Ces marques ont une taille de \verb|taille_marque_s| (\verb|0.3cm| par défaut), forment un angle en degrés de \verb|angle_marque_s| avec le segment (\verb|60| par défaut) et sont séparées de \verb|sep_marque_s| (\verb|2| par défaut). +\end{description} + +\begin{exemple}[0.6] +repere(-1,10,0.5cm,-1,9,0.5cm); +pair A,B,C,A',B',C',u; +A=(3,1);B=(5,2);C=(1,5);u=(3,3); +A'-A=B'-B=C'-C=u; +draw projectionaxes(A,"$x_A$","$y_A$") dashed evenly; +draw axes(0,0); +drawoptions(withcolor pourpre); +draw triangle(A,B,C);draw triangle(A',B',C'); +draw marqueangledroit(B,A,C); +draw marqueangledroit(B',A',C'); +draw marquesegment(B,C,2); +draw marquesegment(B',C',2); +nomme.llft(A);nomme.lrt(B);nomme.ulft(C); +nomme.llft(A');nomme.lrt(B');nomme.ulft(C'); +drawoptions(withcolor vertfonce); +draw vecteur.lrt(B,u);draw vecteur.lrt(C,u); +fin; +\end{exemple}% + \section{Divers} \subsection{Composition des étiquettes} -Tous les textes et étiquettes peuvent être composés en utilisant la macro ci-dessous. Cette macro utilise \verb+latexmp+ si ce fichier est chargé ou l'écriture dans un fichier externe (adaptation de la macro \verb+TEX+) dans le cas contraire. +Tous les textes et étiquettes peuvent être composés en utilisant la macro ci-dessous. \begin{description} - \item[LaTeX(ch)] \label{latex} Figure formée de la chaîne \verb+ch+ composée avec \LaTeX. Il est donc possible d'utiliser la macro \verb|decimal()| de \MP. + \item[LaTeX(ch)] \label{latex} Figure formée de la chaîne \verb+ch+ composée avec \LaTeX{} et mise à l'échelle \verb|defaultscale|. Cette macro utilise la commande \verb|textext| de \verb|luamplib| dans le cas de l'utilsation de Lua\LaTeX{} et \verb|textext| de \verb|latexmp| dans le cas d'une compilation \MP{} \og standard \fg. Ce dernier cas nécessite alors deux compilations. \end{description} \begin{exemple}[0.65] repere(-1,7,1cm,-1,1,1cm); for i=2 upto 6: -label(LaTeX("$\frac{1}{"&decimal(i)&"}$"),(i*cm,0)); +label(LaTeX("$\frac{1}{"&decimal(i)&"}$"),(i,0)); endfor fin; \end{exemple} +\begin{description} +\item[label.pos(fig,point)] Commande de \MP{} qui permet de placer la figure \verb|fig| au niveau du point \verb|point|. +\end{description} + +\begin{exemple}[0.55] +repere(-1,5,1cm,-1,4,1cm); +draw axes(1,1); +label.ulft("Abscisses",(5,0.1)); +label.lrt("Ordonnées",(0.1,4)); +label("$f(x)=\pi^2\sqrt{x}$",(2,2)); +fin; +\end{exemple} + +\begin{description} +\item[legende.pos(fig,p)] Figure formée du chemin \verb|p| dessiné avec une flèche et de la figure ou de la chaine \verb|fig| située à la position \verb|pos| par rapport au premier point du chemin. +\end{description} + +\begin{exemple}[0.6] +repere(-0.5,5,1cm,-0.5,4,1cm); + draw axes(1,1); + pair A,B; + A=(2,1);B=(2,2); + nomme.rt(A) couleur rouge; + nomme.top(B) couleur rouge; + legende.top("Le point $A$",(1,3){down}..{down}A); + legende.bot("Le point $B$",(4,1)--B); +fin; +\end{exemple} \subsection{Couleurs} Certaines couleurs sont définies par leur nom et peuvent être utilisées directement : @@ -1117,11 +1426,11 @@ path rectangle; save a,b,dech,decv; a:=25;b:=12;dech:=70;decv:=-20; - rectangle = (0,0)--(a,0)--(a,b)--(0,b)--cycle; + rectangle = ((0,0)--(a,0)--(a,b)--(0,b)--cycle) transformed inverse _T; vardef couleur(expr t)= image(% fill rectangle withcolor scantokens(t); - label.rt(LaTeX("\smash{" & t & "}"),(a,b/4)) + label.rt(LaTeX("\smash{" & t & "}"),(a,b/4) transformed inverse _T) ) enddef; draw couleur("rouge"); @@ -1151,6 +1460,54 @@ Toutes ces couleurs sont définies selon le modèle \og rgb \fg. Pour les obtenir selon le modèle \og cmyk \fg, remplacer la première lettre par une majuscule. + +\subsection{Remplissage} +Pour remplir des chemins fermés avec autre chose que de la couleur, \verb+repere+ permet l'utilisation de la syntaxe \verb+fill p avec motif+ où \verb+motif+ est un des motifs décrits ci-dessous. Cette instruction peut être complétée par des options de dessin (\verb+withpen+, \verb+withcolor+...). + +\begin{description} +\item[hachures(pas,angle)] hachures espacées de \verb+pas+ et formant un angle en degrés de \verb+angle+ avec l'horizontale. Si les valeurs sont omises, \verb|pas| vaut 5 et \verb+angle+ vaut 60. + + +\item[briques(larg,haut,dec)] briques de largeur \verb+larg+, de hauteur \verb+haut+ et décalées d'une ligne à l'autre de \verb+dec+. Si les valeurs sont omises, \verb|larg| vaut 12, \verb|haut| vaut 6 et \verb+dec+ vaut 6. + + +\item[vagues(per,amp,dec)] (d'après le manuel de l'utilisateur) \og vagues \fg{} de période \verb+per+, d'amplitude \verb+amp+ et décalées d'une ligne à l'autre de \verb+dec+. Si les valeurs sont omises, \verb|per| vaut 20, \verb|amp| vaut 3 et \verb+dec+ vaut 10. +\end{description} + + + +\begin{exemple}[0.55] +repere(-1.5,4.5,1cm,-1.5,7.5,1cm); +path c[];picture lab; +c1=fullcircle scaled 2.5; +for k=1 upto 6: + i:=(k-1) mod 2;j:=(k-1) div 2; + c[k]:=c1 shifted (3*i,3*j); +endfor; +fill c1 withcolor lime; +fill c1 avec hachures(10,30) dashed evenly; +fill c2 withcolor lime; +fill c2 avec hachures(); +fill c3 withcolor (0,0.65,0.8,0.48); +fill c3 avec briques(15,5,4); +fill c4 withcolor (0,0.65,0.8,0.48); +fill c4 avec briques(); +fill c5 withcolor (1,0,0,0.2); +fill c5 avec vagues(30,10,20) + withpen pencircle scaled 2; +fill c6 withcolor (1,0,0,0.2); +fill c6 avec vagues(); +for k=1 upto 6: + i:=(k-1) mod 2;j:=(k-1) div 2; + draw c[k]; + lab:=thelabel("c"&decimal(k),3*(i,j)); + unfill bbox lab;draw lab; +endfor; +fin; +\end{exemple} + + + \subsection{Figures pour une présentation} \begin{description} \item[figureinter] exporte la figure telle qu'elle est au moment où cette commande apparait. La numérotation est incrémentée et la figure peut continuer. @@ -1161,12 +1518,12 @@ repere(-3,3,0.7cm,-1,5,0.7cm); path C_f; vardef f(expr x)=x**2 enddef; - C_f=courbefonc(f,-3,3,50); + C_f= courbefonc(f)(); draw quadrillage(1,1); draw axes(1,1); draw cadre; figureinter; - draw courbepoints(f,-2,2,9) withcolor rouge; + draw courbepoints(f)(-2,2,9) withcolor rouge; figureinter; draw C_f withcolor bleu withpen pencircle scaled 1; fin; @@ -1193,6 +1550,9 @@ \end{minipage} \end{center} + + + \subsection{Code embarqué dans un document \LaTeX} Certains packages permettent d'écrire du code \MP{} directement dans un document \LaTeX. \verb|repere| est compatible avec, entre autres, \verb|emp| et \verb|mpgraphics|. @@ -1223,13 +1583,12 @@ \begin{document} \begin{empfile} \begin{empcmds} - input latexmp; input repere; \end{empcmds} \begin{emp}(0,0) - repere(-3,3,0.8cm,-2.5,2.5,1cm); - draw axes(1,1); - fin; + repere(-3,3,1cm,-2,2,1cm); + draw axes(1,1); + fin; \end{emp} \end{empfile} \end{document} @@ -1247,41 +1606,77 @@ \usepackage[runs=2]{mpgraphics} \begin{document} \begin{mpdefs} - input latexmp; input repere; \end{mpdefs} \begin{mpdisplay} - repere(-3,3,0.8cm,-2.5,2.5,1cm); - draw axes(1,1); - fin; + repere(-3,3,1cm,-2,2,1cm); + draw axes(1,1); + fin; \end{mpdisplay} \end{document} \end{lstlisting} \end{minipage} -\section{Exemples d'utilisation simultanée de \texttt{repere} et \texttt{geometriesyr}} +Il est aussi possible d'utiliser Lua\LaTeX{} avex le package \verb|luamplib|. Il faut alors charger les packages \verb|siunitx| et \verb|esvect| utilisés par \verb|repere|. -\label{exgeom}Il est possible, dans une figure créée avec \verb+repere+, d'utiliser certaines macros de \verb+geometriesyr+. Il faut alors charger \verb+geometriesyr+ \emph{avant} \verb|repere|. +\begin{center} +\begin{minipage}[t]{0.5\linewidth} +{\centering \textbf{Utilisation de Lua\LaTeX}\par} -\begin{exemple}[0.6] -repere(-1,10,0.5cm,-1,9,0.5cm); -pair A,B,C,A',B',C',u; -A=_c(3,1);B=_c(5,2);C=_c(1,5);u=_c(3,3); -A'-A=B'-B=C'-C=u; -draw projectionaxes(A,LaTeX("$x_A$"), - LaTeX("$y_A$")) dashed evenly; -draw axes(0,0); -drawoptions(withcolor pourpre); -draw triangle(A,B,C);draw triangle(A',B',C'); -draw codeperp(B,A,C,7);draw codeperp(B',A',C',7); -draw codesegments(B,C,B',C',2); -nomme.llft(A);nomme.lrt(B);nomme.ulft(C); -nomme.llft(A');nomme.lrt(B');nomme.ulft(C'); + +\verb|lualatex monfichier.tex| + +\begin{lstlisting}[frame=single,frameround=tttt,backgroundcolor=\color{LightSteelBlue},language={[LaTeX]TeX}] +\documentclass{article} +\usepackage{fontspec} +\usepackage{siunitx} +\usepackage{esvect} +\usepackage{luamplib} +\mplibnumbersystem{double} % Si nécessaire +\begin{document} +\everymplib{input repere;} +\begin{mplibcode} + repere(-3,3,1cm,-2,2,1cm); + draw axes(1,1); +fin; +\end{mplibcode} +\end{document} +\end{lstlisting} +\end{minipage} +\end{center} + +\section{Dessin à main levée avec \texttt{geometriesyr}} + +\label{exgeom}Il est possible, dans une figure créée avec \verb+repere+, d'utiliser le \og dessin à main levée \fg{} de \verb+geometriesyr+. Il faut alors charger \verb+geometriesyr+ \emph{avant} \verb|repere| et utiliser les fonctions de dessin telles que \verb|cercles|, \verb|triangle|... + +\begin{exemple} +repere(-0.5,5,1cm,-0.5,5,1cm); +pair A,B,C,D; +A=(0.5,0.5);B=(4,1);C=(3,4); +typetrace:="mainlevee"; +draw axes(1,1); +drawoptions(withcolor violet); +draw triangle(A,B,C); +nomme.llft(A);nomme.lrt(B); +nomme.top(C); +draw marqueangle(B,A,C,1); drawoptions(withcolor vertfonce); -draw vecteur.lrt(B,u);draw vecteur.lrt(C,u); +draw cercles(CentreCercleC(A,B,C),A); fin; -\end{exemple}% +\end{exemple} + + + +\begin{codecache} +end +\end{codecache} + +\makeatletter +\immediate\closeout\verbatim@out +\makeatother +\end{document} + \vspace{2em} @@ -1357,7 +1752,6 @@ \makeatletter \immediate\closeout\verbatim@out \makeatother -%\addtocontents{toc}{\protect\end{multicols}} \end{document} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/repere.doc.tlpobj new/tlpkg/tlpobj/repere.doc.tlpobj --- old/tlpkg/tlpobj/repere.doc.tlpobj 2016-04-14 19:44:52.000000000 +0200 +++ new/tlpkg/tlpobj/repere.doc.tlpobj 2017-05-12 02:07:16.000000000 +0200 @@ -1,9 +1,9 @@ name repere.doc category Package -revision 32455 +revision 44298 shortdesc doc files of repere relocated 1 -docfiles size=165 - RELOC/doc/metapost/repere/README +docfiles size=179 + RELOC/doc/metapost/repere/README.md RELOC/doc/metapost/repere/repere-doc.pdf RELOC/doc/metapost/repere/repere-doc.tex ++++++ repere.tar.xz ++++++ ++++ 1904 lines of diff (skipped) ++++++ repltext.doc.tar.xz ++++++ ++++++ repltext.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/repltext.tlpobj new/tlpkg/tlpobj/repltext.tlpobj --- old/tlpkg/tlpobj/repltext.tlpobj 2016-04-14 19:44:52.000000000 +0200 +++ new/tlpkg/tlpobj/repltext.tlpobj 2017-04-14 17:59:50.000000000 +0200 @@ -10,7 +10,7 @@ runfiles size=1 RELOC/tex/latex/repltext/repltext.sty catalogue-ctan /macros/latex/contrib/repltext -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics pdf-feat catalogue-version 1.0 ++++++ resphilosophica.doc.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/resphilosophica/Makefile new/doc/latex/resphilosophica/Makefile --- old/doc/latex/resphilosophica/Makefile 2015-08-23 23:43:54.000000000 +0200 +++ new/doc/latex/resphilosophica/Makefile 2017-03-28 22:37:59.000000000 +0200 @@ -3,7 +3,7 @@ # # This file is in public domain # -# $Id: Makefile,v 1.9 2015/01/16 17:56:02 boris Exp $ +# $Id: Makefile,v 1.10 2017/03/28 16:39:12 boris Exp $ # PACKAGE=resphilosophica diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/resphilosophica/README new/doc/latex/resphilosophica/README --- old/doc/latex/resphilosophica/README 2015-11-16 00:38:50.000000000 +0100 +++ new/doc/latex/resphilosophica/README 2017-03-28 22:37:59.000000000 +0200 @@ -7,6 +7,12 @@ Changes + version 1.31 Changed formatting of doi according to the new rules + + version 1.30 Allowed URLs to be split on hyphens + + version 1.29 Added \manuscriptid and used it to form doi + version 1.28 Commands enquote and ensquote work correctly in the case of embedded quotations Binary files old/doc/latex/resphilosophica/resphilosophica.pdf and new/doc/latex/resphilosophica/resphilosophica.pdf differ Binary files old/doc/latex/resphilosophica/rpsample.pdf and new/doc/latex/resphilosophica/rpsample.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/latex/resphilosophica/rpsample.tex new/doc/latex/resphilosophica/rpsample.tex --- old/doc/latex/resphilosophica/rpsample.tex 2015-11-16 00:38:50.000000000 +0100 +++ new/doc/latex/resphilosophica/rpsample.tex 2016-12-17 22:01:05.000000000 +0100 @@ -14,6 +14,7 @@ \publicationmonth[Jan--Feb]{January--February} \papernumber{2} \onlinedate{January 1 2013} +\manuscriptid{A31245} %\doinumber{} \paperUrl{http://borisv.lk.net/paper12} \author{Boris Veytsman} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/resphilosophica.doc.tlpobj new/tlpkg/tlpobj/resphilosophica.doc.tlpobj --- old/tlpkg/tlpobj/resphilosophica.doc.tlpobj 2016-04-14 19:44:53.000000000 +0200 +++ new/tlpkg/tlpobj/resphilosophica.doc.tlpobj 2017-04-14 17:59:50.000000000 +0200 @@ -1,6 +1,6 @@ name resphilosophica.doc category Package -revision 38862 +revision 43631 shortdesc doc files of resphilosophica relocated 1 docfiles size=139 ++++++ resphilosophica.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bibtex/bst/resphilosophica/resphilosophica.bst new/bibtex/bst/resphilosophica/resphilosophica.bst --- old/bibtex/bst/resphilosophica/resphilosophica.bst 2015-11-16 00:38:50.000000000 +0100 +++ new/bibtex/bst/resphilosophica/resphilosophica.bst 2017-03-28 22:37:59.000000000 +0200 @@ -1738,7 +1738,7 @@ write$ newline$ "\providecommand{\urlprefix}{}" write$ newline$ - "\providecommand{\doi}[1]{\url{http://dx.doi.org/#1}}" + "\providecommand{\doi}[1]{\url{https://doi.org/#1}}" write$ newline$ "\makeatletter\newif\if@suppresscomma\@suppresscommafalse" write$ newline$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tex/latex/resphilosophica/resphilosophica.cls new/tex/latex/resphilosophica/resphilosophica.cls --- old/tex/latex/resphilosophica/resphilosophica.cls 2015-11-16 00:38:50.000000000 +0100 +++ new/tex/latex/resphilosophica/resphilosophica.cls 2017-03-28 22:37:59.000000000 +0200 @@ -22,7 +22,7 @@ %% in the same archive or directory.) \NeedsTeXFormat{LaTeX2e} \ProvidesClass{resphilosophica} -[2015/11/14 v1.28 Typesetting articles for Res Philosophica] +[2017/03/28 v1.31 Typesetting articles for Res Philosophica] \RequirePackage{xkeyval} \newif\ifRESP@fontauto \RESP@fontautotrue @@ -75,6 +75,7 @@ \LoadClass[noamsfonts,twoside]{amsart} \RequirePackage{microtype, fancyhdr, xcolor, lastpage, collect} \RequirePackage[bottom,multiple]{footmisc} +\PassOptionsToPackage{hyphens}{url} \RequirePackage[hyperfootnotes=false]{hyperref} \urlstyle{rm} \ifRESP@manuscript\hypersetup{colorlinks,allcolors=blue}\else @@ -209,8 +210,14 @@ \publicationmonth{} \def\papernumber#1{\def\currentpaper{#1}} \papernumber{0000} +\def\manuscriptid#1{\gdef\@manuscriptid{#1}} +\manuscriptid{} \def\doinumber#1{\gdef\@doinumber{#1}} -\doinumber{10.11612/resphil.\currentyear.\currentvolume.\currentissue.\currentpaper} +\doinumber{\ifx\@manuscriptid\@empty + 10.11612/resphil.\currentyear.\currentvolume.\currentissue.\currentpaper + \else + 10.11612/resphil.\@manuscriptid + \fi} \def\paperUrl#1{\gdef\@paperUrl{#1}} \paperUrl{} \def\startpage#1{\pagenumbering{arabic}\setcounter{page}{#1}% @@ -525,7 +532,7 @@ \def\Hy@endcolorlink{\endgroup}% \color{#1}##1\egroup}}% \fi} -\def\doi#1{\url{http://dx.doi.org/#1}} +\def\doi#1{\url{https://doi.org/#1}} \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} \def\@makefntext{\noindent\@makefnmark \if@enddoc\else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/resphilosophica.tlpobj new/tlpkg/tlpobj/resphilosophica.tlpobj --- old/tlpkg/tlpobj/resphilosophica.tlpobj 2016-04-14 19:44:53.000000000 +0200 +++ new/tlpkg/tlpobj/resphilosophica.tlpobj 2017-04-14 17:59:50.000000000 +0200 @@ -1,6 +1,6 @@ name resphilosophica category Package -revision 38862 +revision 43631 shortdesc Typeset articles for the journal Res Philosophica relocated 1 longdesc The bundle provides a class for typesetting articles for the @@ -10,7 +10,7 @@ RELOC/bibtex/bst/resphilosophica/resphilosophica.bst RELOC/tex/latex/resphilosophica/resphilosophica.cls catalogue-ctan /macros/latex/contrib/resphilosophica -catalogue-date 2015-11-15 07:10:16 +0100 +catalogue-date 2017-03-28 20:59:52 +0200 catalogue-license lppl1.3 catalogue-topics journalpub class -catalogue-version 1.28 +catalogue-version 1.31 ++++++ resumecls.doc.tar.xz ++++++ ++++++ resumecls.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/resumecls.tlpobj new/tlpkg/tlpobj/resumecls.tlpobj --- old/tlpkg/tlpobj/resumecls.tlpobj 2016-04-14 19:44:53.000000000 +0200 +++ new/tlpkg/tlpobj/resumecls.tlpobj 2017-04-14 17:59:50.000000000 +0200 @@ -8,7 +8,7 @@ runfiles size=1 RELOC/tex/xelatex/resumecls/resumecls.cls catalogue-ctan /macros/xetex/latex/resumecls -catalogue-date 2015-09-20 22:08:14 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics cv chinese class catalogue-version 0.3.2 ++++++ resumemac.doc.tar.xz ++++++ ++++++ resumemac.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/resumemac.tlpobj new/tlpkg/tlpobj/resumemac.tlpobj --- old/tlpkg/tlpobj/resumemac.tlpobj 2016-04-14 19:44:53.000000000 +0200 +++ new/tlpkg/tlpobj/resumemac.tlpobj 2017-04-14 17:59:50.000000000 +0200 @@ -8,6 +8,6 @@ runfiles size=2 RELOC/tex/plain/resumemac/resumemac.tex catalogue-ctan /macros/plain/contrib/resumemac -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license pd catalogue-topics cv plain-ext ++++++ reverxii.doc.tar.xz ++++++ ++++++ revtex.doc.tar.xz ++++++ ++++++ revtex.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/revtex.tlpobj new/tlpkg/tlpobj/revtex.tlpobj --- old/tlpkg/tlpobj/revtex.tlpobj 2016-04-14 19:44:59.000000000 +0200 +++ new/tlpkg/tlpobj/revtex.tlpobj 2017-04-14 17:59:52.000000000 +0200 @@ -28,7 +28,7 @@ RELOC/tex/latex/revtex/revtex4-1.cls catalogue-also revtex4-0 catalogue-ctan /macros/latex/contrib/revtex -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics physics journalpub catalogue-version 4.1r ++++++ revtex4.doc.tar.xz ++++++ ++++++ revtex4.tar.xz ++++++ ++++++ ribbonproofs.doc.tar.xz ++++++ ++++++ ribbonproofs.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/ribbonproofs.tlpobj new/tlpkg/tlpobj/ribbonproofs.tlpobj --- old/tlpkg/tlpobj/ribbonproofs.tlpobj 2016-04-14 19:45:02.000000000 +0200 +++ new/tlpkg/tlpobj/ribbonproofs.tlpobj 2017-04-14 17:59:53.000000000 +0200 @@ -11,7 +11,7 @@ runfiles size=14 RELOC/tex/latex/ribbonproofs/ribbonproofs.sty catalogue-ctan /macros/latex/contrib/ribbonproofs -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.3 catalogue-topics proof catalogue-version 1.0 ++++++ rjlparshap.doc.tar.xz ++++++ ++++++ rjlparshap.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tlpkg/tlpobj/rjlparshap.tlpobj new/tlpkg/tlpobj/rjlparshap.tlpobj --- old/tlpkg/tlpobj/rjlparshap.tlpobj 2016-04-14 19:45:03.000000000 +0200 +++ new/tlpkg/tlpobj/rjlparshap.tlpobj 2017-04-14 17:59:54.000000000 +0200 @@ -10,7 +10,7 @@ runfiles size=2 RELOC/tex/latex/rjlparshap/rjlpshap.sty catalogue-ctan /macros/latex/contrib/rjlparshap -catalogue-date 2015-08-03 05:43:12 +0200 +catalogue-date 2016-06-24 19:18:15 +0200 catalogue-license lppl1.2 catalogue-topics micro-layout catalogue-version 1.0