texlive[41906] Master/texmf-dist: notespages (22aug16)
commits+karl at tug.org
commits+karl at tug.org
Tue Aug 23 00:31:57 CEST 2016
Revision: 41906
http://tug.org/svn/texlive?view=revision&revision=41906
Author: karl
Date: 2016-08-23 00:31:57 +0200 (Tue, 23 Aug 2016)
Log Message:
-----------
notespages (22aug16)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/notespages/README
trunk/Master/texmf-dist/doc/latex/notespages/notespages.pdf
trunk/Master/texmf-dist/doc/latex/notespages/np-test.pdf
trunk/Master/texmf-dist/doc/latex/notespages/np-test.tex
trunk/Master/texmf-dist/source/latex/notespages/notespages.dtx
trunk/Master/texmf-dist/tex/latex/notespages/notespages.sty
Modified: trunk/Master/texmf-dist/doc/latex/notespages/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notespages/README 2016-08-22 22:31:45 UTC (rev 41905)
+++ trunk/Master/texmf-dist/doc/latex/notespages/README 2016-08-22 22:31:57 UTC (rev 41906)
@@ -42,6 +42,7 @@
pdflatex notespages.dtx
pdflatex notespages.dtx
makeindex -s gind.ist notespages.idx
+makeindex -s gglo.ist -o notespages.gls notespages.glo
pdflatex notespages.dtx
Modified: trunk/Master/texmf-dist/doc/latex/notespages/notespages.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/notespages/np-test.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/notespages/np-test.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/notespages/np-test.tex 2016-08-22 22:31:45 UTC (rev 41905)
+++ trunk/Master/texmf-dist/doc/latex/notespages/np-test.tex 2016-08-22 22:31:57 UTC (rev 41906)
@@ -62,6 +62,7 @@
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usepackage{afterpage}
+\usepackage{eso-pic}
\usepackage{notespages}
%% CAUTION: do not use this with the class memoir
@@ -89,12 +90,11 @@
\nppatchchapter{default,vacant,multiple=2,
notestext={An empty page before a new chapter.}}
-%% this trick will only work after \nppatchchapter
%% this has to be used with classes article and scrartcl
-%%\let\secleveli\section
+%%\let\secleveli{\section}
%%\let\seclevelii\subsection
%% this has to be used with all other classes
-\let\secleveli\chapter
+\def\secleveli{\chapter}
\let\seclevelii\section
%%\tracingnpmarks1
@@ -109,7 +109,7 @@
\textsf{\textbf{\Large Example File}}\\[5ex]
Mike Kaufmann\\[2ex]
\href{mailto:m.km at gmx.de}{\texttt{m.km at gmx.de}}\\[2ex]
-2016/08/10 (v0.8)\\[10ex]
+2016/08/21 (v0.8.1)\\[10ex]
\textsf{\textbf{\LARGE Warning: do not print!}}\\[2ex]
You would waste over a hundred pages!
\vspace*{\fill}
@@ -125,6 +125,10 @@
latter will produce two pages, in order to fill up the document to a multiple
of 4 pages.
+Btw.: In the lower left corner of this page and the next three is a bit of text,
+put there with \textsf{eso-pic}, to check, if the bug from version 0.8 is gone.
+It's in yellow, so barely visible.
+
The commands are:
\begin{verbatim}
@@ -133,10 +137,16 @@
\notespages
\end{verbatim}
+%% testing eso-pic
+\AddToShipoutPictureBG{\AtPageLowerLeft{\makebox(0,0)[bl]{\textcolor{yellow}{eos-pic test}}}}
+
\notesfill
\notespage
\notespages
+%% testing eso-pic
+\ClearShipoutPictureBG
+
\seclevelii{The options \textsf{startnotes} and \textsf{allowfloats}}
To show the effect of these options, some text and a float, which doesn't fit on
this page, is needed. For the float the positioning \verb|[htb]| was used. After
@@ -848,6 +858,24 @@
apperance. And with \verb|multiple=2| there will be no more then one notes
page before a new chapter instead of up to three with the default value of 4.
+The command \verb|\nppatchchapter| can be used multiple times in a document,
+enabling the user to change the apperance of a notes page before a new chapter.
+The command is:
+
+\begin{verbatim}
+\nppatchchapter{default,vacant,multiple=2,
+ notestext={Another notes page\\
+ automatically inserted\\
+ before a new chapter.}}
+\end{verbatim}
+
+\nppatchchapter{default,vacant,multiple=2,
+ notestext={Another notes page\\
+ automatically inserted\\
+ before a new chapter.}}
+
+\fillit[1-3]
+
\secleveli{Colors and Languages}
\seclevelii{Colors}
The \textsf{NotesPages} package uses three colors.
@@ -944,7 +972,18 @@
\fillit[1-4]
-\seclevelii{The End}
+\seclevelii{The command \texttt{\textbackslash npunpatchchapter}}
+With \verb|\npunpatchchapter| the original meaning of \verb|\chapter| can be
+restored. After that, there may be the usual empty before a new chapter, as can
+be seen on the next page. The command:
+
+\begin{verbatim}
+\npunpatchchapter
+\end{verbatim}
+
+\npunpatchchapter
+
+\secleveli{The End}
Now this is the end of this example file. But I just can't resist to add one more
example:
\begin{verbatim}
Modified: trunk/Master/texmf-dist/source/latex/notespages/notespages.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/notespages/notespages.dtx 2016-08-22 22:31:45 UTC (rev 41905)
+++ trunk/Master/texmf-dist/source/latex/notespages/notespages.dtx 2016-08-22 22:31:57 UTC (rev 41906)
@@ -35,14 +35,14 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-% \CheckSum{1320}
+% \CheckSum{1360}
%
% \iffalse meta-comment
%
%<*package>
%%
-\def\fileversion{0.8}
-\def\filedate{2016/08/10}
+\def\fileversion{0.8.1}
+\def\filedate{2016/08/21}
%</package>
%
@@ -50,12 +50,12 @@
\documentclass{ltxdoc}
\usepackage{hypdoc}
\usepackage{graphicx}
-\hypersetup{pdfborder=0,colorlinks,linkcolor=blue}
+\hypersetup{colorlinks,linkcolor=blue}
\usepackage[all]{hypcap}
\setcounter{IndexColumns}{2}
\EnableCrossrefs
\CodelineIndex
-%\RecordChanges
+\RecordChanges
%\OnlyDescription
\makeatletter
% new, like ...Env... commands from doc.sty)
@@ -185,14 +185,15 @@
% \DoNotIndex{\unitlength,\unrestored at protected@xdef,\vfill,\vspace}
% \DoNotIndex{\xdef,\z@}
%
-% \changes{0.8}{2016/08/07}{initial release}
-%
% \newcommand{\NP}{\textsf{NotesPages}}
% \newcommand{\pkg}[1]{\textsf{#1}}
% \newcommand{\opt}[1]{\textsf{#1}}
% \newcommand{\choice}[1]{\textsf{\textsl{#1}}}
% \newcommand{\bs}{\textbackslash}
+% \newcommand{\since}[2][changed]{\marginpar{\hfill\textsf{\textit{\textcolor[rgb]{0,0.3,0}{#1 #2}}}}}
%
+% \changes{0.8}{2016/08/10}{initial release}
+%
% \title{The \NP\ Package\\[1ex]
% Filling documents, so the total number of pages is a multiple of a given number.}
% \author{Mike Kaufmann\\\href{mailto:m.km at gmx.de}{\texttt{m.km at gmx.de}}}
@@ -797,14 +798,26 @@
% be formated with the current settings (the defaults, the package options, or
% the last options set with |\setnotespages|).
%
+% \changes{0.8.1}{2016/08/21}{corrected manual section for \texttt{\bs nppatchchapter}}%
% This macro should not be used, if the class uses the option \opt{openany},
-% because it will suppress the effect of this class option. Packages redefining
-% |\chapter| must be loaded before |\nppatchchapter| is used, otherwise it may
-% not be effective.
+% because it will suppress the effect of this class option. Any\since{0.8.1}
+% redefinition of |\chapter|, either by loading a package or manually, must be
+% done before the \NP\ package is loaded, otherwise the redefinition and/or the
+% patching may not be effective.
%
+% The command can be used anywhere in the document and it can be used multiple
+% time. This way, the apperance of a notes page before a new chapter can be
+% changed where ever wanted.
+%
% The |\chapter| command is only patched, if it exists, so no errors will occur
% for a class without it.
%
+% \DescribeMacro\npunpatchchapter
+% \changes{0.8.1}{2016/08/21}{added \texttt{\bs npunpatchchapter}}%
+% With\since[added]{0.8.1} |\npunpatchchapter| the command |\chapter| is restored
+% to its original meaning, thus there will be no more notes pages before a new
+% chapter after issuing this command.
+%
% ^^A---------------------------------------------
% \subsection{Supporting Babel}
% \label{sec:babel}
@@ -922,8 +935,7 @@
% to the todo list. And of course, reported bugs will be added.
%
% ^^A--------------------------------------------------------------------------
-% \StopEventually{\newpage\PrintIndex}
-% ^^A \PrintChanges}
+% \StopEventually{\newpage\PrintIndex\PrintChanges}
%
% ^^A--------------------------------------------------------------------------
% \newpage
@@ -1183,6 +1195,21 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\ifnp at started@on at full@page}
+% \changes{0.8.1}{2016/08/21}{added for calculating the number of notes pages}%
+% \begin{macro}{\np at started@on at full@pagefalse}
+% \begin{macro}{\np at started@on at full@pagetrue}
+% In |\notespages| this boolean is set to true, if the current page is already
+% full. It is needed to calculate the number of pages to be inserted.
+% \since[~\\~\\\null\hfill added]{0.8.1}
+% \begin{macrocode}
+\newcommand*{\ifnp at started@on at full@page}{}
+\newif\ifnp at started@on at full@page
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
% ^^A-------------------------
% \subsubsection{``Variables'' for \texttt{\bs notesfill}}
% \begin{macro}{\np at fill@minspace}
@@ -2251,6 +2278,7 @@
%
% ^^A-------------------------
% \subsubsection{Text}
+% \label{sec:ns-text}
% \begin{macro}{\np at ns@text}
% This macro is used to produce the notes area for the \opt{notesstyle} \choice{text}.
% Since |\np at titleskip| is not inserted for |titlestyle=none|, it is inserted here to
@@ -2266,30 +2294,50 @@
\vspace*{\np at titleskip}%
\fi
\def\np at tempa{left}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=left}%
\raggedright
\else
\def\np at tempa{right}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=right}%
\raggedleft
\else
\def\np at tempa{center}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=center}%
\centering
\fi
\fi
\fi
- \color{NotesTextColor}\notesareatext}
% \end{macrocode}
+% \changes{0.8.1}{2016/08/21}{added \texttt{\bs par} to make alignement work again}%
+% The\since{0.8.1} |\par| had to be added, to make the alignement set with
+% \opt{notesalign} work again after the group was added in |\np at inner@notespage|
+% (see \autoref{sec:use-ns}).
+% \begin{macrocode}
+ \color{NotesTextColor}\notesareatext\par}
+% \end{macrocode}
% \end{macro}
%
% ^^A-------------------------
% \subsubsection{Using notes styles}
+% \label{sec:use-ns}
% \begin{macro}{\np at inner@notespage}
% This macro calls the command for the \opt{notesstyle} seclected. Before that,
% |\parfillskip| is set to avoid an |overfull hbox| error, in case some class
% or package set it to a different value (example: \pkg{KOMA-Script} classes with
% the option \opt{parskip}).
+%
+% \changes{0.8.1}{2016/08/21}{bug fixed regarding \texttt{\bs unitlength} and \pkg{eso-pic}}%
+% The\since{0.8.1} group around |\csname ...\endcsname| had to be added, because
+% otherwise packages like \pkg{eso-pic} (which uses a \textsf{picture} environment
+% to put something into the background of a page) will fail. The reason for the
+% latter is the |\newpage| at the end of |\np at notespage| (see \autoref{sec:build-np})
+% and the fact, that |\unitlength| would still be disabled at this point without
+% the group.
% \begin{macrocode}
\newcommand{\np at inner@notespage}{\parfillskip\z@ plus 1fil%
- \csname np at ns@\np at notesstyle\endcsname}
+ \begingroup
+ \csname np at ns@\np at notesstyle\endcsname
+ \endgroup}
% \end{macrocode}
% \end{macro}
%
@@ -2296,6 +2344,7 @@
% ^^A---------------------------------------------
% \subsection{User commands}
% \subsubsection{Building a notes page}
+% \label{sec:build-np}
% \begin{macro}{\np at notespage}
% This macro builds a single notes page. If \opt{allowfloats} is \choice{false}
% and \opt{startnotes} is \choice{newpage}, |\textfraction| is temporarily set to
@@ -2378,22 +2427,38 @@
% If started on a new page, set the boolean |\ifnp at started@on at new@page| to true,
% else to false.
% \begin{macrocode}
+%% \typeout{notespages debug:\space\the\pagetotal\space\the\pagegoal}%
\ifdim\pagetotal=\z@
\np at started@on at new@pagetrue\else\np at started@on at new@pagefalse\fi
% \end{macrocode}
+% \changes{0.8.1}{2016/08/21}{bug fixed for calculating the number of notes pages}%
+% If\since[added]{0.8.1} the |\pagetotal| is already greater or equal than |\pagegoal|,
+% the notes page will be shifted to a new page, but the calculation would be done
+% based on the current page number. For this, |\ifnp at started@on at full@page| is set.
+% \begin{macrocode}
+ \ifdim\pagetotal<\pagegoal
+ \np at started@on at full@pagefalse\else\np at started@on at full@pagetrue\fi
+% \end{macrocode}
% $n = p$, if(started on new page) $n = n - 1$
% \begin{macrocode}
\np at notepages\c at page
\ifnp at started@on at new@page\advance\np at notepages\m at ne\fi
% \end{macrocode}
+% This\since[added]{0.8.1} correction is needed in case |\notespages| started on
+% an already full page.
+% \begin{macrocode}
+ \ifnp at started@on at full@page\advance\np at notepages\@ne\fi
+% \end{macrocode}
% This is basically $n = d - (n \bmod d)$, but with a correction, if started on
-% a new page. This will lead to $n = d$ in case $n \bmod d = 0$, which is corrected
-% by not adding $d$ at the end.
+% a new page or an already full page.\since[added]{0.8.1} This will lead to
+% $n = d$ in case $n \bmod d = 0$, which is corrected by not adding $d$ at the
+% end.
% \begin{macrocode}
\divide\np at notepages\np at multiple
\multiply\np at notepages\np at multiple
\advance\np at notepages-\c at page
\ifnp at started@on at new@page\advance\np at notepages\@ne\fi
+ \ifnp at started@on at full@page\advance\np at notepages\m at ne\fi
\ifnum\np at notepages<\z@
\advance\np at notepages\np at multiple\fi
% \end{macrocode}
@@ -2549,6 +2614,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\npunpatchchapter}
+% \changes{0.8.1}{2016/08/21}{added command}%
+% This macros restores the original meaning of |\chapter|, which is only done,
+% if it exists.\since[added]{0.8.1}
+% \begin{macrocode}
+\newcommand{\npunpatchchapter}{%
+ \@ifundefined{chapter}{}{\let\chapter\np at orig@chapter}}
+% \end{macrocode}
+% \end{macro}
+%
% ^^A---------------------------------------------
% \subsection{Support for other packages}
% \subsubsection{Babel}
@@ -2702,6 +2777,7 @@
\usepackage[svgnames]{xcolor}
\usepackage{tikz}
\usepackage{afterpage}
+\usepackage{eso-pic}
\usepackage{notespages}
%% CAUTION: do not use this with the class memoir
@@ -2729,12 +2805,11 @@
\nppatchchapter{default,vacant,multiple=2,
notestext={An empty page before a new chapter.}}
-%% this trick will only work after \nppatchchapter
%% this has to be used with classes article and scrartcl
-%%\let\secleveli\section
+%%\let\secleveli{\section}
%%\let\seclevelii\subsection
%% this has to be used with all other classes
-\let\secleveli\chapter
+\def\secleveli{\chapter}
\let\seclevelii\section
%%\tracingnpmarks1
@@ -2749,7 +2824,7 @@
\textsf{\textbf{\Large Example File}}\\[5ex]
Mike Kaufmann\\[2ex]
\href{mailto:m.km at gmx.de}{\texttt{m.km at gmx.de}}\\[2ex]
-2016/08/10 (v0.8)\\[10ex]
+2016/08/21 (v0.8.1)\\[10ex]
\textsf{\textbf{\LARGE Warning: do not print!}}\\[2ex]
You would waste over a hundred pages!
\vspace*{\fill}
@@ -2765,6 +2840,10 @@
latter will produce two pages, in order to fill up the document to a multiple
of 4 pages.
+Btw.: In the lower left corner of this page and the next three is a bit of text,
+put there with \textsf{eso-pic}, to check, if the bug from version 0.8 is gone.
+It's in yellow, so barely visible.
+
The commands are:
\begin{verbatim}
@@ -2773,10 +2852,16 @@
\notespages
\end{verbatim}
+%% testing eso-pic
+\AddToShipoutPictureBG{\AtPageLowerLeft{\makebox(0,0)[bl]{\textcolor{yellow}{eos-pic test}}}}
+
\notesfill
\notespage
\notespages
+%% testing eso-pic
+\ClearShipoutPictureBG
+
\seclevelii{The options \textsf{startnotes} and \textsf{allowfloats}}
To show the effect of these options, some text and a float, which doesn't fit on
this page, is needed. For the float the positioning \verb|[htb]| was used. After
@@ -3488,6 +3573,24 @@
apperance. And with \verb|multiple=2| there will be no more then one notes
page before a new chapter instead of up to three with the default value of 4.
+The command \verb|\nppatchchapter| can be used multiple times in a document,
+enabling the user to change the apperance of a notes page before a new chapter.
+The command is:
+
+\begin{verbatim}
+\nppatchchapter{default,vacant,multiple=2,
+ notestext={Another notes page\\
+ automatically inserted\\
+ before a new chapter.}}
+\end{verbatim}
+
+\nppatchchapter{default,vacant,multiple=2,
+ notestext={Another notes page\\
+ automatically inserted\\
+ before a new chapter.}}
+
+\fillit[1-3]
+
\secleveli{Colors and Languages}
\seclevelii{Colors}
The \textsf{NotesPages} package uses three colors.
@@ -3584,7 +3687,18 @@
\fillit[1-4]
-\seclevelii{The End}
+\seclevelii{The command \texttt{\textbackslash npunpatchchapter}}
+With \verb|\npunpatchchapter| the original meaning of \verb|\chapter| can be
+restored. After that, there may be the usual empty before a new chapter, as can
+be seen on the next page. The command:
+
+\begin{verbatim}
+\npunpatchchapter
+\end{verbatim}
+
+\npunpatchchapter
+
+\secleveli{The End}
Now this is the end of this example file. But I just can't resist to add one more
example:
\begin{verbatim}
Modified: trunk/Master/texmf-dist/tex/latex/notespages/notespages.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/notespages/notespages.sty 2016-08-22 22:31:45 UTC (rev 41905)
+++ trunk/Master/texmf-dist/tex/latex/notespages/notespages.sty 2016-08-22 22:31:57 UTC (rev 41906)
@@ -41,8 +41,8 @@
%% Right brace \} Tilde \~}
%%
%%
-\def\fileversion{0.8}
-\def\filedate{2016/08/10}
+\def\fileversion{0.8.1}
+\def\filedate{2016/08/21}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{notespages}[\filedate\space
@@ -94,6 +94,8 @@
\newcount\np at notepages
\newcommand*{\ifnp at started@on at new@page}{}
\newif\ifnp at started@on at new@page
+\newcommand*{\ifnp at started@on at full@page}{}
+\newif\ifnp at started@on at full@page
\newcommand*{\np at fill@minspace}{}
\newdimen\np at fill@minspace
\newcommand*{\np at fill@maxspace}{}
@@ -457,19 +459,24 @@
\vspace*{\np at titleskip}%
\fi
\def\np at tempa{left}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=left}%
\raggedright
\else
\def\np at tempa{right}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=right}%
\raggedleft
\else
\def\np at tempa{center}\ifx\np at tempa\np at notesalign
+%% \typeout{notespages debug: notestextalign=center}%
\centering
\fi
\fi
\fi
- \color{NotesTextColor}\notesareatext}
+ \color{NotesTextColor}\notesareatext\par}
\newcommand{\np at inner@notespage}{\parfillskip\z@ plus 1fil%
- \csname np at ns@\np at notesstyle\endcsname}
+ \begingroup
+ \csname np at ns@\np at notesstyle\endcsname
+ \endgroup}
\newcommand*{\np at notespage}{%
\ifKV at np@allowfloats\else
\def\np at tempa{newpage}\ifx\np at tempa\np at startnotes
@@ -507,14 +514,19 @@
\newcommand*{\notespages}[1][]{%
\begingroup
\np at marktext@setfalse\setkeys{np}{#1}%
+%% \typeout{notespages debug:\space\the\pagetotal\space\the\pagegoal}%
\ifdim\pagetotal=\z@
\np at started@on at new@pagetrue\else\np at started@on at new@pagefalse\fi
+ \ifdim\pagetotal<\pagegoal
+ \np at started@on at full@pagefalse\else\np at started@on at full@pagetrue\fi
\np at notepages\c at page
\ifnp at started@on at new@page\advance\np at notepages\m at ne\fi
+ \ifnp at started@on at full@page\advance\np at notepages\@ne\fi
\divide\np at notepages\np at multiple
\multiply\np at notepages\np at multiple
\advance\np at notepages-\c at page
\ifnp at started@on at new@page\advance\np at notepages\@ne\fi
+ \ifnp at started@on at full@page\advance\np at notepages\m at ne\fi
\ifnum\np at notepages<\z@
\advance\np at notepages\np at multiple\fi
\np at tempcnta\np at endpages
@@ -579,6 +591,8 @@
\newcommand{\nppatchchapter}[1]{%
\@ifundefined{chapter}{}{%
\def\chapter{\notespages[#1]\np at orig@chapter}}}
+\newcommand{\npunpatchchapter}{%
+ \@ifundefined{chapter}{}{\let\chapter\np at orig@chapter}}
\newcommand*{\np at lang@german}{\def\npnotesname{Notizen}%
\def\npnotestext{Diese Seite wurde absichtlich leer gelassen.}}
\newcommand*{\np at lang@english}{\def\npnotesname{Notes}%
More information about the tex-live-commits
mailing list