texlive[43752] Master: minidocument (11apr17)

commits+karl at tug.org commits+karl at tug.org
Tue Apr 11 23:15:05 CEST 2017


Revision: 43752
          http://tug.org/svn/texlive?view=revision&revision=43752
Author:   karl
Date:     2017-04-11 23:15:04 +0200 (Tue, 11 Apr 2017)
Log Message:
-----------
minidocument (11apr17)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/minidocument/
    trunk/Master/texmf-dist/doc/latex/minidocument/Makefile
    trunk/Master/texmf-dist/doc/latex/minidocument/README
    trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf
    trunk/Master/texmf-dist/source/latex/minidocument/
    trunk/Master/texmf-dist/source/latex/minidocument/minidocument.dtx
    trunk/Master/texmf-dist/source/latex/minidocument/minidocument.ins
    trunk/Master/texmf-dist/tex/latex/minidocument/
    trunk/Master/texmf-dist/tex/latex/minidocument/minidocument.sty
    trunk/Master/tlpkg/tlpsrc/minidocument.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/minidocument/Makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/minidocument/Makefile	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/minidocument/Makefile	2017-04-11 21:15:04 UTC (rev 43752)
@@ -0,0 +1,33 @@
+
+PACKAGE := minidocument
+
+TEXMFDIST:=$(shell kpsewhich -var-value TEXMFDIST)
+
+all: sty doc
+
+sty: $(PACKAGE).sty
+$(PACKAGE).sty: $(PACKAGE).dtx $(PACKAGE).ins
+	pdflatex ${PACKAGE}.ins
+
+doc: $(PACKAGE).pdf
+$(PACKAGE).pdf: $(PACKAGE).dtx
+	pdflatex ${PACKAGE}.dtx
+	makeindex -s gind.ist -o $(PACKAGE).ind $(PACKAGE).idx
+	makeindex -s gglo.ist -o $(PACKAGE).gls $(PACKAGE).glo
+	pdflatex ${PACKAGE}.dtx
+	pdflatex ${PACKAGE}.dtx
+
+install: $(PACKAGE).dtx $(PACKAGE).ins $(PACKAGE).sty README $(PACKAGE).pdf
+	install -m 755 -d $(TEXMFDIST)/source/latex/$(PACKAGE)
+	install -m 644 -t $(TEXMFDIST)/source/latex/$(PACKAGE) $(PACKAGE).dtx
+	install -m 644 -t $(TEXMFDIST)/source/latex/$(PACKAGE) $(PACKAGE).ins
+	install -m 755 -d $(TEXMFDIST)/tex/latex/$(PACKAGE)
+	install -m 644 -t $(TEXMFDIST)/tex/latex/$(PACKAGE) $(PACKAGE).sty
+	install -m 755 -d $(TEXMFDIST)/doc/latex/$(PACKAGE)
+	install -m 644 -t $(TEXMFDIST)/doc/latex/$(PACKAGE) README
+	install -m 644 -t $(TEXMFDIST)/doc/latex/$(PACKAGE) $(PACKAGE).pdf
+
+dist: $(PACKAGE).tar.gz
+$(PACKAGE).tar.gz: Makefile README $(PACKAGE).dtx $(PACKAGE).ins $(PACKAGE).pdf
+	tar -cjf $@ --transform "s#^#$(PACKAGE)/#" $^
+


Property changes on: trunk/Master/texmf-dist/doc/latex/minidocument/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/minidocument/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/minidocument/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/minidocument/README	2017-04-11 21:15:04 UTC (rev 43752)
@@ -0,0 +1,24 @@
+
+minidocument
+------------
+
+The minidocument package is used to create miniature documents inside
+other documents.
+
+Copyright 2017	Maurice Leclaire <leclaire at in.tum.de>
+
+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 `author-maintained'.
+
+This work consists of the files minidocument.dtx and minidocument.ins
+and the derived file minidocument.sty.
+


Property changes on: trunk/Master/texmf-dist/doc/latex/minidocument/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf	2017-04-11 21:13:38 UTC (rev 43751)
+++ trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf	2017-04-11 21:15:04 UTC (rev 43752)

Property changes on: trunk/Master/texmf-dist/doc/latex/minidocument/minidocument.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/minidocument/minidocument.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/minidocument/minidocument.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/minidocument/minidocument.dtx	2017-04-11 21:15:04 UTC (rev 43752)
@@ -0,0 +1,305 @@
+% \iffalse meta-comment
+%
+% Copyright 2017	Maurice Leclaire <leclaire at in.tum.de>
+%
+% 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 `author-maintained'.
+%
+% This work consists of the files minidocument.dtx and minidocument.ins
+% and the derived file minidocument.sty.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{minidocument}[2017/04/11 v1.0 Mini Documents]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\CheckSum{109}
+\usepackage{minidocument}
+\usepackage{blindtext}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+\DocInput{minidocument.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v1.0}{2017/01/26}{Initial version}
+%
+% \GetFileInfo{minidocument.sty}
+%
+% %\DoNotIndex{\def,\let,\global,\long,\expandafter}
+% %\DoNotIndex{\csname,\endcsname,\advance,\string}
+% %\DoNotIndex{\if,\else,\fi,\ifdim,\ifodd,\ifvoid,\ifcsname,\@ifnextchar}
+% %\DoNotIndex{\chardef,\count,\dimen,\skip,\box,\setbox,\lastbox,\copy}
+% %\DoNotIndex{\hbox,\vbox,\unhbox,\unvbox,\hskip,\vskip,\hss,\hrule,\vfill}
+% %\DoNotIndex{\the,\ht,\dp,\@ne,\z@,\maxdimen}
+%
+% \title{The \textsf{minidocument} package}
+% \author{Maurice Leclaire\\\texttt{leclaire at in.tum.de}}
+% \date{\fileversion\ -- \filedate}
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{minidocument} package is used to create miniature documents inside
+% other documents as can be seen in Figure~\ref{fig:example}.
+% \end{abstract}
+%
+% \begin{minidocument}
+% \def\minidocumentscale{0.25}
+% \title{The \textsf{minidocument} package}
+% \author{Maurice Leclaire\\\texttt{leclaire at in.tum.de}}
+% \date{\fileversion\ -- \filedate}
+% \maketitle
+% \Blindtext
+% \end{minidocument}
+%
+% \begin{figure}[!htb]
+% \begin{center}
+% \lastminidocument
+% \end{center}
+% \caption{A minidocument example}
+% \label{fig:example}
+% \end{figure}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \DescribeEnv{minidocument}
+% A minidocument is created with the \verb|minidocument| environment.
+% The \verb|page| counter is set to one at the beginning of a minidocument and
+% restored afterwards.
+% It is important, that this environment is placed in outer vertical mode.
+% Otherwise, it will not work properly.
+% However, it is of course possible to place the resulting minidocument
+% everywhere. Therefore, the environment itself does not output anything. The
+% example minidocument in Figure~\ref{fig:example} is defined as:
+% \begin{quote}
+% \begin{verbatim}
+%\begin{minidocument}
+%    \maketitle
+%    \Blindtext
+%\end{minidocument}
+% \end{verbatim}
+% \end{quote}
+%
+% \noindent
+% \DescribeMacro{\lastminidocument}
+% To output the minidocument, the command \verb|\lastminidocument| is used,
+% e.\,g.:
+% \begin{quote}
+% \begin{verbatim}
+%\begin{figure}
+%    \lastminidocument
+%\end{figure}
+% \end{verbatim}
+% \end{quote}
+%
+% \noindent
+% \DescribeMacro{\minidocumentscale}
+% By default, the minidocument is scaled down with \verb|\minidocumentscale|,
+% which defaults to 0.333. This can be changed with e.\,g.
+% \begin{quote}
+% \verb|\def\minidocumentscale{0.25}|
+% \end{quote}
+% as it is done in this documentation.
+%
+% \noindent
+% \DescribeMacro{\minidocumentshipout}
+% The macro \verb|\minidocumentshipout| is called for every page in the
+% minidocument. It takes a single argument containing the page and is
+% responsible for postprocessing it. It can be redefined to obtain a different
+% look. The default is defined as
+% \begin{quote}
+% \verb|\scalebox{\minidocumentscale}{\frame{#1}}|
+% \end{quote}
+%
+% \StopEventually{
+%     \begin{thebibliography}{1}
+%         \raggedright
+%         \bibitem{atbegshi}
+%         Heiko Oberdiek.
+%         \newblock The \textsf{atbegshi} package.
+%         \newblock \textsc{ctan}: \url{http://ctan.org/pkg/atbegshi}
+%     \end{thebibliography}
+%     \PrintChanges
+%     \setcounter{IndexColumns}{2}
+%     \PrintIndex
+% }
+%
+% \section{Implementation}
+%
+% The \verb|graphics| package is required for \verb|\scalebox|.
+%    \begin{macrocode}
+\RequirePackage{graphics}
+%    \end{macrocode}
+%
+% \begin{macro}{\minidocument at box}
+% We allocate a box register for temporary storage.
+%    \begin{macrocode}
+\newbox\minidocument at box
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\minidocument at aggrbox}
+% The following box will aggregate the minidocument.
+%    \begin{macrocode}
+\newbox\minidocument at aggrbox
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\minidocument at hold}
+% This box is used to store the current vertical list when entering the
+% minidocument.
+%    \begin{macrocode}
+\newbox\minidocument at hold
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\minidocument at orig@output}
+% We need a token register to store the output routine.
+%    \begin{macrocode}
+\newtoks\minidocument at orig@output
+%    \end{macrocode}
+% \end{macro}
+%
+% \noindent
+% The following method of overloading the shipout procedure is borrowed from
+% the \textsf{atbegshi} package\cite{atbegshi} where it is explained in detail.
+% The problem we face here is that \verb|\shipout| can be called with many
+% different box specifications which can not be catched as macro arguments.
+% Therefore, we use \verb|\setbox| to get the box specification and
+% \verb|\afterassignment| to execute the code that handles the box. However,
+% for direct box specifications the code specified via \verb|\afterassignment|
+% is not executed after the box specification is finished but directly at the
+% beginning of the box. Therefore, we need an additional \verb|\aftergroup| in
+% the case of a direct box. We only have to determine if we are at the
+% beginning of a direct box. We can do this by inspecting \verb|\lastkern| as
+% it is zero at the beginning of a box.
+%
+% \begin{macro}{\minidocument at shipout}
+% This macro is the entry point of our shipout procedure. Inside a new group we
+% assign and start a new box with a specified kerning. This box is only
+% temporary and gives us a reliable environment. We install the
+% \verb|\afterassignment| hook and assign the passed box to a box register. This
+% assignment is global as it must survive the group while the temporary box
+% which is assigned to the same box register is lost.
+%    \begin{macrocode}
+\def\minidocument at shipout{%
+    \begingroup\setbox\minidocument at box\hbox\bgroup\kern\p@%
+    \afterassignment\minidocument at testshipout%
+    \global\setbox\minidocument at box%
+}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\minidocument at testshipout}
+% The following macro is called by \verb|\afterassignment|. It checks via
+% \verb|\lastkern| if it is called at the beginning of a box. In this case an
+% \verb|\aftergroup| is inserted. Either way, when the box is finished the next
+% macro is called.
+%    \begin{macrocode}
+\def\minidocument at testshipout{%
+    \ifdim\lastkern=\z@%
+        \expandafter\aftergroup%
+    \fi%
+    \minidocument at makeshipout%
+}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\minidocument at makeshipout}
+% This macro ends the temporary box and the group. We now have the passed box
+% in the box register. If the box register is not void, we do the virtual
+% shipout. Therefore, we position the box at the right place of a page.
+% Afterwards, we call \verb|\minidocumentshipout| to postprocess the page. We
+% then add the page to the aggregation box.
+%    \begin{macrocode}
+\def\minidocument at makeshipout{%
+    \egroup\endgroup%
+    \ifvoid\minidocument at box\else%
+        \global\setbox\minidocument at box\vbox to \paperheight {
+            \vskip1in%
+            \hbox to \paperwidth {
+                \hskip1in%
+                \box\minidocument at box%
+                \hfill
+            }%
+            \vfill
+        }%
+        \global\setbox\minidocument at aggrbox\hbox{\unhbox\minidocument at aggrbox%
+            \minidocumentshipout{\box\minidocument at box}%
+            \hskip0pt%
+        }%
+    \fi%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{minidocument}
+% The \verb|minidocument| environment first saves the current vertical list.
+% Therefore, the output routine is changed and a page break is enforced. Then,
+% the shipout procedure is switched and the page counter is set to one. At the
+% end of the environment, the shipout procedure and the page number are
+% restored. Afterwards, the saved vertical list is reinserted.
+%    \begin{macrocode}
+\newenvironment{minidocument}{%
+    \minidocument at orig@output\output%
+    \output{\global\setbox\minidocument at hold\box\@cclv}%
+    \penalty-\@Mi%
+    \output\minidocument at orig@output%
+    \let\minidocument at orig@shipout\shipout%
+    \let\shipout\minidocument at shipout%
+    \edef\minidocument at page{\the\c at page}%
+    \c at page\@ne%
+}{%
+    \clearpage%
+    \let\shipout\minidocument at orig@shipout%
+    \global\c at page\minidocument at page%
+    \unvbox\minidocument at hold%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lastminidocument}
+% The macro \verb|\lastminidocument| unboxes the aggregated minidocument so
+% that it can flow into the main document.
+%    \begin{macrocode}
+\def\lastminidocument{%
+    \unhbox\minidocument at aggrbox\unskip%
+}
+%    \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\minidocumentscale}
+% We set the default scale factor to $1/3$, so that two pages can fit next to
+% each other on a page with appropriate margins.
+%    \begin{macrocode}
+\def\minidocumentscale{0.333}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\minidocumentshipout}
+% The default \verb|\minidocumentshipout| draws a frame around the page and
+% scales the page with \verb|\minidocumentscale|.
+%    \begin{macrocode}
+\newcommand{\minidocumentshipout}[1]{%
+    \scalebox{\minidocumentscale}{\frame{#1}}%
+}
+%    \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+\endinput
+% \fi
+%
+% \Finale


Property changes on: trunk/Master/texmf-dist/source/latex/minidocument/minidocument.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/minidocument/minidocument.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/minidocument/minidocument.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/minidocument/minidocument.ins	2017-04-11 21:15:04 UTC (rev 43752)
@@ -0,0 +1,25 @@
+\input docstrip.tex
+\keepsilent
+\usedir{tex/latex/minidocument}
+\preamble
+
+Copyright 2017	Maurice Leclaire <leclaire at in.tum.de>
+
+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 `author-maintained'.
+
+This work consists of the files minidocument.dtx and minidocument.ins
+and the derived file minidocument.sty.
+
+\endpreamble
+\generate{\file{minidocument.sty}{\from{minidocument.dtx}{package}}}
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/minidocument/minidocument.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/minidocument/minidocument.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/minidocument/minidocument.sty	2017-04-11 21:15:04 UTC (rev 43752)
@@ -0,0 +1,87 @@
+%%
+%% This is file `minidocument.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% minidocument.dtx  (with options: `package')
+%% 
+%% Copyright 2017 Maurice Leclaire <leclaire at in.tum.de>
+%% 
+%% 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 `author-maintained'.
+%% 
+%% This work consists of the files minidocument.dtx and minidocument.ins
+%% and the derived file minidocument.sty.
+%% 
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{minidocument}[2017/04/11 v1.0 Mini Documents]
+\RequirePackage{graphics}
+\newbox\minidocument at box
+\newbox\minidocument at aggrbox
+\newbox\minidocument at hold
+\newtoks\minidocument at orig@output
+\def\minidocument at shipout{%
+    \begingroup\setbox\minidocument at box\hbox\bgroup\kern\p@%
+    \afterassignment\minidocument at testshipout%
+    \global\setbox\minidocument at box%
+}
+\def\minidocument at testshipout{%
+    \ifdim\lastkern=\z@%
+        \expandafter\aftergroup%
+    \fi%
+    \minidocument at makeshipout%
+}
+\def\minidocument at makeshipout{%
+    \egroup\endgroup%
+    \ifvoid\minidocument at box\else%
+        \global\setbox\minidocument at box\vbox to \paperheight {
+            \vskip1in%
+            \hbox to \paperwidth {
+                \hskip1in%
+                \box\minidocument at box%
+                \hfill
+            }%
+            \vfill
+        }%
+        \global\setbox\minidocument at aggrbox\hbox{\unhbox\minidocument at aggrbox%
+            \minidocumentshipout{\box\minidocument at box}%
+            \hskip0pt%
+        }%
+    \fi%
+}
+\newenvironment{minidocument}{%
+    \minidocument at orig@output\output%
+    \output{\global\setbox\minidocument at hold\box\@cclv}%
+    \penalty-\@Mi%
+    \output\minidocument at orig@output%
+    \let\minidocument at orig@shipout\shipout%
+    \let\shipout\minidocument at shipout%
+    \edef\minidocument at page{\the\c at page}%
+    \c at page\@ne%
+}{%
+    \clearpage%
+    \let\shipout\minidocument at orig@shipout%
+    \global\c at page\minidocument at page%
+    \unvbox\minidocument at hold%
+}
+\def\lastminidocument{%
+    \unhbox\minidocument at aggrbox\unskip%
+}
+
+\def\minidocumentscale{0.333}
+\newcommand{\minidocumentshipout}[1]{%
+    \scalebox{\minidocumentscale}{\frame{#1}}%
+}
+\endinput
+%%
+%% End of file `minidocument.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/minidocument/minidocument.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-04-11 21:13:38 UTC (rev 43751)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2017-04-11 21:15:04 UTC (rev 43752)
@@ -412,7 +412,8 @@
     mf2pt1 mfirstuc mflogo mflogo-font mfnfss mfpic mfpic4ode mftinc
     mgltex mhchem
     mhequ miama microtype microtype-de midnight midpage miller milog
-    minibox minifp minipage-marginpar miniplot minitoc minorrevision
+    minibox minidocument minifp minipage-marginpar
+    miniplot minitoc minorrevision
     minted mintspirit minutes missaali
     mkgrkindex mkjobtexmf mkpattern mkpic
     mla-paper mlist mmap mnotes mnras mnsymbol

Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2017-04-11 21:13:38 UTC (rev 43751)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc	2017-04-11 21:15:04 UTC (rev 43752)
@@ -649,6 +649,7 @@
 depend mftinc
 depend midpage
 depend minibox
+depend minidocument
 depend minifp
 depend minipage-marginpar
 depend minitoc

Added: trunk/Master/tlpkg/tlpsrc/minidocument.tlpsrc
===================================================================


More information about the tex-live-commits mailing list