texlive[46778] Master/texmf-dist: mpostinl (1mar18)
commits+karl at tug.org
commits+karl at tug.org
Fri Mar 2 01:22:43 CET 2018
Revision: 46778
http://tug.org/svn/texlive?view=revision&revision=46778
Author: karl
Date: 2018-03-02 01:22:42 +0100 (Fri, 02 Mar 2018)
Log Message:
-----------
mpostinl (1mar18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/mpostinl/README.txt
trunk/Master/texmf-dist/doc/latex/mpostinl/mpinlsmp.tex
trunk/Master/texmf-dist/doc/latex/mpostinl/mpostinl.pdf
trunk/Master/texmf-dist/source/latex/mpostinl/mpostinl.dtx
trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty
Modified: trunk/Master/texmf-dist/doc/latex/mpostinl/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mpostinl/README.txt 2018-03-01 23:49:22 UTC (rev 46777)
+++ trunk/Master/texmf-dist/doc/latex/mpostinl/README.txt 2018-03-02 00:22:42 UTC (rev 46778)
@@ -1,4 +1,4 @@
-mpostinl v1.3
+mpostinl v1.4
Copyright 2010-2018 Niklas Beisert
mpostinl is a LaTeX2e package
Modified: trunk/Master/texmf-dist/doc/latex/mpostinl/mpinlsmp.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mpostinl/mpinlsmp.tex 2018-03-01 23:49:22 UTC (rev 46777)
+++ trunk/Master/texmf-dist/doc/latex/mpostinl/mpinlsmp.tex 2018-03-02 00:22:42 UTC (rev 46778)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesFile{mpinlsmp.tex}[2018/02/09 v1.3 sample for mpostinl]
+\ProvidesFile{mpinlsmp.tex}[2018/03/01 v1.4 sample for mpostinl]
\documentclass[12pt,a4paper]{article}
\parindent0pt
Modified: trunk/Master/texmf-dist/doc/latex/mpostinl/mpostinl.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/mpostinl/mpostinl.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/mpostinl/mpostinl.dtx 2018-03-01 23:49:22 UTC (rev 46777)
+++ trunk/Master/texmf-dist/source/latex/mpostinl/mpostinl.dtx 2018-03-02 00:22:42 UTC (rev 46778)
@@ -18,10 +18,10 @@
% and the derived files mpostinl.sty and mpinlsmp.tex
%
%<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-%<package>\ProvidesPackage{mpostinl}[2018/02/09 v1.3 metapost inline figures]
-%<sample>\ProvidesFile{mpinlsmp.tex}[2018/02/09 v1.3 sample for mpostinl]
+%<package>\ProvidesPackage{mpostinl}[2018/03/01 v1.4 metapost inline figures]
+%<sample>\ProvidesFile{mpinlsmp.tex}[2018/03/01 v1.4 sample for mpostinl]
%<*driver>
-%\ProvidesFile{mpostinl.drv}[2018/02/09 v1.3 mpostinl reference manual file]
+%\ProvidesFile{mpostinl.drv}[2018/03/01 v1.4 mpostinl reference manual file]
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}
@@ -62,7 +62,7 @@
{\texttt{nbeisert at itp.phys.ethz.ch}}}
\hypersetup{pdfauthor={Niklas Beisert}}
\hypersetup{pdfsubject={Manual for the LaTeX2e Package mpostinl}}
-\date{9 February 2018, \textsf{v1.3}}
+\date{1 March 2018, \textsf{v1.4}}
\maketitle
\begin{abstract}\noindent
@@ -365,7 +365,6 @@
\medskip
\noindent
\DescribeMacro{\mpostuse}
-\DescribeMacro{\mpostgetname}
Figures which have been previously declared
with a label \textit{label}
can be recycled any number of times with the command:
@@ -374,6 +373,17 @@
\end{center}
The options are passed on to
|\includegraphics[|\textit{opt}|]{|\textit{filename}|}|.
+Note that |\mpostuse| accepts the overlay specification
+from the \textsf{beamer} package
+\begin{center}
+|\mpostuse<|\textit{overlay}|>[|\textit{opts}|]{|\textit{label}|}|
+\end{center}
+and passes it on to |\includegraphics|.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\medskip
+\noindent
+\DescribeMacro{\mpostgetname}
Furthermore, the filename of a figure can be obtained by
calling |\mpostgetname{|\textit{label}|}|.
The filename is returned in the macro |\mpostfigurename|.
@@ -603,6 +613,16 @@
stabilises the figure numbering
by making changes to the sequence have
effects only within the present section or chapter.
+
+\item |beamer|[|=true|$\vert$|false|]
+(no value implies |true|, initially set to |true|) --
+Enable/disable processing of overlay parameters |<|\ldots|>|
+by |\mpostuse| defined by the \textsf{beamer} package.
+
+\item |warnunused|[|=true|$\vert$|false|]
+(no value implies |true|, initially set to |true|) --
+Enable/disable warnings for unused figure labels.
+
\end{itemize}
%
Admittedly, some of these options are hardly necessary
@@ -1008,6 +1028,7 @@
must not be used within the |frame| environment.
Instead, figures should be declared outside the |frame| environment
and can be displayed by |\mpostuse| within the |frame| environment.
+Note that |\mpostuse| accepts the overlay parameter |<|\ldots|>|.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{Package \textsf{graphbox}.}
@@ -1122,7 +1143,7 @@
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\subsection{Interaction with Other Packages and Software}
+\subsection{Required Packages and Software}
The package relies on other packages and software:
\begin{itemize}
@@ -1203,6 +1224,19 @@
\subsection{Revision History}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v1.4:} 2018/03/01
+
+\begin{itemize}
+\item
+|\mpostuse| now accepts overlay options |<|\ldots|>|
+of the \textsf{beamer} package;
+new option |beamer| to control the feature
+\item
+issue warnings for unused labels;
+new option |warnunused| to control the feature
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\paragraph{v1.3:} 2018/02/09
\begin{itemize}
@@ -1882,6 +1916,8 @@
\newif\ifmpi at nowkeep\mpi at nowkeepfalse
\newif\ifmpi at include\mpi at includefalse
\newif\ifmpi at defglobal\mpi at defglobalfalse
+\newif\ifmpi at warnunused\mpi at warnunusedtrue
+\newif\ifmpi at beamer\mpi at beamertrue
% \end{macrocode}
% \begin{macro}{\mpi at mpostmem}
@@ -1936,6 +1972,8 @@
\define at key{\mpi at group}{command}[]{\def\mpi at mpostcompiler{#1}}
\define at key{\mpi at group}{class}{\def\mpi at latexclass{#1}}
\define at key{\mpi at group}{classopt}[]{\def\mpi at latexoptions{[#1]}}
+\define at key{\mpi at group}{beamer}[true]{\csname mpi at beamer#1\endcsname}
+\define at key{\mpi at group}{warnunused}[true]{\csname mpi at warnunused#1\endcsname}
\define at key{\mpi at group}{now}[true]{\csname mpi at nowactive#1\endcsname}
\define at key{\mpi at group}{nowall}[true]{\csname mpi at now#1\endcsname}
\define at key{\mpi at group}{nowkeep}[true]{\csname mpi at nowkeep#1\endcsname}
@@ -1973,6 +2011,14 @@
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mpi at unusedlist}
+% Initialise a list of unused figure labels:
+% \begin{macrocode}
+\def\mpi at unusedlist{}
+% \end{macrocode}
+% \end{macro}
+
+
% \begin{macro}{\mpi at dblquotchar}
% Define a bare double quotation character for writing to the file:
% \begin{macrocode}
@@ -2123,6 +2169,25 @@
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mpi at warnunused}
+% This macro processes the list of all figure labels
+% and issues a warning for every unused ones:
+% \begin{macrocode}
+\def\mpi at warnunused#1{%
+ \begingroup\def\mpi at tmp{#1}\ifx\mpi at tmp\mpi at empty\else%
+ \ifcsname mpi at lu@#1\endcsname\else
+ \PackageWarning{mpostinl}{figure label `#1' not used}{}%
+ \fi%
+ \def\mpi at tmp{\mpi at warnunused}%
+ \fi\expandafter\endgroup\mpi at tmp%
+}
+% \end{macrocode}
+% Run |\mpi at warnunused| at the end of the document:
+% \begin{macrocode}
+\AtEndDocument{\expandafter\mpi at warnunused\mpi at unusedlist{}}
+% \end{macrocode}
+% \end{macro}
+
% \begin{macro}{\mpostplaceholder}
% Display a placeholder for non-existing files or labels;
% this function may be overwritten by the user for customisation purposes
@@ -2694,7 +2759,8 @@
\edef\mpi at figfile{\mpi at template{\thempi at count}}%
\fi%
% \end{macrocode}
-% Save filename to label, warn if label has already been defined:
+% Save filename to label, warn if label has already been defined,
+% remember all labels for checking whether unused:
% \begin{macrocode}
\ifx\mpi at figlabel\mpi at empty\else%
\expandafter\ifx\csname mpi at l@\mpi at figlabel\endcsname\relax\else%
@@ -2702,6 +2768,9 @@
overwriting}{}%
\fi%
\expandafter\xdef\csname mpi at l@\mpi at figlabel\endcsname{\mpi at figfile}%
+ \ifmpi at warnunused\ifmpi at figshow\else%
+ \xdef\mpi at unusedlist{\mpi at unusedlist{\mpi at figlabel}}%
+ \fi\fi%
\fi%
% \end{macrocode}
% Prepare for recording; start file and content section (if needed),
@@ -2758,7 +2827,8 @@
% |\mpostuse| includes a metapost figure which was declared earlier
% via its label. The optional argument is passed as the optional
% argument for |\includegraphics|.
-% Remember if a file is currently open for writing:
+% Remember that the label has been used,
+% remember if a file is currently open for writing:
% \begin{macrocode}
\newcommand{\mpostuse}[2][]{%
\expandafter\ifx\csname mpi at l@#2\endcsname\relax%
@@ -2765,6 +2835,7 @@
\PackageWarning{mpostinl}{unknown label `#2'}{}%
\mpostplaceholder[label]{#2}%
\else%
+ \ifmpi at warnunused\expandafter\gdef\csname mpi at lu@#2\endcsname{}\fi%
\mpi at graphics[#1]{\csname mpi at l@#2\endcsname}%
\ifmpi at infile\global\mpi at showinfiletrue\fi%
\fi%
@@ -2774,7 +2845,8 @@
% \begin{macro}{\mpostgetname}
% |\mpostgetname| gets the filename of a figure declared earlier
-% via its label and returns it in the macro |\mpostfigurename|:
+% via its label and returns it in the macro |\mpostfigurename|.
+% Remember that the label has been used:
% \begin{macrocode}
\newcommand{\mpostgetname}[1]{%
\expandafter\ifx\csname mpi at l@#1\endcsname\relax%
@@ -2781,6 +2853,7 @@
\PackageWarning{mpostinl}{unknown label `#1'}{}%
\let\mpostfigurename\relax%
\else%
+ \ifmpi at warnunused\expandafter\gdef\csname mpi at lu@#1\endcsname{}\fi%
\edef\mpostfigurename{\csname mpi at l@#1\endcsname}%
\fi%
}
@@ -2795,7 +2868,7 @@
% |\mpostfile| sets up a new metapost file.
% If the previous file is still open,
-% it will be closed and processed first.
+% it will be closed and processed first:
% \begin{macrocode}
\newcommand{\mpostfile}[2][]{%
\mpi at closefile%
@@ -2808,12 +2881,27 @@
% \begin{macro}{\mpostdone}
% |\mpostdone| closes the present metapost file
-% and processes it if applicable.
+% and processes it if applicable:
% \begin{macrocode}
\newcommand{\mpostdone}{\mpi at closefile}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mpostuse<>}
+% This overwrites the definition of |\mpostfile|
+% to accept the overlay option |<|\ldots|>|
+% of the \textsf{beamer} package:
+% \begin{macrocode}
+\ifmpi at beamer\@ifclassloaded{beamer}{
+ \let\mpi at plain@mpostuse\mpostuse%
+ \newcommand<>{\mpostuse}[2][]{\begingroup%
+ \expandafter\def\expandafter\includegraphics\expandafter%
+ {\includegraphics#3}%
+ \mpi at plain@mpostuse[#1]{#2}\endgroup}%
+}{}\fi
+% \end{macrocode}
+% \end{macro}
+
%\iffalse
%</package>
%\fi
Modified: trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty 2018-03-01 23:49:22 UTC (rev 46777)
+++ trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty 2018-03-02 00:22:42 UTC (rev 46778)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesPackage{mpostinl}[2018/02/09 v1.3 metapost inline figures]
+\ProvidesPackage{mpostinl}[2018/03/01 v1.4 metapost inline figures]
\RequirePackage{verbatim}
\RequirePackage{graphicx}
@@ -47,6 +47,8 @@
\newif\ifmpi at nowkeep\mpi at nowkeepfalse
\newif\ifmpi at include\mpi at includefalse
\newif\ifmpi at defglobal\mpi at defglobalfalse
+\newif\ifmpi at warnunused\mpi at warnunusedtrue
+\newif\ifmpi at beamer\mpi at beamertrue
\def\mpi at mpostmem{}
\def\mpi at mpostcompiler{}
@@ -79,6 +81,8 @@
\define at key{\mpi at group}{command}[]{\def\mpi at mpostcompiler{#1}}
\define at key{\mpi at group}{class}{\def\mpi at latexclass{#1}}
\define at key{\mpi at group}{classopt}[]{\def\mpi at latexoptions{[#1]}}
+\define at key{\mpi at group}{beamer}[true]{\csname mpi at beamer#1\endcsname}
+\define at key{\mpi at group}{warnunused}[true]{\csname mpi at warnunused#1\endcsname}
\define at key{\mpi at group}{now}[true]{\csname mpi at nowactive#1\endcsname}
\define at key{\mpi at group}{nowall}[true]{\csname mpi at now#1\endcsname}
\define at key{\mpi at group}{nowkeep}[true]{\csname mpi at nowkeep#1\endcsname}
@@ -99,6 +103,8 @@
\def\mpi at empty{}
+\def\mpi at unusedlist{}
+
\begingroup\catcode`\"=12\relax\gdef\mpi at dblquotchar{"}\endgroup
\newif\ifmpi at infile\mpi at infilefalse
@@ -157,6 +163,16 @@
\fi\fi%
}
+\def\mpi at warnunused#1{%
+ \begingroup\def\mpi at tmp{#1}\ifx\mpi at tmp\mpi at empty\else%
+ \ifcsname mpi at lu@#1\endcsname\else
+ \PackageWarning{mpostinl}{figure label `#1' not used}{}%
+ \fi%
+ \def\mpi at tmp{\mpi at warnunused}%
+ \fi\expandafter\endgroup\mpi at tmp%
+}
+\AtEndDocument{\expandafter\mpi at warnunused\mpi at unusedlist{}}
+
\newcommand{\mpostplaceholder}[2][]{\parbox[c]{1in}{%
\hrule\vrule\hfill%
\parbox[c]{0pt}{\rule{0cm}{0.6in}}\makebox[0pt][c]{\scriptsize\tt #2}%
@@ -491,6 +507,9 @@
overwriting}{}%
\fi%
\expandafter\xdef\csname mpi at l@\mpi at figlabel\endcsname{\mpi at figfile}%
+ \ifmpi at warnunused\ifmpi at figshow\else%
+ \xdef\mpi at unusedlist{\mpi at unusedlist{\mpi at figlabel}}%
+ \fi\fi%
\fi%
\mpi at startcontent%
\mpi at clearbuf%
@@ -531,6 +550,7 @@
\PackageWarning{mpostinl}{unknown label `#2'}{}%
\mpostplaceholder[label]{#2}%
\else%
+ \ifmpi at warnunused\expandafter\gdef\csname mpi at lu@#2\endcsname{}\fi%
\mpi at graphics[#1]{\csname mpi at l@#2\endcsname}%
\ifmpi at infile\global\mpi at showinfiletrue\fi%
\fi%
@@ -541,6 +561,7 @@
\PackageWarning{mpostinl}{unknown label `#1'}{}%
\let\mpostfigurename\relax%
\else%
+ \ifmpi at warnunused\expandafter\gdef\csname mpi at lu@#1\endcsname{}\fi%
\edef\mpostfigurename{\csname mpi at l@#1\endcsname}%
\fi%
}
@@ -556,6 +577,14 @@
\newcommand{\mpostdone}{\mpi at closefile}
+\ifmpi at beamer\@ifclassloaded{beamer}{
+ \let\mpi at plain@mpostuse\mpostuse%
+ \newcommand<>{\mpostuse}[2][]{\begingroup%
+ \expandafter\def\expandafter\includegraphics\expandafter%
+ {\includegraphics#3}%
+ \mpi at plain@mpostuse[#1]{#2}\endgroup}%
+}{}\fi
+
\endinput
%%
%% End of file `mpostinl.sty'.
More information about the tex-live-commits
mailing list