diff options
author | Karl Berry <karl@freefriends.org> | 2012-01-06 01:00:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-01-06 01:00:48 +0000 |
commit | 4db9b6bcdb70e203b5afdb36815d7341b3e9fc5f (patch) | |
tree | bab41763992ce3351423f057effc88fb8a888522 /Master | |
parent | d882c28155a87f245ab04b96bf9e09460f82f94e (diff) |
new latex package parnotes (4jan12)
git-svn-id: svn://tug.org/texlive/trunk@25032 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/parnotes/README | 16 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/parnotes/README.TEXLIVE | 7 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/parnotes/parnotes.sty | 185 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 2 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/parnotes.tlpsrc | 0 |
7 files changed, 211 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/parnotes/README b/Master/texmf-dist/doc/latex/parnotes/README new file mode 100644 index 00000000000..21485007e91 --- /dev/null +++ b/Master/texmf-dist/doc/latex/parnotes/README @@ -0,0 +1,16 @@ +The parnotes package adds a new note type, \parnote. Parnotes are set as +normal, running paragraphs and may be placed two ways: (1) Automatically, +at the end of the paragraph (2) Manually, using the \parnotes command. + +To place notes automatically after every paragraph, use the autopn +environment: + \begin{autopn} + Text\parnote{parnote} + + Text + \end{autopn} +If environments are used within autopn, another autopn environment must be +nested within them. To place notes elsewhere, use the \parnotes command. + +This is revision 1, last modified 01/03/12 +See parnotes.sty for copyright and contact details. diff --git a/Master/texmf-dist/doc/latex/parnotes/README.TEXLIVE b/Master/texmf-dist/doc/latex/parnotes/README.TEXLIVE new file mode 100644 index 00000000000..3ee342dbaa2 --- /dev/null +++ b/Master/texmf-dist/doc/latex/parnotes/README.TEXLIVE @@ -0,0 +1,7 @@ +The following files have been removed in the TeX Live installation of +the current package, typically due to duplication, lack of space, or +missing source code. You can find these files on CTAN at + http://mirror.ctan.org/macros/latex/contrib/parnotes +If questions or concerns, email tex-live@tug.org. + + PNmanual.pdf diff --git a/Master/texmf-dist/tex/latex/parnotes/parnotes.sty b/Master/texmf-dist/tex/latex/parnotes/parnotes.sty new file mode 100644 index 00000000000..797ca6319f6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/parnotes/parnotes.sty @@ -0,0 +1,185 @@ +% The parnotes package +% Notes after every paragraph, or elsewhere +% Copyright 2012, Michael Hughes +% +% This work is distributed under the LaTeX Project Public License, +% version 1.3 or later, available at +% http://www.latex-project.org/lppl.txt +% I currently maintain this project and will receive error reports at +% mcrh <at> uw <dot> edu +% +% This package was started due to a question at the TeX Stack Exchange: +% http://tex.stackexchange.com/questions/34746/ +% +% Thanks to Stack Exchange users Ahmed Musa and Bruno Le Floch + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{parnotes}[2012/01/03 rev. 1 Notes after every paragraph, or elsewhere] + +% +% These are the user-modifiable format commands +% + +% Format for parnotes - \PN@notes@shape is \rmfamily by default +\providecommand{\parnotefmt}[1]{\footnotesize% + \PN@notes@shape\PN@narrower@optional\noindent #1} +% Format for parnote marks - \PN@mark@set is \arabic by default +\providecommand{\parnotemarkfmt}[1]{\textsuperscript{\PN@mark@set{#1}}} +% Minimum vertical space before and after parnotes +\providecommand{\parnotevskip}{\medskipamount} +% Full command used between parnotes +\providecommand{\parnoteintercmd}{\hspace{1em}} + +% +% Internal variables below this line +% + +% This holds all the parnote text +\global\def\PN@text{} +% Counter for parnote marks left by \parnote +\global\newcount\c@PN@t +% Counter for parnote marks *within* parnotes +\global\newcount\c@PN@n +% autopn environment name +\def\@PN@autopn{autopn} +% True if currently setting parnotes +\newif\ifPN@inparnotes +% Commands used to disable indentation for the next paragraph +\def\PN@disable@indent{\@afterindentfalse\@afterheading} + +% +% Optionally reset the counter within \parnotes +% +\let\PN@reset@optional\relax +\DeclareOption{restart}{\def\PN@reset@optional{% + \global\c@PN@t=\z@ + \global\c@PN@n=\z@ +}} +% +% Parnote marks are arabic by default, but an option changes them to roman +% +\let\PN@mark@set\arabic +\DeclareOption{roman}{\let\PN@mark@set\roman} +% breakwithin just changes \parnoteintercmd +\DeclareOption{breakwithin}{\renewcommand{\parnoteintercmd}{\\}} +% And indentafter just clears \PN@disable@indent +\DeclareOption{indentafter}{\let\PN@disable@indent\relax} +% +% Set parnotes using \narrower if that option is specified +% +\let\PN@narrower@optional\relax +\DeclareOption{narrower}{\let\PN@narrower@optional\narrower} +% +% Font-changing options +% +\let\PN@notes@shape\rmfamily +\DeclareOption{notesrm}{\let\PN@notes@shape\rmfamily} +\DeclareOption{notessf}{\let\PN@notes@shape\sffamily} +\DeclareOption{notesit}{\let\PN@notes@shape\itshape} +% Finally process the options +\ProcessOptions\relax + +\long\def\PN@parnote@real#1{% + % Advance the counter used in TEXT immediately + \global\advance\c@PN@t\@ne + % + % Then add the command's argument to a macro to be called at the end + % of the paragraph (or wherever \parnotes gets called) + % + \g@addto@macro\PN@text{% + % Advance the counter used in the parnotes as the parnotes are set + \global\advance\c@PN@n\@ne + \parnotemarkfmt{PN@n}\nolinebreak\thinspace#1% + % + % This way, if the in-text counter equals the in-note counter, we + % know that we're at the final parnote for this batch and + % \parnoteintercmd shouldn't be executed + % + \unless\ifnum\c@PN@n=\c@PN@t + \parnoteintercmd + \fi + }% + \unskip\parnotemarkfmt{PN@t}% +} + +% +% \parnote calls \PN@parnote@real if in typesetting mode, but does nothing +% elsewhere (i.e., in the table of contents) - this is based on the stable +% option of the footmisc package +% +\long\def\parnote{% + \ifx\protect\@typeset@protect + \expandafter\PN@parnote@real + \else + \expandafter\@gobble + \fi +} + +\def\PN@parnotes@real{% + % We call \par later, so this avoids recursion with \PN@parnotes@auto + \PN@inparnotestrue + % + % Get into vmode if we aren't already + % + \unless\ifvmode + \par + \fi + % Avoid page breaks between a paragraph and its parnotes + \nopagebreak\addvspace{\parnotevskip}% + % \parnotefmt goes in a separate group to avoid having formatting + % commands and local redefinitions of \parnotemarkfmt contaminate the + % following paragraphs + {\parnotefmt{\PN@text}\par}% + \global\def\PN@text{}% + \addvspace{\parnotevskip}% + % + % These can be enabled or disabled by package options + % + \PN@disable@indent + \PN@reset@optional + \PN@inparnotesfalse +} + +\newenvironment{autopn}{% + % + % Insert \PN@parnotes@auto into \par and \@par + % We can't just do \@setpar{\PN@parnotes@auto\@@par} since autopn + % could be nested within a list + % + \let\PN@par\par + \def\par{\PN@parnotes@auto\PN@par}% + \def\@par{\PN@parnotes@auto\@@par}% +} +{\PN@parnotes@auto} % At the environment's end, set any notes we've missed + +% +% If a user calls \parnotes, check that there are parnotes to set +% +\def\parnotes{% + \unless\ifx\PN@text\@empty + \expandafter\PN@parnotes@real + \fi +} + +% +% If autopn calls parnotes, check for nested environments, and that this +% isn't a call to \par from within \PN@parnotes@real, AND that there are +% parnotes to set +% +\def\PN@parnotes@auto{% + \ifx\@currenvir\@PN@autopn + \unless\ifPN@inparnotes + \unless\ifx\PN@text\@empty + \expandafter\PN@parnotes@real + \fi + \fi + \fi +} + +% +% Reset both mark counters to 0 +% +\def\parnotereset{% + \global\c@PN@t=\z@ + \global\c@PN@n=\z@ +} diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 6404125df5a..5f9cf5b680b 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -288,7 +288,7 @@ my @TLP_working = qw( pacioli pagecolor pagecont pagenote pagerange pageslts paper papercdcase papermas papertex paracol paralist parallel paratype - paresse parrun parselines parskip passivetex + paresse parnotes parrun parselines parskip passivetex patch patchcmd patgen2-tutorial path pauldoc pawpict pax pbox pb-diagram pbsheet pdf14 pdf-forms-tutorial-de pdf-forms-tutorial-en diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 3b6665613c5..80d39f0ea86 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -2159,6 +2159,7 @@ $standardclean = '\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot' 'jknapltx' => 'ubbold.fd', # clash bbold's Ubbold.fd; sauter bbold fails 'linguex' => 'cgloss4e.sty', # symlink 'numericplots' => '.*\.m', # matlab + 'parnotes' => 'PNmanual.pdf', # no source 'piechartmp' => 'piechartmp.pdf', # no source 'ptptex' => '(overcite|cite|wrapfig).sty', # duplicated 'sapthesis' => 'marchiologo.*\.pdf', # univ logos diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 484af59949c..d77c4397879 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -512,6 +512,7 @@ depend papertex depend paracol depend paralist depend paresse +depend parnotes depend parselines depend patch depend patchcmd diff --git a/Master/tlpkg/tlpsrc/parnotes.tlpsrc b/Master/tlpkg/tlpsrc/parnotes.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/parnotes.tlpsrc |