texlive[43359] Master/texmf-dist: mpostinl (28feb17)
commits+karl at tug.org
commits+karl at tug.org
Tue Feb 28 22:24:52 CET 2017
Revision: 43359
http://tug.org/svn/texlive?view=revision&revision=43359
Author: karl
Date: 2017-02-28 22:24:52 +0100 (Tue, 28 Feb 2017)
Log Message:
-----------
mpostinl (28feb17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/mpostinl/README
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
===================================================================
--- trunk/Master/texmf-dist/doc/latex/mpostinl/README 2017-02-28 21:24:29 UTC (rev 43358)
+++ trunk/Master/texmf-dist/doc/latex/mpostinl/README 2017-02-28 21:24:52 UTC (rev 43359)
@@ -1,4 +1,4 @@
-mpostinl v1.0
+mpostinl v1.1
Copyright 2010-2017 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 2017-02-28 21:24:29 UTC (rev 43358)
+++ trunk/Master/texmf-dist/doc/latex/mpostinl/mpinlsmp.tex 2017-02-28 21:24:52 UTC (rev 43359)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesFile{mpinlsmp.tex}[2017/01/04 v1.0 sample for mpostinl]
+\ProvidesFile{mpinlsmp.tex}[2017/02/27 v1.1 sample for mpostinl]
\documentclass[12pt,a4paper]{article}
\parindent0pt
@@ -27,11 +27,14 @@
\usepackage[utf8]{inputenc}
+%% optional: add filename to position labels in metapost code
\IfFileExists{currfile.sty}{\usepackage{currfile}}{}
+%% optional: tools to align graphics
\IfFileExists{graphbox.sty}
{\def\align{align}\usepackage{graphbox}}
{\def\align{}}
+%% some sample package options:
%% \mpostsetup{write=false}
%% \mpostsetup{compile=false}
\mpostsetup{now}
@@ -40,10 +43,12 @@
%% \mpostsetup{latex=false}
%% \mpostsetup{classopt={12pt}}
+%% declare packages to be used for processing labels:
\begin{mpostdef}[tex,global]
\usepackage[utf8]{inputenc}
\end{mpostdef}
+%% specify global definitions:
\begin{mpostdef}[global]
newinternal unit;
unit:=1cm;
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 2017-02-28 21:24:29 UTC (rev 43358)
+++ trunk/Master/texmf-dist/source/latex/mpostinl/mpostinl.dtx 2017-02-28 21:24:52 UTC (rev 43359)
@@ -18,10 +18,10 @@
% and the derived files mpostinl.sty and mpinlsmp.tex
%
%<package|sample>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-%<package>\ProvidesPackage{mpostinl}[2017/01/04 v1.0 metapost inline figures]
-%<sample>\ProvidesFile{mpinlsmp.tex}[2017/01/04 v1.0 sample for mpostinl]
+%<package>\ProvidesPackage{mpostinl}[2017/02/27 v1.1 metapost inline figures]
+%<sample>\ProvidesFile{mpinlsmp.tex}[2017/02/27 v1.1 sample for mpostinl]
%<*driver>
-%\ProvidesFile{mpostinl.drv}[2017/01/04 v1.0 mpostinl reference manual file]
+%\ProvidesFile{mpostinl.drv}[2017/02/27 v1.1 mpostinl reference manual file]
\PassOptionsToClass{10pt,a4paper}{article}
\documentclass{ltxdoc}
@@ -48,7 +48,7 @@
{\texttt{nbeisert at itp.phys.ethz.ch}}}
\hypersetup{pdfauthor={Niklas Beisert}}
\hypersetup{pdfsubject={Manual for the LaTeX2e Package mpostinl}}
-\date{4 January 2017, \textsf{v1.0}}
+\date{27 February 2017, \textsf{v1.1}}
\maketitle
\begin{abstract}\noindent
@@ -224,7 +224,7 @@
The package assumes a \TeX{} installation with \MP{}
configured appropriately.
Recent \textsf{texlive} and MiK\TeX{} distributions should work well.
-Compatibility with the \textsf{texlive} distribution
+Compatibility with the \textsf{texlive} distribution
has been tested with the 2016 issue containing
pdf\TeX{} version 3.14159265-2.6-1.40.17
and \MP{} version 1.9991.
@@ -276,7 +276,7 @@
\end{center}
In the MiK\TeX{} distribution the appropriate
command line option is |-enable-write18|.
-In a \LaTeX{} font end this option may
+In a \LaTeX{} front end this option may
be configurable in the preferences.
If the shell escape is not available,
the generated metapost file(s) \textit{filename}
@@ -448,7 +448,8 @@
\begin{itemize}
\item |draft|[|=true|$\vert$|false|]
(no value implies |true|, initially set to |false|) --
-Enable/disable |draft| mode.
+Enable/disable |draft| mode by declaring |draft:=1|
+at the top of the metapost file.
\item |final| --
Same as |draft=false|.
@@ -475,7 +476,12 @@
This option may be required if figure files are
used outside a \TeX{} environment,
e.g.\ if the files are to be viewed or processed by |.eps| tools.
+Has no effect if |prologues| option is specified.
+\item |prologues=|\textit{value} --
+Declares |prologues:=|\textit{value} at the top of the metapost file.
+Set \textit{value} to empty to disable the |prologues| statement.
+
\item |lineno|[|=true|$\vert$|false|]
(no value implies |true|, initially set to |false|) --
Enable/disable line number indicators in the metapost file.
@@ -503,13 +509,23 @@
(no value implies |true|, initially set to |true|) --
Switch between \TeX{} (|false|) and \LaTeX{} (|true|)
processing of labels.
-This will also set the |compiler| option appropriately.
+In \LaTeX{} mode a basic \LaTeX{} document structure is
+provided by the metapost file.
\item |compiler=|\textit{compiler} --
-Set the compiler program for labels to \textit{compiler}.
-The initial setting is |tex| (in \TeX{} mode)
+Set the compiler program for labels to \textit{compiler}
+(command line option |-tex=|\textit{compiler} for \MP).
+The default is |tex| (in \TeX{} mode)
or |latex| (in \LaTeX{} mode).
+Set \textit{compiler} to empty to specify no compiler.
+\item |format=|\textit{tag} --
+Write format tag |%&|%
+\textit{tag} to specify the compiler program for labels.
+The default is |tex| (in \TeX{} mode)
+or |latex| (in \LaTeX{} mode).
+Set \textit{tag} to empty to write no format tag.
+
\item |class=|\textit{class}
(initially set to |article|) --
Set the document class to be used in \LaTeX{} mode.
@@ -522,9 +538,11 @@
\item |mem=|\textit{mem} --
Set the metapost format file to \textit{mem}.
-\item |command=|\textit{command}
-(initially set to |mpost|) --
-Set the metapost command to \textit{command}.
+\item |command=|\textit{command} --
+Use \textit{command} to process the generated file(s).
+By default the \MP{} program |mpost| is invoked
+to compile the generated metapost files
+(with appropriate command line options).
\item |now|[|=true|$\vert$|false|]
(no value implies |true|, initially set to |false|) --
@@ -991,7 +1009,105 @@
you may use |\begin{mpostfig}[opt={align}]|
or |\mpostuse[align]{|\textit{label}|}|.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{Package \textsf{latexmp}.}
+
+The \MP{} package \textsf{latexmp} writes its own \LaTeX{} structure
+to the metapost file.
+Therefore \textsf{mpostinl} must not write the \LaTeX{} structure,
+but still use the |latex| compiler.
+Furthermore \textsf{latexmp} needs two \MP{} passes.
+The required options are:
+\begin{center}
+|\mpostsetup{latex=false,format,compiler=latex,twice}|
+\end{center}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{Script \text{mplatex}.}
+
+The \MP{} processing script \textsf{mplatex} expects the default metapost
+file naming convention (\textit{filename}|.|\textit{nn})
+and no |prologues| statement.
+Moreover, it provides the \LaTeX{} structure.
+The required options are:
+%
+\begin{center}
+\begin{tabular}{l}
+|\mpostsetup{latex=false,format,prologues}|\\
+|\mpostsetup{template={\mpostfilename.#1}}|\\
+|\mpostsetup{command={mplatex |\textit{opt}|}}|
+\end{tabular}
+\end{center}
+%
+In \textit{opt} you can specify command line options for |mplatex|,
+e.g.\ to include \LaTeX{} packages.
+Make sure to enable full access to external programs,
+and that |mplatex| is in the path (or specify its location explicitly).
+Note that the file naming convention (\textit{filename}|.|\textit{nn})
+does not seem to work with pdf\LaTeX{}.
+
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Information}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Copyright}
+
+\begingroup
+\parskip1ex
+\parindent0pt
+
+Copyright \copyright{} 2010--2017 Niklas Beisert
+
+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
+ \url{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 Niklas Beisert.
+
+This work consists of the files |mpostinl.dtx| and |mpostinl.ins|
+and the derived files |mpostinl.sty| and |mpinlsmp.tex|
+
+\endgroup
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Files and Installation}
+
+The package consists of the files:
+%
+\begin{center}
+\begin{tabular}{ll}
+ |README| & readme file \\
+ |mpostinl.ins| & installation file \\
+ |mpostinl.dtx| & source file \\
+ |mpostinl.sty| & package file \\
+ |mpinlsmp.tex| & sample file \\
+ |mpostinl.pdf| & manual
+\end{tabular}
+\end{center}
+%
+The distribution consists of the files
+|README|, |mpostinl.ins| and |mpostinl.dtx|.
+%
+\begin{itemize}
+\item
+Run (pdf)\LaTeX{} on |mpostinl.dtx|
+to compile the manual |mpostinl.pdf| (this file).
+\item
+Run \LaTeX{} on |mpostinl.ins| to create the package |mpostinl.sty|
+and the sample |mpinlsmp.tex|.
+Copy the file |mpostinl.sty| to an appropriate directory of your \LaTeX{}
+distribution, e.g.\ \textit{texmf-root}|/tex/latex/mpostinl|.
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Feature Suggestions}
\label{sec:suggestions}
@@ -1031,68 +1147,75 @@
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\appendix
+\subsection{Revision History}
-\settowidth\MacroIndent{\rmfamily\scriptsize 000\ }
-\parskip1ex
-\parindent0pt
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v1.1:} 2017/02/27
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Files and Installation}
+\begin{itemize}
+\item
+improved compatibility with package \textsf{latexmp}
+and script \textsf{mplatex}
+(thanks to Walter Entenmann for encouragement and testing)
+\item
+options improved to fine-tune structures written to metapost files
+and to specify compiler programs
+\end{itemize}
-The package consists of the files:
-%
-\begin{center}
-\begin{tabular}{ll}
- |README| & readme file \\
- |mpostinl.ins| & installation file \\
- |mpostinl.dtx| & source file \\
- |mpostinl.sty| & package file \\
- |mpinlsmp.tex| & sample file \\
- |mpostinl.pdf| & manual
-\end{tabular}
-\end{center}
-%
-The distribution consists of the files
-|README|, |mpostinl.ins| and |mpostinl.dtx|.
-%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v1.0:} 2017/01/04
+
\begin{itemize}
\item
-Run (pdf)\LaTeX{} on |mpostinl.dtx|
-to compile the manual |mpostinl.pdf| (this file).
+manual and install package
\item
-Run \LaTeX{} on |mpostinl.ins| to create the package |mpostinl.sty|
-and the sample |mpinlsmp.tex|.
-Copy the file |mpostinl.sty| to an appropriate directory of your \LaTeX{}
-distribution, e.g.\ \textit{texmf-root}|/tex/latex/mpostinl|.
+first version published on CTAN
\end{itemize}
- \DocInput{mpostinl.dtx}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v0.7--0.9:} 2016/11/15 -- 2017/01/04
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\section{Copyright}
+\begin{itemize}
+\item
+package options
+\item
+metapost environments simplified and renamed
+\item
+immediate and multiple file processing
+\item
+customisation options
+\item
+internal buffer processing
+\end{itemize}
-Copyright \copyright{} 2010--2017 Niklas Beisert
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v0.6--0.63:} 2015/07/11 -- 2016/10/03
-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
- \url{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.
+\begin{itemize}
+\item
+minor improvements
+\end{itemize}
-This work has the LPPL maintenance status `maintained'.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\paragraph{v0.5:} 2010/11/01
-The Current Maintainer of this work is Niklas Beisert.
+\begin{itemize}
+\item
+basic functionality
+\end{itemize}
-This work consists of the files |mpostinl.dtx| and |mpostinl.ins|
-and the derived files |mpostinl.sty| and |mpinlsmp.tex|
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\appendix
+
+\settowidth\MacroIndent{\rmfamily\scriptsize 000\ }
+\parskip1ex
+\parindent0pt
+
+ \DocInput{mpostinl.dtx}
+
\end{document}
%</driver>
% \fi
@@ -1135,7 +1258,9 @@
% Include packages \textsf{currfile} and \textsf{graphbox} if available,
% declare an alignment switch |\align| (if \textsf{graphbox} is available):
% \begin{macrocode}
+%% optional: add filename to position labels in metapost code
\IfFileExists{currfile.sty}{\usepackage{currfile}}{}
+%% optional: tools to align graphics
\IfFileExists{graphbox.sty}
{\def\align{align}\usepackage{graphbox}}
{\def\align{}}
@@ -1144,6 +1269,7 @@
% Enable immediate mode and line number indicators,
% prepare some \textsf{mpostinl} options for testing:
% \begin{macrocode}
+%% some sample package options:
%% \mpostsetup{write=false}
%% \mpostsetup{compile=false}
\mpostsetup{now}
@@ -1158,6 +1284,7 @@
% as we will be generating several metapost files later on,
% make sure this statement in included in all of them:
% \begin{macrocode}
+%% declare packages to be used for processing labels:
\begin{mpostdef}[tex,global]
\usepackage[utf8]{inputenc}
\end{mpostdef}
@@ -1167,6 +1294,7 @@
% as we will be generating several metapost files later on,
% make sure this statement in included in all of them:
% \begin{macrocode}
+%% specify global definitions:
\begin{mpostdef}[global]
newinternal unit;
unit:=1cm;
@@ -1625,7 +1753,8 @@
\def\mpostfilename{\jobname}
\def\mpi at nowname{\jobname-tmp}
\def\mpi at extension{mps}
-\def\mpi at template#1{\mpostfilename-#1.\mpi at extension}
+\def\mpi at template#1{\mpostfilename-#1%
+ \ifx\mpi at extension\mpi at empty\else.\fi\mpi at extension}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1663,7 +1792,6 @@
% \begin{macro}{\mpi at mpostmem}
% \begin{macro}{\mpi at mpostcompiler}
-% \begin{macro}{\mpi at texcompiler}
% \begin{macro}{\mpi at latexclass}
% \begin{macro}{\mpi at latexoptions}
% \begin{macro}{\mpi at documentclass}
@@ -1671,8 +1799,7 @@
% \TeX{} or \LaTeX{}:
% \begin{macrocode}
\def\mpi at mpostmem{}
-\def\mpi at mpostcompiler{mpost}
-\def\mpi at texcompiler{latex}
+\def\mpi at mpostcompiler{}
\def\mpi at latexclass{article}
\def\mpi at latexoptions{}
\def\mpi at documentclass{\@backslashchar documentclass%
@@ -1683,7 +1810,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
% \begin{macro}{\mpi at warncompile}
% Warn and disable compiling if |\write18| is unavailable:
@@ -1701,27 +1827,24 @@
\DeclareOption{final}{\mpi at draftfalse}
\define at key{\mpi at group}{draft}[true]{\csname mpi at draft#1\endcsname}
\define at key{\mpi at group}{write}[true]{\csname mpi at write#1\endcsname}
-\define at key{\mpi at group}{latex}[true]{\csname mpi at latex#1\endcsname%
- \ifmpi at latex%
- \def\mpi at texcompiler{latex}%
- \else%
- \def\mpi at texcompiler{tex}%
- \fi}
+\define at key{\mpi at group}{latex}[true]{\csname mpi at latex#1\endcsname}
\define at key{\mpi at group}{compile}[true]{\csname mpi at compile#1\endcsname}
\define at key{\mpi at group}{twice}[true]{\csname mpi at twice#1\endcsname}
\define at key{\mpi at group}{fonts}[true]{\csname mpi at fonts#1\endcsname}
+\define at key{\mpi at group}{prologues}[]{\def\mpi at prologues{#1}}
\define at key{\mpi at group}{lineno}[true]{\csname mpi at lineno#1\endcsname}
\define at key{\mpi at group}{labelnames}[true]{\csname mpi at labelnames#1\endcsname}
-\define at key{\mpi at group}{compiler}{\def\mpi at texcompiler{#1}}
-\define at key{\mpi at group}{mem}{\def\mpi at mpostmem{#1}}
-\define at key{\mpi at group}{command}{\def\mpi at mpostcompiler{#1}}
+\define at key{\mpi at group}{compiler}[]{\def\mpi at texcompiler{#1}}
+\define at key{\mpi at group}{format}[]{\def\mpi at texformat{#1}}
+\define at key{\mpi at group}{mem}[]{\def\mpi at mpostmem{#1}}
+\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}{classopt}[]{\def\mpi at latexoptions{[#1]}}
\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}
\define at key{\mpi at group}{globaldef}[true]{\csname mpi at defglobal#1\endcsname}
-\define at key{\mpi at group}{extension}{\def\mpi at extension{#1}}
+\define at key{\mpi at group}{extension}[]{\def\mpi at extension{#1}}
\define at key{\mpi at group}{template}{\def\mpi at template##1{#1}}
\define at key{\mpi at group}{numberwithin}{%
\@addtoreset{mpi at count}{#1}%
@@ -1769,13 +1892,20 @@
% \end{macro}
% \end{macro}
-% \begin{macro}{\mpi at write}
+% \begin{macro}{\mpi at writebuf}
% Write to the file:
% \begin{macrocode}
-\def\mpi at write#1{\ifmpi at write\immediate\write\mpi at out{#1}\fi}
+\def\mpi at writebuf{\ifmpi at write\immediate\write\mpi at out{\the\mpi at buf}\fi}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\mpi at writenow}
+% Write to the immediate buffer:
+% \begin{macrocode}
+\def\mpi at writenow{\ifmpi at nowactive\mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}\fi}
+% \end{macrocode}
+% \end{macro}
+
% \begin{macro}{\mpi at buf}
% \begin{macro}{\mpi at defbuf}
% \begin{macro}{\mpi at nowbuf}
@@ -1836,8 +1966,10 @@
\mpi at ifeq{#1}{\@gobble}{}{%
\mpi at ifeq{#2}{eps}{\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
\mpi at ifeq{#2}{mps}{\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
- \expandafter\mpi at ifeq\expandafter{\mpi at extension}{#2}%
- {\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
+ \ifx\mpi at extension\mpi at empty\else%
+ \expandafter\mpi at ifeq\expandafter{\mpi at extension}{#2}%
+ {\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
+ \fi%
}%
}{\def\mpi at tmp{\mpi at stripfor{#1.#2}#3.}}%
\expandafter\endgroup\mpi at tmp%
@@ -1927,10 +2059,10 @@
% \begin{macrocode}
\newcommand{\mpi at declaredoc}{%
\ifmpi at latex%
- \mpi at putlineno%
\mpi at addbuf{verbatimtex}%
\mpi at addbuf{\mpi at documentclass}%
\mpi at addbuf{etex}%
+ \mpi at addbuf{}%
\fi%
}
% \end{macrocode}
@@ -1966,24 +2098,38 @@
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\mpi at writehead}
+% \begin{macro}{\mpi at declareformat}
+% Write \TeX{} format specifier to buffer:
+% \begin{macrocode}
+\newcommand{\mpi at declareformat}{%
+ \let\mpi at tmp\mpi at texformat%
+ \ifx\mpi at tmp\@undefined\def\mpi at tmp{\ifmpi at latex latex\else tex\fi}\fi%
+ \ifx\mpi at tmp\mpi at empty\else%
+ \mpi at addbuf{verbatimtex}%
+ \mpi at addbuf{\@percentchar &\mpi at tmp}%
+ \mpi at addbuf{etex}%
+ \mpi at addbuf{}%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\mpi at composehead}
% Write file header to buffer;
% declare font inclusion and draft mode,
% write \TeX{} format specifier and \LaTeX{} header:
% \begin{macrocode}
-\newcommand{\mpi at writehead}{%
- \ifmpi at fonts\mpi at addbuf{prologues:=3;}\else\mpi at addbuf{prologues:=2;}\fi%
+\newcommand{\mpi at composehead}{%
+ \mpi at putlineno%
+ \let\mpi at tmp\mpi at prologues%
+ \ifx\mpi at tmp\@undefined\def\mpi at tmp{\ifmpi at latex 3\else 2\fi}\fi%
+ \ifx\mpi at tmp\mpi at empty\else%
+ \mpi at addbuf{prologues:=\mpi at tmp;}%
+ \fi%
\ifmpi at draft\mpi at addbuf{draft:=1;}\fi%
\mpi at addbuf{}%
- \mpi at putlineno%
- \ifx\mpi at compiler\mpi at empty\else%
- \mpi at addbuf{verbatimtex}%
- \mpi at addbuf{\@percentchar &\mpi at texcompiler}%
- \mpi at addbuf{etex}%
- \mpi at addbuf{}%
- \fi%
+ \mpi at declareformat%
\mpi at declaredoc%
- \mpi at addbuf{}%
}
% \end{macrocode}
% \end{macro}
@@ -1998,7 +2144,7 @@
\fi%
\mpi at addbuf{\@percentchar generated from file `\jobname' by mpostinl.sty}%
\ifmpi at include\else%
- \mpi at writehead%
+ \mpi at composehead%
\mpi at addbufexp{\the\mpi at defbuf}%
\fi%
}
@@ -2036,7 +2182,7 @@
\ifmpi at write\immediate\openout\mpi at out\mpostfilename.mp\fi%
\mpi at clearbuf%
\mpi at beginfile%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
% \end{macrocode}
% For include files, write |input| statement to definition buffer
% so that the file will be included by all main files:
@@ -2050,10 +2196,8 @@
% If immediate mode is available fill immediate buffer with header:
% \begin{macrocode}
\else%
- \ifmpi at nowactive%
- \global\mpi at nowbuf={}%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi%
+ \global\mpi at nowbuf={}%
+ \mpi at writenow%
\fi%
\fi%
}
@@ -2072,8 +2216,8 @@
\global\mpi at inbodytrue%
\mpi at clearbuf%
\mpi at begindoc%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at nowactive\mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}\fi%
+ \mpi at writebuf%
+ \mpi at writenow%
\fi%
}
% \end{macrocode}
@@ -2084,22 +2228,36 @@
% \begin{macrocode}
\newcommand{\mpi at compile}[1]{%
\ifmpi at write\ifmpi at compile%
+ \ifx\mpi at mpostcompiler\mpi at empty%
% \end{macrocode}
-% Pass on interactionmode setting to \MP{}:
+% Compose command line for |mpost|;
+% pass on interactionmode setting to \MP{},
+% specify mem filem, specify tex compiler:
% \begin{macrocode}
- \def\mpi at imode{}%
- \ifcase\the\interactionmode%
- \def\mpi at imode{-interaction=batchmode}\or%
- \def\mpi at imode{-interaction=nonstopmode}\or%
- \def\mpi at imode{-interaction=scrollmode}\or%
- \def\mpi at imode{-interaction=errorstopmode}\fi%
+ \def\mpi at imode{}%
+ \ifcase\the\interactionmode%
+ \def\mpi at imode{-interaction=batchmode}\or%
+ \def\mpi at imode{-interaction=nonstopmode}\or%
+ \def\mpi at imode{-interaction=scrollmode}\or%
+ \def\mpi at imode{-interaction=errorstopmode}\fi%
+ \let\mpi at texswitch\mpi at texcompiler%
+ \ifx\mpi at texswitch\@undefined%
+ \def\mpi at texswitch{\ifmpi at latex latex\else tex\fi}%
+ \fi%
+ \def\mpi at execute{mpost\space%
+ \mpi at imode\space%
+ \ifx\mpi at mpostmem\mpi at empty\else -mem=\mpi at mpostmem\space\fi%
+ \ifx\mpi at texswitch\mpi at empty\else -tex=\mpi at texswitch\space\fi%
+ #1}%
+ \else%
% \end{macrocode}
+% Compose custom command:
+% \begin{macrocode}
+ \def\mpi at execute{\mpi at mpostcompiler\space#1}%
+ \fi%
+% \end{macrocode}
% Execute \MP{} by |\write18| command; do it again if needed:
% \begin{macrocode}
- \def\mpi at execute{\mpi at mpostcompiler\space%
- \mpi at imode\space%
- \ifx\mpi at mpostmem\mpi at empty\else -mem=\mpi at mpostmem\space\fi%
- -tex=\mpi at texcompiler\space#1}%
\immediate\write18{\mpi at execute}%
\ifmpi at twice%
\immediate\write18{\mpi at execute}%
@@ -2126,7 +2284,7 @@
% Write end of file and close:
% \begin{macrocode}
\mpi at endfile%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
\ifmpi at write\immediate\closeout\mpi at out\fi%
% \end{macrocode}
% Compile if file contains figures:
@@ -2249,16 +2407,12 @@
\ifmpi at defglobal%
\mpi at addtoexp\mpi at defbuf{\the\mpi at buf^^J}%
\ifmpi at include\else\ifmpi at infile%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at nowactive%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi%
+ \mpi at writebuf%
+ \mpi at writenow%
\fi\fi%
\else%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at include\else\ifmpi at nowactive%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi\fi%
+ \mpi at writebuf%
+ \ifmpi at include\else\mpi at writenow\fi%
\fi%
\@esphack%
}
@@ -2337,7 +2491,7 @@
% \begin{macrocode}
{%
\mpi at endfig%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
\ifmpi at now%
\mpi at processnow%
\fi%
Modified: trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty 2017-02-28 21:24:29 UTC (rev 43358)
+++ trunk/Master/texmf-dist/tex/latex/mpostinl/mpostinl.sty 2017-02-28 21:24:52 UTC (rev 43359)
@@ -17,7 +17,7 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-\ProvidesPackage{mpostinl}[2017/01/04 v1.0 metapost inline figures]
+\ProvidesPackage{mpostinl}[2017/02/27 v1.1 metapost inline figures]
\RequirePackage{verbatim}
\RequirePackage{graphicx}
@@ -29,7 +29,8 @@
\def\mpostfilename{\jobname}
\def\mpi at nowname{\jobname-tmp}
\def\mpi at extension{mps}
-\def\mpi at template#1{\mpostfilename-#1.\mpi at extension}
+\def\mpi at template#1{\mpostfilename-#1%
+ \ifx\mpi at extension\mpi at empty\else.\fi\mpi at extension}
\newcounter{mpi at count}
\def\thempi at count{\arabic{mpi at count}}
@@ -49,8 +50,7 @@
\newif\ifmpi at defglobal\mpi at defglobalfalse
\def\mpi at mpostmem{}
-\def\mpi at mpostcompiler{mpost}
-\def\mpi at texcompiler{latex}
+\def\mpi at mpostcompiler{}
\def\mpi at latexclass{article}
\def\mpi at latexoptions{}
\def\mpi at documentclass{\@backslashchar documentclass%
@@ -65,27 +65,24 @@
\DeclareOption{final}{\mpi at draftfalse}
\define at key{\mpi at group}{draft}[true]{\csname mpi at draft#1\endcsname}
\define at key{\mpi at group}{write}[true]{\csname mpi at write#1\endcsname}
-\define at key{\mpi at group}{latex}[true]{\csname mpi at latex#1\endcsname%
- \ifmpi at latex%
- \def\mpi at texcompiler{latex}%
- \else%
- \def\mpi at texcompiler{tex}%
- \fi}
+\define at key{\mpi at group}{latex}[true]{\csname mpi at latex#1\endcsname}
\define at key{\mpi at group}{compile}[true]{\csname mpi at compile#1\endcsname}
\define at key{\mpi at group}{twice}[true]{\csname mpi at twice#1\endcsname}
\define at key{\mpi at group}{fonts}[true]{\csname mpi at fonts#1\endcsname}
+\define at key{\mpi at group}{prologues}[]{\def\mpi at prologues{#1}}
\define at key{\mpi at group}{lineno}[true]{\csname mpi at lineno#1\endcsname}
\define at key{\mpi at group}{labelnames}[true]{\csname mpi at labelnames#1\endcsname}
-\define at key{\mpi at group}{compiler}{\def\mpi at texcompiler{#1}}
-\define at key{\mpi at group}{mem}{\def\mpi at mpostmem{#1}}
-\define at key{\mpi at group}{command}{\def\mpi at mpostcompiler{#1}}
+\define at key{\mpi at group}{compiler}[]{\def\mpi at texcompiler{#1}}
+\define at key{\mpi at group}{format}[]{\def\mpi at texformat{#1}}
+\define at key{\mpi at group}{mem}[]{\def\mpi at mpostmem{#1}}
+\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}{classopt}[]{\def\mpi at latexoptions{[#1]}}
\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}
\define at key{\mpi at group}{globaldef}[true]{\csname mpi at defglobal#1\endcsname}
-\define at key{\mpi at group}{extension}{\def\mpi at extension{#1}}
+\define at key{\mpi at group}{extension}[]{\def\mpi at extension{#1}}
\define at key{\mpi at group}{template}{\def\mpi at template##1{#1}}
\define at key{\mpi at group}{numberwithin}{%
\@addtoreset{mpi at count}{#1}%
@@ -105,8 +102,10 @@
\newwrite\mpi at out
\newwrite\mpi at outnow
-\def\mpi at write#1{\ifmpi at write\immediate\write\mpi at out{#1}\fi}
+\def\mpi at writebuf{\ifmpi at write\immediate\write\mpi at out{\the\mpi at buf}\fi}
+\def\mpi at writenow{\ifmpi at nowactive\mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}\fi}
+
\newtoks\mpi at buf
\newtoks\mpi at defbuf
\newtoks\mpi at nowbuf
@@ -131,8 +130,10 @@
\mpi at ifeq{#1}{\@gobble}{}{%
\mpi at ifeq{#2}{eps}{\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
\mpi at ifeq{#2}{mps}{\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
- \expandafter\mpi at ifeq\expandafter{\mpi at extension}{#2}%
- {\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
+ \ifx\mpi at extension\mpi at empty\else%
+ \expandafter\mpi at ifeq\expandafter{\mpi at extension}{#2}%
+ {\def\mpi at tmp{\def\mpi at stripped{#1}}}{}%
+ \fi%
}%
}{\def\mpi at tmp{\mpi at stripfor{#1.#2}#3.}}%
\expandafter\endgroup\mpi at tmp%
@@ -177,10 +178,10 @@
\newcommand{\mpi at declaredoc}{%
\ifmpi at latex%
- \mpi at putlineno%
\mpi at addbuf{verbatimtex}%
\mpi at addbuf{\mpi at documentclass}%
\mpi at addbuf{etex}%
+ \mpi at addbuf{}%
\fi%
}
@@ -202,19 +203,28 @@
\fi%
}
-\newcommand{\mpi at writehead}{%
- \ifmpi at fonts\mpi at addbuf{prologues:=3;}\else\mpi at addbuf{prologues:=2;}\fi%
- \ifmpi at draft\mpi at addbuf{draft:=1;}\fi%
- \mpi at addbuf{}%
- \mpi at putlineno%
- \ifx\mpi at compiler\mpi at empty\else%
+\newcommand{\mpi at declareformat}{%
+ \let\mpi at tmp\mpi at texformat%
+ \ifx\mpi at tmp\@undefined\def\mpi at tmp{\ifmpi at latex latex\else tex\fi}\fi%
+ \ifx\mpi at tmp\mpi at empty\else%
\mpi at addbuf{verbatimtex}%
- \mpi at addbuf{\@percentchar &\mpi at texcompiler}%
+ \mpi at addbuf{\@percentchar &\mpi at tmp}%
\mpi at addbuf{etex}%
\mpi at addbuf{}%
\fi%
+}
+
+\newcommand{\mpi at composehead}{%
+ \mpi at putlineno%
+ \let\mpi at tmp\mpi at prologues%
+ \ifx\mpi at tmp\@undefined\def\mpi at tmp{\ifmpi at latex 3\else 2\fi}\fi%
+ \ifx\mpi at tmp\mpi at empty\else%
+ \mpi at addbuf{prologues:=\mpi at tmp;}%
+ \fi%
+ \ifmpi at draft\mpi at addbuf{draft:=1;}\fi%
+ \mpi at addbuf{}%
+ \mpi at declareformat%
\mpi at declaredoc%
- \mpi at addbuf{}%
}
\newcommand{\mpi at beginfile}{%
@@ -223,7 +233,7 @@
\fi%
\mpi at addbuf{\@percentchar generated from file `\jobname' by mpostinl.sty}%
\ifmpi at include\else%
- \mpi at writehead%
+ \mpi at composehead%
\mpi at addbufexp{\the\mpi at defbuf}%
\fi%
}
@@ -244,7 +254,7 @@
\ifmpi at write\immediate\openout\mpi at out\mpostfilename.mp\fi%
\mpi at clearbuf%
\mpi at beginfile%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
\ifmpi at include%
\mpi at clearbuf%
\mpi at putlineno%
@@ -251,10 +261,8 @@
\mpi at addbuf{input \mpostfilename}%
\mpi at addtoexp\mpi at defbuf{\the\mpi at buf^^J}%
\else%
- \ifmpi at nowactive%
- \global\mpi at nowbuf={}%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi%
+ \global\mpi at nowbuf={}%
+ \mpi at writenow%
\fi%
\fi%
}
@@ -265,23 +273,32 @@
\global\mpi at inbodytrue%
\mpi at clearbuf%
\mpi at begindoc%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at nowactive\mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}\fi%
+ \mpi at writebuf%
+ \mpi at writenow%
\fi%
}
\newcommand{\mpi at compile}[1]{%
\ifmpi at write\ifmpi at compile%
- \def\mpi at imode{}%
- \ifcase\the\interactionmode%
- \def\mpi at imode{-interaction=batchmode}\or%
- \def\mpi at imode{-interaction=nonstopmode}\or%
- \def\mpi at imode{-interaction=scrollmode}\or%
- \def\mpi at imode{-interaction=errorstopmode}\fi%
- \def\mpi at execute{\mpi at mpostcompiler\space%
- \mpi at imode\space%
- \ifx\mpi at mpostmem\mpi at empty\else -mem=\mpi at mpostmem\space\fi%
- -tex=\mpi at texcompiler\space#1}%
+ \ifx\mpi at mpostcompiler\mpi at empty%
+ \def\mpi at imode{}%
+ \ifcase\the\interactionmode%
+ \def\mpi at imode{-interaction=batchmode}\or%
+ \def\mpi at imode{-interaction=nonstopmode}\or%
+ \def\mpi at imode{-interaction=scrollmode}\or%
+ \def\mpi at imode{-interaction=errorstopmode}\fi%
+ \let\mpi at texswitch\mpi at texcompiler%
+ \ifx\mpi at texswitch\@undefined%
+ \def\mpi at texswitch{\ifmpi at latex latex\else tex\fi}%
+ \fi%
+ \def\mpi at execute{mpost\space%
+ \mpi at imode\space%
+ \ifx\mpi at mpostmem\mpi at empty\else -mem=\mpi at mpostmem\space\fi%
+ \ifx\mpi at texswitch\mpi at empty\else -tex=\mpi at texswitch\space\fi%
+ #1}%
+ \else%
+ \def\mpi at execute{\mpi at mpostcompiler\space#1}%
+ \fi%
\immediate\write18{\mpi at execute}%
\ifmpi at twice%
\immediate\write18{\mpi at execute}%
@@ -297,7 +314,7 @@
\mpi at addbuf{}%
\fi%
\mpi at endfile%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
\ifmpi at write\immediate\closeout\mpi at out\fi%
\ifmpi at inbody\mpi at compile{\mpostfilename.mp}\fi%
\global\mpi at infilefalse%
@@ -362,16 +379,12 @@
\ifmpi at defglobal%
\mpi at addtoexp\mpi at defbuf{\the\mpi at buf^^J}%
\ifmpi at include\else\ifmpi at infile%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at nowactive%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi%
+ \mpi at writebuf%
+ \mpi at writenow%
\fi\fi%
\else%
- \mpi at write{\the\mpi at buf}%
- \ifmpi at include\else\ifmpi at nowactive%
- \mpi at addtoexp\mpi at nowbuf{\the\mpi at buf^^J}%
- \fi\fi%
+ \mpi at writebuf%
+ \ifmpi at include\else\mpi at writenow\fi%
\fi%
\@esphack%
}
@@ -416,7 +429,7 @@
}%
{%
\mpi at endfig%
- \mpi at write{\the\mpi at buf}%
+ \mpi at writebuf%
\ifmpi at now%
\mpi at processnow%
\fi%
More information about the tex-live-commits
mailing list