From 6abbadaea9dfe91add570fd7a9804e80e4caba66 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 5 May 2012 22:01:17 +0000 Subject: standalone 1.1 (5may12) git-svn-id: svn://tug.org/texlive/trunk@26216 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/standalone/standalone.dtx | 89 +++++++++++++++++++--- 1 file changed, 80 insertions(+), 9 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/standalone/standalone.dtx b/Master/texmf-dist/source/latex/standalone/standalone.dtx index 5901d00fffa..2d8143f71df 100644 --- a/Master/texmf-dist/source/latex/standalone/standalone.dtx +++ b/Master/texmf-dist/source/latex/standalone/standalone.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment %<=*COPYRIGHT> -%% Copyright (C) 2011 by Martin Scharrer +%% Copyright (C) 2011-2012 by Martin Scharrer %% --------------------------------------------------------------------------- %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -14,8 +14,9 @@ %% %% The Current Maintainer of this work is Martin Scharrer. %% -%% This work consists of the files <+name+>.dtx and <+name+>.ins -%% and the derived filebase <+name+>.sty. +%% This work consists of the files standalone.dtx and standalone.ins +%% and the derived filebase standalone.sty, standalone.cls and +%% standalone.cfg. %% %<=/COPYRIGHT> % \fi @@ -25,10 +26,10 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesFile{standalone.dtx}[% %<=*DATE> - 2012/04/13 + 2012/05/05 %<=/DATE> %<=*VERSION> - v1.0b + v1.1 %<=/VERSION> DTX file of the standalone bundle] \documentclass[a4paper,11pt]{ydoc} @@ -42,7 +43,7 @@ \CodelineIndex \RecordChanges \colorlet{keydesc}{opt} -\OnlyDescription +%\OnlyDescription \lstset{numbers=none,columns=fullflexible} \begin{document} \DocInput{\jobname.dtx} @@ -52,7 +53,7 @@ % % \fi % -% \CheckSum{3368} +% \CheckSum{3555} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -75,6 +76,7 @@ % \changes{v0.3}{2010/03/26}{Added package options to automatically copy sub-preamble code to the main preamble.} % \changes{v0.3a}{2010/03/27}{Fixed bug related to line endings in \texttt{.sta} file. Listed sub-files now have \texttt{.tex} as default extension.} % \changes{v0.4}{2011/02/28}{Added option 'border' for easy adjustments of the preview border.} +% \changes{v1.1}{2012/05/05}{Fixed conversion issue with MiKTeX.} % % \GetFileInfo{\jobname.dtx} % @@ -290,6 +292,7 @@ % \DescribeKey{border}'='{~} % \DescribeKey{border}'='{~~~} % This option allows to specify the border used by the \opt{preview} and \opt{crop} options. +% An alternative name of this option is \opt{margin}. % The border can either be given using a single value for all sides, separately for the horizontal and vertical borders or for all sides separately. % Multiple values are separated by spaces, which require the whole value to be wrapped in braces. % @@ -1228,6 +1231,14 @@ % \end{macrocode} % \end{key} % +% \begin{key}{standalone.cls}{margin} +% Alias for \opt{border}. +% \begin{macrocode} +\sa@clsoption{margin}{% + \sa@readborder#1 {} {} {} {} \@nnil +} +% \end{macrocode} +% \end{key} % % \begin{macro}{\sa@boolean}[2]{name of if-switch}{`true' or `false'} % Sets if-switches. @@ -1578,6 +1589,16 @@ % \end{macrocode} % \end{key} % +% \begin{key}{standalone.cls/convert}{realmainfile} +% \begin{macrocode} +\sa@convertoption{realmainfile}[]{% + \RequirePackage{currfile-abspath}% + \getmainfile + \let\sa@convert@mainfile\themainfile +} +% \end{macrocode} +% \end{key} +% % % \begin{key}{standalone.cls/convert}{jpg} % \begin{macrocode} @@ -1698,7 +1719,11 @@ % \end{key} % % \begin{macrocode} +\sa@convertvar{latexoptions}{ -shell-escape } \sa@convertvar{subjobname}{\jobname} +\sa@convertvar{mainfile}{\jobname} +\sa@convertvar{quote}{} +\let\sa@convert@quote\relax \sa@convertvar{size}{} \sa@convertvar{inname}{\subjobname} \sa@convertvar{infile}{\inname\inext} @@ -1845,6 +1870,47 @@ } % \end{macrocode} % +% Set correct quoting character for conversion option if none was set. +% \begin{macrocode} +\ifsa@convert +\ifx\sa@convert@quote\relax +\begingroup +\@tempswafalse +% \end{macrocode} +% If \Macro\pdftexbanner is not defined (XeLaTeX) the distribution can not +% be determined and double quotes are set to ensure proper operation under MiKTeX. +% \begin{macrocode} +\expandafter\ifx\csname pdftexbanner\endcsname\relax + \@tempswatrue +\else +% \end{macrocode} +% Test if there is a `|MiKTeX|' in \Macro\pdftexbanner. +% \begin{macrocode} +\def\MiKTeX{MiKTeX} +\@onelevel@sanitize\MiKTeX +\expandafter\def\expandafter\testmiktex\expandafter#\expandafter1\MiKTeX#2\relax{% + \ifx\empty#2\empty + \@tempswafalse + \else + \@tempswatrue + \fi +} +\expandafter\expandafter +\expandafter\testmiktex\expandafter\pdftexbanner\MiKTeX\relax\relax + +\fi +\expandafter +\endgroup +\if@tempswa +\def\sa@convert@quote{"} +\else +\def\sa@convert@quote{'} +\fi +\fi +\fi +% \end{macrocode} +% +% % Loads the class given by the |class| option with the rest of the options. % \begin{macrocode} \expandafter\expandafter\expandafter\LoadClass @@ -2324,7 +2390,10 @@ }{% \def\filemodbefore{}% }}}}% - \immediate\write18{\sa@convert@latex\space -jobname '\sa@convert@subjobname' '\noexpand\expandafter\def\noexpand\csname sa@internal@run\noexpand\endcsname{1}\noexpand\input{\jobname}'}% + \immediate\write18{\sa@convert@latex\space\sa@convert@latexoptions\space + -jobname \sa@convert@quote\sa@convert@subjobname\sa@convert@quote\space + \sa@convert@quote\string\expandafter\string\def\string\csname\space + sa@internal@run\string\endcsname{1}\string\input{\sa@convert@mainfile}\sa@convert@quote}% \edef\sa@convert@precommand{\sa@convert@precommand}% \ifx\sa@convert@precommand\@empty\else \immediate\write18{\sa@convert@precommand}% @@ -2354,7 +2423,7 @@ \sa@convert@failuremsg{standalone}{#1}{}% \fi \else - \ClassInfo{standalone}{Conversion successful.}% + \typeout{Class standalone:^^JOutput written on \outfile.}% \fi \else \sa@convert@failuremsg{standalone}{#1}{}% @@ -2366,6 +2435,7 @@ % Provide the internal macros to the user level. % \begin{macrocode} \let\subjobname\sa@convert@subjobname +\let\mainfile\sa@convert@mainfile \let\infile\sa@convert@infile \let\inext\sa@convert@inext \let\inname\sa@convert@inname @@ -2378,6 +2448,7 @@ \let\outname\sa@convert@outname \let\outfile\sa@convert@outfile \let\percent\@percentchar +\let\quote\sa@convert@quote % \end{macrocode} % % -- cgit v1.2.3