summaryrefslogtreecommitdiff
path: root/macros/latex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex')
-rw-r--r--macros/latex/contrib/adjustbox/README.txt5
-rw-r--r--macros/latex/contrib/adjustbox/adjcalc.pdfbin162884 -> 163025 bytes
-rw-r--r--macros/latex/contrib/adjustbox/adjustbox.dtx7
-rw-r--r--macros/latex/contrib/adjustbox/adjustbox.ins1
-rw-r--r--macros/latex/contrib/adjustbox/adjustbox.pdfbin393152 -> 393419 bytes
-rw-r--r--macros/latex/contrib/adjustbox/trimclip.dtx6
-rw-r--r--macros/latex/contrib/adjustbox/trimclip.pdfbin225437 -> 225602 bytes
-rw-r--r--macros/latex/contrib/codehigh/codehigh.lua4
-rw-r--r--macros/latex/contrib/codehigh/codehigh.pdfbin101064 -> 97843 bytes
-rw-r--r--macros/latex/contrib/codehigh/codehigh.sty41
-rw-r--r--macros/latex/contrib/codehigh/codehigh.tex6
-rw-r--r--macros/latex/contrib/collcell/Makefile86
-rw-r--r--macros/latex/contrib/collcell/README.txt (renamed from macros/latex/contrib/collcell/README)5
-rw-r--r--macros/latex/contrib/collcell/collcell.dtx175
-rw-r--r--macros/latex/contrib/collcell/collcell.ins45
-rw-r--r--macros/latex/contrib/collcell/collcell.pdfbin274551 -> 199674 bytes
-rw-r--r--macros/latex/contrib/emulateapj/README110
-rw-r--r--macros/latex/contrib/emulateapj/emulateapj.cls73
-rw-r--r--macros/latex/contrib/knowledge/README.md4
-rw-r--r--macros/latex/contrib/knowledge/knowledge-code.dtx9
-rw-r--r--macros/latex/contrib/knowledge/knowledge-example.tex13
-rw-r--r--macros/latex/contrib/knowledge/knowledge.pdfbin802176 -> 802887 bytes
-rw-r--r--macros/latex/contrib/knowledge/knowledge.tex1
-rw-r--r--macros/latex/contrib/siunitx/CHANGELOG.md9
-rw-r--r--macros/latex/contrib/siunitx/siunitx-code.pdfbin291624 -> 291901 bytes
-rw-r--r--macros/latex/contrib/siunitx/siunitx-table.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.dtx2
-rw-r--r--macros/latex/contrib/siunitx/siunitx.pdfbin593712 -> 593711 bytes
-rw-r--r--macros/latex/contrib/standalone/DEPENDS.txt2
-rw-r--r--macros/latex/contrib/standalone/README21
-rw-r--r--macros/latex/contrib/standalone/README.txt16
-rw-r--r--macros/latex/contrib/standalone/standalone.dtx483
-rw-r--r--macros/latex/contrib/standalone/standalone.pdfbin280807 -> 285489 bytes
33 files changed, 641 insertions, 485 deletions
diff --git a/macros/latex/contrib/adjustbox/README.txt b/macros/latex/contrib/adjustbox/README.txt
index 5bf3065789..76fef7b8e1 100644
--- a/macros/latex/contrib/adjustbox/README.txt
+++ b/macros/latex/contrib/adjustbox/README.txt
@@ -1,6 +1,6 @@
LaTeX bundle adjustbox
========================
-Copyright (c) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+Copyright (c) 2011-2025 by Martin Scharrer <martin.scharrer@web.de>
License: LaTeX Project Public License, v1.3 or later: http://www.latex-project.org/lppl.txt
Repository: https://github.com/MartinScharrer/adjustbox
Issues: https://github.com/MartinScharrer/adjustbox/issues
@@ -26,3 +26,6 @@ macro argument. This allows for all forms of content including special material
A special feature of collectbox is used to provide matching environments with the identical names as the
macros.
+[![CTAN](https://img.shields.io/ctan/l/adjustbox)](http://www.latex-project.org/lppl/)
+[![CTAN](https://img.shields.io/ctan/v/adjustbox)](http://www.ctan.org/pkg/adjustbox)
+[![GitHub issues](https://img.shields.io/github/issues/MartinScharrer/adjustbox)](https://github.com/MartinScharrer/adjustbox/issues )
diff --git a/macros/latex/contrib/adjustbox/adjcalc.pdf b/macros/latex/contrib/adjustbox/adjcalc.pdf
index 9d68f19015..c2ed0c5c1a 100644
--- a/macros/latex/contrib/adjustbox/adjcalc.pdf
+++ b/macros/latex/contrib/adjustbox/adjcalc.pdf
Binary files differ
diff --git a/macros/latex/contrib/adjustbox/adjustbox.dtx b/macros/latex/contrib/adjustbox/adjustbox.dtx
index 170e02434f..ad323a0b80 100644
--- a/macros/latex/contrib/adjustbox/adjustbox.dtx
+++ b/macros/latex/contrib/adjustbox/adjustbox.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+%% Copyright (C) 2011-2025 by Martin Scharrer <martin.scharrer@web.de>
%% -------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,10 +26,10 @@
%<*driver>
\ProvidesFile{adjustbox.dtx}[%
%<=*DATE>
- 2022/10/17
+ 2025/02/21
%<=/DATE>
%<=*VERSION>
- v1.3a
+ v1.3b
%<=/VERSION>
DTX file for the adjustbox package]
\documentclass[a4paper]{ydoc}[2011/08/11]
@@ -268,6 +268,7 @@
% * Updated documentation with new repository URL and new email address.
% * Added dependency file for texlive.
% }
+% \changes{v1.3b}{2025/02/21}{Added missing tc-luatex.def into .ins file.}
%
% \GetFileInfo{adjustbox.dtx}
%
diff --git a/macros/latex/contrib/adjustbox/adjustbox.ins b/macros/latex/contrib/adjustbox/adjustbox.ins
index 196015c47c..d6d750f566 100644
--- a/macros/latex/contrib/adjustbox/adjustbox.ins
+++ b/macros/latex/contrib/adjustbox/adjustbox.ins
@@ -9,6 +9,7 @@
\file{tc-pdftex.def}{\nopreamble\from{trimclip.dtx}{tc-pdftex.def}}%
\file{tc-dvips.def}{\nopreamble\from{trimclip.dtx}{tc-dvips.def}}%
\file{tc-xetex.def}{\nopreamble\from{trimclip.dtx}{tc-xetex.def}}%
+ \file{tc-luatex.def}{\nopreamble\from{trimclip.dtx}{tc-luatex.def}}%
\file{box.tex}{\nopreamble\nopostamble\from{trimclip.dtx}{box.tex}}%
\file{compare.tex}{\nopreamble\nopostamble\from{trimclip.dtx}{compare.tex}}%
\file{margin2.tex}{\nopreamble\nopostamble\from{trimclip.dtx}{margin2.tex}}%
diff --git a/macros/latex/contrib/adjustbox/adjustbox.pdf b/macros/latex/contrib/adjustbox/adjustbox.pdf
index 1861fdb0f7..d960f68c64 100644
--- a/macros/latex/contrib/adjustbox/adjustbox.pdf
+++ b/macros/latex/contrib/adjustbox/adjustbox.pdf
Binary files differ
diff --git a/macros/latex/contrib/adjustbox/trimclip.dtx b/macros/latex/contrib/adjustbox/trimclip.dtx
index a82cefd6b9..f612b0d2cf 100644
--- a/macros/latex/contrib/adjustbox/trimclip.dtx
+++ b/macros/latex/contrib/adjustbox/trimclip.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2011-2022 by Martin Scharrer <martin.scharrer@web.de>
+%% Copyright (C) 2011-2025 by Martin Scharrer <martin.scharrer@web.de>
%% -------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,10 +26,10 @@
%<*driver>
\ProvidesFile{trimclip.dtx}[%
%<=*DATE>
- 2020/08/19
+ 2025/02/21
%<=/DATE>
%<=*VERSION>
- v1.2
+ v1.2a
%<=/VERSION>
DTX file for the trimclip package]
\documentclass[a4paper]{ydoc}[2011/11/16]
diff --git a/macros/latex/contrib/adjustbox/trimclip.pdf b/macros/latex/contrib/adjustbox/trimclip.pdf
index 4de93cc7b7..dc8db1d56a 100644
--- a/macros/latex/contrib/adjustbox/trimclip.pdf
+++ b/macros/latex/contrib/adjustbox/trimclip.pdf
Binary files differ
diff --git a/macros/latex/contrib/codehigh/codehigh.lua b/macros/latex/contrib/codehigh/codehigh.lua
index 798e070119..aee8bb7533 100644
--- a/macros/latex/contrib/codehigh/codehigh.lua
+++ b/macros/latex/contrib/codehigh/codehigh.lua
@@ -90,6 +90,10 @@ local function FindMatch(lang, code)
return b, e, s
end
+---- We can not use "catcodetable@string" because space has catcode 10 with it,
+---- which causes multiple spaces are printed as single space in "tex.tprint".
+-- local cctab = luatexbase.registernumber("catcodetable@string")
+
---- We don't have "catcodetable@other" inside source2e
-- local cctab = luatexbase.registernumber("catcodetable@other")
---- Here is the catcodetable from luatexbase package
diff --git a/macros/latex/contrib/codehigh/codehigh.pdf b/macros/latex/contrib/codehigh/codehigh.pdf
index 0d036968b7..c58d14abfa 100644
--- a/macros/latex/contrib/codehigh/codehigh.pdf
+++ b/macros/latex/contrib/codehigh/codehigh.pdf
Binary files differ
diff --git a/macros/latex/contrib/codehigh/codehigh.sty b/macros/latex/contrib/codehigh/codehigh.sty
index 6cd88621fb..d938e541cf 100644
--- a/macros/latex/contrib/codehigh/codehigh.sty
+++ b/macros/latex/contrib/codehigh/codehigh.sty
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\ProvidesExplPackage{codehigh}{2025-02-15}{2025B}
+\ProvidesExplPackage{codehigh}{2025-02-21}{2025C}
{Highlight codes and demos with l3regex and lpeg}
%\RequirePackage{xparse}
@@ -65,11 +65,14 @@
\keys_set:nn {codehigh} {#2}
}
+\cs_new_eq:NN \codehighspace \space
+
\keys_define:nn {codehigh}
{
lite .bool_set:N = \l__cdhh_lite_bool,
long .bool_set:N = \l__cdhh_long_bool,
demo .bool_set:N = \l__cdhh_demo_bool,
+ visiblespace .code:n = { \cs_set_eq:NN \codehighspace \verbvisiblespace }
}
%%% -------------------------------------------------------
@@ -153,6 +156,8 @@
\NewCodeHighEnv {codehigh} {}
\NewCodeHighEnv {demohigh} {demo}
+\NewCodeHighEnv {codehigh*} {visiblespace}
+\NewCodeHighEnv {demohigh*} {demo,visiblespace}
\tl_new:N \l__cdhh_input_tl
\seq_new:N \l__cdhh_input_seq
@@ -520,7 +525,7 @@
{
\tl_concat:NNN \l__cdhh_a_tl
\l__cdhh_regex_before_text_tl \l__cdhh_regex_match_text_tl
- \str_remove_once:NV \l__cdhh_code_to_parse_tl \l__cdhh_a_tl
+ \tl_remove_once:NV \l__cdhh_code_to_parse_tl \l__cdhh_a_tl
\__cdhh_tracing:nn {parser}
{\tl_log:N \l__cdhh_code_to_parse_tl}
\__cdhh_typeset_text:nN {0}
@@ -603,8 +608,15 @@
\cs_new_protected:Npn \__cdhh_typeset_text:nN #1 #2
{
\__cdhh_tracing:nn {parser} { \tl_log:e { type: #1; ~ text: #2 } }
- \sys_if_engine_luatex:T
- { \tl_replace_all:Nnn #2 { ~ } { \leavevmode \space } }
+ \sys_if_engine_luatex:TF
+ {
+ \tl_replace_all:NVn #2
+ \c_catcode_other_space_tl { \leavevmode \codehighspace }
+ }
+ {
+ \tl_replace_all:NVn #2
+ \c_catcode_active_space_tl { \leavevmode \codehighspace }
+ }
\__cdhh_seq_set_split:NnV \l__cdhh_typeset_text_seq {^^J} #2
\seq_map_indexed_inline:Nn \l__cdhh_typeset_text_seq
{
@@ -623,7 +635,7 @@
\cs_new_protected:Npn \__cdhh_parse_code_lite:N #1
{
\regex_replace_all:nnN { \n } { \c{par} \c{leavevmode} } #1
- \regex_replace_all:nnN { \ } { \c{relax} \c{space} } #1
+ \regex_replace_all:nnN { \ } { \c{relax} \c{codehighspace} } #1
\tl_use:N #1
}
@@ -632,23 +644,32 @@
%%% -------------------------------------------------------
\tl_const:Nn \c__cdhh_fake_escape_tl { \\\{\}\#\^\ \% }
+\tl_new:N \l__cdhh_multibyte_char_tl
\NewDocumentCommand \fakeverb { +m }
{
\group_begin:
\group_align_safe_begin:
\ttfamily \frenchspacing
+ \tl_clear:N \l__cdhh_multibyte_char_tl
\tl_analysis_map_inline:nn {#1}
{
- \int_compare:nNnTF {##2} = { -1 }
+ \int_compare:nNnTF {##2} > { 127 } % utf8 characters in pdftex
+ { \tl_put_right:Ne \l__cdhh_multibyte_char_tl {##1} }
{
- \exp_args:NNo \tl_if_in:NnTF \c__cdhh_fake_escape_tl {##1}
- { \exp_after:wN \cs_to_str:N ##1 }
+ \tl_use:N \l__cdhh_multibyte_char_tl
+ \tl_clear:N \l__cdhh_multibyte_char_tl
+ \int_compare:nNnTF {##2} = { -1 }
+ {
+ \exp_args:NNo \tl_if_in:NnTF \c__cdhh_fake_escape_tl {##1}
+ { \exp_after:wN \cs_to_str:N ##1 }
+ { \exp_after:wN \token_to_str:N ##1 }
+ }
{ \exp_after:wN \token_to_str:N ##1 }
+ \/ % disable ligatures (#17)
}
- { \exp_after:wN \token_to_str:N ##1 }
- \/ % disable ligatures (#17)
}
+ \tl_use:N \l__cdhh_multibyte_char_tl
\group_align_safe_end:
\group_end:
}
diff --git a/macros/latex/contrib/codehigh/codehigh.tex b/macros/latex/contrib/codehigh/codehigh.tex
index 4facd39117..010c9d3538 100644
--- a/macros/latex/contrib/codehigh/codehigh.tex
+++ b/macros/latex/contrib/codehigh/codehigh.tex
@@ -2,7 +2,7 @@
\documentclass[oneside]{book}
\usepackage[a4paper,margin=2cm]{geometry}
-\newcommand*{\myversion}{2025B}
+\newcommand*{\myversion}{2025C}
\newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
\newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
@@ -117,6 +117,8 @@ Seven & Eight & Nine \\
\end{tabular}
\end{codehigh}
+There is also a \texttt{codehigh*} environment which shows each space character as \textvisiblespace{} in the code.
+
\section{Highlighting Demo}
The followings are typeset by \verb!demohigh! environment with option \verb!language=latex/table!.
@@ -143,6 +145,8 @@ The followings are typeset by \verb!demohigh! environment with option \verb!lang
Note that \verb!demohigh! environment will measure the width of source lines.
When it is too large, the result will be put below.
+There is also a \texttt{demohigh*} environment which shows each space character as \textvisiblespace{} in the code.
+
\section{Highlighting File}
Using \verb!\dochighinput! command, you can input and highlight some file.
diff --git a/macros/latex/contrib/collcell/Makefile b/macros/latex/contrib/collcell/Makefile
deleted file mode 100644
index 1c9d16be7d..0000000000
--- a/macros/latex/contrib/collcell/Makefile
+++ /dev/null
@@ -1,86 +0,0 @@
-TEXMF=${HOME}/texmf
-INSTALLDIR=${TEXMF}/tex/latex/collcell
-DOCINSTALLDIR=${TEXMF}/doc/latex/collcell
-CP=cp
-RMDIR=rm -rf
-PDFLATEX=pdflatex -interaction=batchmode
-LATEXMK=latexmk -pdf -silent
-
-PACKEDFILES=collcell.sty
-DOCFILES=collcell.pdf
-SRCFILES=collcell.dtx collcell.ins README Makefile
-
-all: unpack doc
-
-package: unpack
-class: unpack
-
-${PACKEDFILES}: collcell.dtx collcell.ins
- yes | pdflatex collcell.ins
-
-unpack: ${PACKEDFILES}
-
-# 'doc' and 'collcell.pdf' call itself until everything is stable
-doc: collcell.pdf
- @${MAKE} --no-print-directory collcell.pdf
-
-pdfopt: doc
- @-pdfopt collcell.pdf .temp.pdf && mv .temp.pdf collcell.pdf
-
-collcell.pdf: collcell.dtx collcell.gls collcell.ind
- ${LATEXMK} collcell.dtx
-
-collcell.idx collcell.glo: collcell.dtx
- ${LATEXMK} collcell.dtx
-
-collcell.ind: collcell.idx
- -makeindex -s gind.ist -o "$@" "$<"
-
-collcell.gls: collcell.glo
- -makeindex -s gglo.ist -o "$@" "$<"
-
-.PHONY: test
-
-test: unpack
- for T in test*.tex; do echo "$$T"; pdflatex -interaction=batchmode $$T && echo "OK" || echo "Failure"; done
-
-clean:
- -latexmk -C collcell.dtx
- ${RM} ${PACKEDFILES} *.zip *.log *.aux *.toc *.vrb *.nav *.pdf *.snm *.out *.fdb_latexmk *.glo *.gls *.hd *.sta *.stp *.cod
- ${RMDIR} tds
-
-install: unpack doc ${INSTALLDIR} ${DOCINSTALLDIR}
- ${CP} ${PACKEDFILES} ${INSTALLDIR}
- ${CP} ${DOCFILES} ${DOCINSTALLDIR}
- texhash ${TEXMF}
-
-${INSTALLDIR}:
- mkdir -p $@
-
-${DOCINSTALLDIR}:
- mkdir -p $@
-
-ctanify: ${SRCFILES} ${DOCFILES} collcell.tds.zip
- ${RM} collcell.zip
- zip collcell.zip $^
- unzip -t collcell.zip
- unzip -t collcell.tds.zip
-
-zip: collcell.zip
-
-tdszip: collcell.tds.zip
-
-collcell.zip: ${SRCFILES} ${DOCFILES} | pdfopt
- ${RM} $@
- zip $@ $^
-
-collcell.tds.zip: ${SRCFILES} ${PACKEDFILES} ${DOCFILES} | pdfopt
- ${RMDIR} tds
- mkdir -p tds/tex/latex/collcell
- mkdir -p tds/doc/latex/collcell
- mkdir -p tds/source/latex/collcell
- ${CP} ${DOCFILES} tds/doc/latex/collcell
- ${CP} ${PACKEDFILES} tds/tex/latex/collcell
- ${CP} ${SRCFILES} tds/source/latex/collcell
- cd tds; zip -r ../$@ .
-
diff --git a/macros/latex/contrib/collcell/README b/macros/latex/contrib/collcell/README.txt
index 8201f91aa2..d4edae635a 100644
--- a/macros/latex/contrib/collcell/README
+++ b/macros/latex/contrib/collcell/README.txt
@@ -1,7 +1,8 @@
The collcell Package
--------------------
-Copyright (C) 2009-2011 by Martin Scharrer <martin@scharrer-online.de>
-http://www.ctan.org/pkg/collcell/
+Copyright (c) 2009-2025 by Martin Scharrer <martin.scharrer@web.de>
+CTAN: http://www.ctan.org/pkg/collcell/
+Code repository: https://github.com/MartinScharrer/collcell/
This package provides macros which collect the cell content of
a tabular and provide it to a macro as argument. It was inspired by the
diff --git a/macros/latex/contrib/collcell/collcell.dtx b/macros/latex/contrib/collcell/collcell.dtx
index 6a0846c321..70ab3090e2 100644
--- a/macros/latex/contrib/collcell/collcell.dtx
+++ b/macros/latex/contrib/collcell/collcell.dtx
@@ -1,37 +1,37 @@
% \iffalse meta-comment
-%
-% Copyright (C) 2009-2011 by Martin Scharrer <martin@scharrer-online.de>
-% ----------------------------------------------------------------------
-%
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3c
-% of this license or (at your option) any later version.
-% The latest version of this license is in
-%
-% http://www.latex-project.org/lppl.txt
-%
-% and version 1.3c or later is part of all distributions of LaTeX
-% version 2008/05/04 or later.
-%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Martin Scharrer.
-%
-% This work consists of the files collcell.dtx, collcell.ins
-% and the derived file collcell.sty.
-%
+%<=*COPYRIGHT>
+%% Copyright (c) 2009-2025 by Martin Scharrer <martin.scharrer@web.de>
+%% ----------------------------------------------------------------------
+%% 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
+%% 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 Martin Scharrer.
+%%
+%% This work consists of the files collcell.dtx and collcell.ins
+%% and the derived filebase collcell.sty.
+%%
+%<=/COPYRIGHT>
% \fi
-%%^^A $Id: collcell.dtx 2188 2011-02-27 14:22:06Z martin $
%
% \iffalse
-%<package>\ProvidesPackage{collcell}
-%<*driver>
-\ProvidesFile{collcell.dtx}
-%</driver>
- [2011/02/27 v0.5 Collect the content of a tabular cell]
%<*driver>
-\documentclass{ydoc}
-\GetFileInfo{\jobname.dtx}
+\ProvidesFile{collcell.dtx}[%
+%<=*DATE>
+ 2025/02/21
+%<=/DATE>
+%<=*VERSION>
+ v0.6
+%<=/VERSION>
+ DTX file for collcell]
+\documentclass{ydoc}[2011/03/19]
+\GetFileInfo{collcell.dtx}
\usepackage[robustcr]{collcell}[\filedate]
\usepackage{tikz-timing}
\lstset{language=[latex]tex,basicstyle=\ttfamily}
@@ -48,7 +48,7 @@
%</driver>
% \fi
%
-% \CheckSum{334}
+% \CheckSum{358}
%
% \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
@@ -71,30 +71,14 @@
% \changes{v0.1}{2011/02/04}{First released version}
% \changes{v0.1a}{2011/02/05}{Fixed unwanted spaces. Fixed misspelled macros in example.}
% \changes{v0.5}{2011/02/27}{Fixed several bugs and limitations. (Complete list to be inserted)}
-%
+% \changes{v0.6}{2025/02/21}{Add support for \textonly@unskip. Support nesting of environments in cells.}
%
% \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\xdef,\DeclareRobustCommand}
%
% \GetFileInfo{\jobname.dtx}
-% \ifpdf
-% \hypersetup{%
-% pdfauthor = {Martin Scharrer <martin@scharrer-online.de>},
-% pdftitle = {The collcell package},
-% pdfsubject = {Documentation of LaTeX package collcell},
-% pdfkeywords = {collcell, LaTeX, TeX}
-% }%
-% \fi
-% \clearpage
-% \null
-% \vspace*{-2em}
-% \begin{center}
-% {\LARGE The \textsf{collcell} Package\\[\medskipamount]}
-% {\large Martin Scharrer \\[\medskipamount]\normalsize
-% \url{martin@scharrer-online.de}\\[.8ex]
-% \url{http://www.ctan.org/pkg/collcell/}\\[\medskipamount]}
-% {\large Version \fileversion\ -- \filedate}\\
-% \end{center}
-% \vspace{1.2em}%
+% \author{Martin Scharrer}
+% \email{martin.scharrer@web.de}
+% \maketitle
%
% \begin{abstract}
% This package provides macros which collect the cell content of a tabular
@@ -129,7 +113,7 @@
% ||\\
% |% Document:|\\
% |\begin{tabular}{lE}|\\
-% | A & Example \\ % Same as \usermacro{Example} |\\
+% | A & Example \\ % Same as \usermacro{Example} |\\
% | B & Text \\ % Same as \usermacro{Text} |\\
% |\end{tabular}|\\
% \par\medskip
@@ -143,21 +127,18 @@
% in braces `|{ }|' to ensure proper operation.
%
% \subsection{Options}
-% The following options are supported:
-% \begin{description}
-% \item[verb] \null
-% \item[noverb] (Default |noverb|) Enables or disables the definition of a special almost-verbatim version of \verb+\verb+.
-% At the moment the one defined by the \pkg{tabularx} package is used, which is therefore loaded when this feature is enabled.
-% Future versions of \pkg{collcell} might provide this macro in a different way, so the visual result might be different.
-% The \pkg{tabularx} should be loaded explicitly if it is used.
-% This version of \verb+\verb+ will read the content first normally, i.e. non-verbatim, and then print the included tokens in a verbatim format.
-% The content must include a balanced number of |{ }| and must not be end with |\|. Macros inside the content will be followed by a space.
-% See the manual of \pkg{tabularx} (page 8 in the version from 1999/01/07) for a more detailed description.
-% \item[robustcr]
-% \item[norobustcr] (Default |robustcr|) This options enable or disable the redefinition of |\\| to a robust version, i.e. this macro
-% will be prefixed with eTeX's |\protected| to ensure that it isn't expanded by the underlying |\halign|. If this feature disabled the
-% last cell of a tabular must not be empty or only hold empty macros (like |\empty|).
-% \end{description}
+%
+% The~\opt*{verb} and~\opt*{noverb} options enable or disable (default) the definition of a special almost-verbatim version of \verb+\verb+.
+% At the moment the one defined by the \pkg{tabularx} package is used, which is therefore loaded when this feature is enabled.
+% Future versions of \pkg{collcell} might provide this macro in a different way, so the visual result might be different.
+% The \pkg{tabularx} should be loaded explicitly if it is used.
+% This version of \verb+\verb+ will read the content first normally, i.e. non-verbatim, and then print the included tokens in a verbatim format.
+% The content must include a balanced number of |{ }| and must not be end with |\|. Macros inside the content will be followed by a space.
+% See the manual of \pkg{tabularx} (page 8 in the version from 1999/01/07) for a more detailed description.
+%
+% The~\opt*{robustcr} and \opt*{norobustcr} options enable (default) or disable the redefinition of |\\| to a robust version, i.e. this macro
+% will be prefixed with eTeX's |\protected| to ensure that it isn't expanded by the underlying |\halign|. If this feature disabled the
+% last cell of a tabular must not be empty or only hold empty macros (like |\empty|).
%
% \subsection{Limitations}
%
@@ -172,6 +153,7 @@
% If this expansion is unwanted the non-expandable token \Macro\cci should be placed at the beginning of the cell. This macro will be ignored (discarded) by \pkg{collcell} and
% will not be provided to the user macro (|cci| = collect cell; ignore).
%
+% \clearpage
% \section{Tests and Examples}
%
% \begin{example}
@@ -233,10 +215,22 @@
%
% \StopEventually{}
% \clearpage
+%
+% \section{Implementation}
+%
% \iffalse
-%<*package>
+%<*collcell.sty>
% \fi
-% \section{Implementation}
+% \begin{macrocode}
+%<!COPYRIGHT>
+\ProvidesPackage{collcell}[%
+%<!DATE>
+%<!VERSION>
+%<*DRIVER>
+ 2099/01/01 develop
+%</DRIVER>
+ Collect the content of a tabular cell]
+% \end{macrocode}
%
% \begin{macrocode}
\RequirePackage{array}
@@ -349,7 +343,7 @@
%
% \begin{macro}{\collect@cell@group}
% Tests if the previous discovered |begin-group character {| token was a |\bgroup| or a |{|.
-% In the first case the command sequence is simply added but in the second case the surrounding
+% In the first case the command sequence is simply added but in the second case the surrounding
% braces must be added again.
% The use of |\unexpanded| allows |#| in the cells, e.g. for in-cell macro definitions.
% \begin{macrocode}
@@ -412,7 +406,7 @@
\endgroup
\expandafter\@secondoftwo
\fi
- {\collect@cell@cr\\\csname#1\endcsname}%
+ {\collect@cell@cr\tabularnewline\csname#1\endcsname}%
{\collect@cell@addarg{\csname#1\endcsname}\collect@cell@look}%
}
% \end{macrocode}
@@ -420,7 +414,7 @@
%
% \begin{macro}{\collect@cell@checkend}[1]{The argument of an \string\end~macro}
% Reads the argument of |\end| and checks if it is identical to the current environment (|tabular|, |array|, |tabularx|, ...).
-% If so the collecting of token is ended, otherwise the |\end| and its argument are added to the
+% If so the collecting of token is ended, otherwise the |\end| and its argument are added to the
% \begin{macrocode}
\def\collect@cell@checkend#1{%
\begingroup
@@ -432,7 +426,7 @@
\endgroup
\expandafter\@secondoftwo
\fi
- {\collect@cell@cr\\\end{#1}}%
+ {\collect@cell@cr\tabularnewline\end{#1}}%
{\collect@cell@addarg{\end{#1}}\collect@cell@look}%
}
% \end{macrocode}
@@ -492,7 +486,7 @@
% \end{macro}
%
% \begin{macro}{\collect@cell@cr}
-% Redefines the table line/row end macro |\cr| so that
+% Redefines the table line/row end macro |\cr| so that
% token collection is restarted after the real |\cr| is expanded
% and the end material defined by `<{}` is inserted.
%
@@ -507,7 +501,6 @@
\iffalse{\fi
\let\collcell@realcr\cr
\def\cr{%
- \expandafter
\collect@cell@look
\collcell@realcr
}%
@@ -517,6 +510,8 @@
% \end{macro}
%
% \begin{macro}{\collect@cell@arg}
+% \begin{macro}{\collect@cell@grab}
+% \begin{macro}{\l@collect@cell@env@cnt}
% Handles the arguments.
% The first token of the argument is still in the |lettoken| macro which is compared
% against a list of possible end tokens.
@@ -525,7 +520,17 @@
% \begin{macrocode}
\def\collect@cell@arg#1{%
\cc@case
- \\{\collect@cell@cr#1}%
+ \tabularnewline{\ifnum\l@collect@cell@env@cnt=0 %
+ \expandafter\collect@cell@cr
+ \else
+ \expandafter\collect@cell@grab
+ \fi
+ #1%
+ }%
+ \begin{\advance\l@collect@cell@env@cnt by 1 %
+ \collect@cell@grab\begin}%
+ \end{\advance\l@collect@cell@env@cnt by -1 %
+ \collect@cell@checkend}%
\end{\collect@cell@checkend}%
\csname{\collect@cell@checkcsname}%
\unskip{%
@@ -533,6 +538,10 @@
%\collect@cell@addarg{#1}% do not include the \unskip
\collect@cell@look%
}%
+ \textonly@unskip{%
+ \let\collect@cell@spaces\empty
+ \collect@cell@look%
+ }%
\@sharp{%
\expandafter\collect@cell@addarg\expandafter{#1}%
\collect@cell@look
@@ -563,7 +572,7 @@
\else
\expandafter\@secondoftwo
\fi
- {\collect@cell@cr\\#1}%
+ {\collect@cell@cr\tabularnewline#1}%
{%
\collect@cell@addarg{#1}%
\collect@cell@look
@@ -571,12 +580,20 @@
}%
\endcc@case
}
+\long\def\collect@cell@grab#1{%
+ \collect@cell@addarg{#1}%
+ \collect@cell@look
+}
+\newcount\l@collect@cell@env@cnt
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
-%
-% \Finale
% \iffalse
-%</package>
+%</collcell.sty>
% \fi
+%
+% \Finale
+% \endinput
diff --git a/macros/latex/contrib/collcell/collcell.ins b/macros/latex/contrib/collcell/collcell.ins
index 4f8eba3b56..d59a2e771b 100644
--- a/macros/latex/contrib/collcell/collcell.ins
+++ b/macros/latex/contrib/collcell/collcell.ins
@@ -1,49 +1,10 @@
-%% $Id: collcell.ins 2128 2011-02-04 11:33:51Z martin $
-\input docstrip.tex
-\preamble
-
-Copyright (C) 2011 by Martin Scharrer <martin@scharrer-online.de>
-
-This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3c
-of this license or (at your option) any later version.
-The latest version of this license is in
-
- http://www.latex-project.org/lppl.txt
-
-and version 1.3c or later is part of all distributions of LaTeX
-version 2008/05/04 or later.
-
-This work has the LPPL maintenance status `maintained'.
-
-The Current Maintainer of this work is Martin Scharrer.
-
-This work consists of the files collcell.dtx, collcell.ins
-and the derived file collcell.sty.
-
-\endpreamble
+\input ydocstrip.tex
\keepsilent
+\askforoverwritefalse
\generate{%
- \file{collcell.sty}{\from{collcell.dtx}{package}}%
+ \file{collcell.sty}{\from{collcell.dtx}{collcell.sty}}%
}
-\obeyspaces
-\Msg{*************************************************************}
-\Msg{* *}
-\Msg{* To finish the installation you have to move the following *}
-\Msg{* file into a directory searched by TeX: *}
-\Msg{* *}
-\Msg{* collcell.sty *}
-\Msg{* *}
-\Msg{* To produce the documentation run the file collcell.dtx *}
-\Msg{* through LaTeX. *}
-\Msg{* *}
-\Msg{* Happy TeXing! *}
-\Msg{* *}
-\Msg{*************************************************************}
-
\endbatchfile
-
%% vim: ft=tex
-
diff --git a/macros/latex/contrib/collcell/collcell.pdf b/macros/latex/contrib/collcell/collcell.pdf
index 59a6538706..05ee9b3817 100644
--- a/macros/latex/contrib/collcell/collcell.pdf
+++ b/macros/latex/contrib/collcell/collcell.pdf
Binary files differ
diff --git a/macros/latex/contrib/emulateapj/README b/macros/latex/contrib/emulateapj/README
index 2090e68c53..376a37d903 100644
--- a/macros/latex/contrib/emulateapj/README
+++ b/macros/latex/contrib/emulateapj/README
@@ -1,66 +1,70 @@
-This is emulateapj.cls, version November 10, 2009
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ This is emulateapj.cls, version February 19, 2025
+ For the latest version check http://hea-www.harvard.edu/~alexey/emulateapj
-`emulateapj' is a LaTeX2e class to emulate the Astrophysical Journal
-(ApJ) page layout. The page length of the resulting document is very
-close to that in ApJ when Times fonts are used instead of the LaTeX
-default CM fonts.
+ NOTE: ApJ has moved its publishing to IOP and they have slightly changed
+ the formatting. To implement these changes, call emulateapj with the iop
+ option, as in
+ \documentclass[iop]{emulateapj}
-If a manuscript is prepared for ApJ submission using the standard
-American Astronomical Society LaTeX macros and the `aastex' style
-(see instructions for authors on the ApJ web site), the only thing
-required from the user should be to replace \documentclass{aastex}
-with \documentclass{emulateapj}, and perhaps resize figures as
-desired and replace {deluxetable} with {deluxetable*}. Possible minor
-problems are described below.
+ Other available options:
-emulateapj requires revtex4.cls. If you don't have it already, it can be
-downloaded from http://publish.aps.org/revtex4/ (it's a small package).
-Other extrnal packages used are latexsym, graphicx, amssymb, longtable,
-epsf. They should already be present in the modern TeX distributions; if
-not, download them from www.ctan.org.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-For the latest version check http://hea-www.harvard.edu/~alexey/emulateapj
+ [chicago] - (default) typeset as was done in the University of Chicago Press
+ [twocolumn] - (default) two-column mode
+ [onecolumn] - main text in one-column mode
+ [apj] - typeset as for main journal
+ [apjl] - (default) typeset as for ApJ Letters
+ [tighten] - some adjustments to approximate grid typesetting
+ [numberedappendix] - number appendix sections as A, B, etc
+ [appendixfloats] - use separate numbering for floats within appendix
+ [twocolappendix] - make appendix in two-col mode in a two-col paper
+ [revtex4] - force using revtex4
+ [astrosymb] - load Astrosymb font and define \astro commands from aastex
-NOTE: ApJ has moved its publishing to IOP and they have slightly changed
-the formatting. To implement these changes, call emulateapj with the iop
-option, as in
-\usepackage[iop]{emulateapj}
+ NOTE 2: Starting from version 11/10/2009, emulateapj tries to load
+ revtex4-1 if present on the system. This may cause small changes in
+ typesetting for old documents. Also, revtex4-1 does not interact
+ well with the lscape package which is needed for typesetting of
+ long rotated tables. If you want full compatibility, please
+ download the last version based on revtex4,
+ http://hea-www.harvard.edu/~alexey/emulateapj/emulateapj-rtx4.cls
+ and bundle it with your TeX source code. Starting with the
+ 8/17/2012 version, you can also use the [revtex4] option.
-Other available options:
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ Copyright 2000-2015 Alexey Vikhlinin
-[chicago] - (default) typeset as was done in the University of Chicago Press
-[twocolumn] - (default) two-column mode
-[onecolumn] - main text in one-column mode
-[apj] - typeset as for main journal
-[apjl] - (default) typeset as for ApJ Letters
-[tighten] - some adjustments to approximate grid typesetting
-[numberedappendix] - number appendix sections as A, B, etc
-[appendixfloats] - use separate numbering for floats within appendix
-[appendixfloats] - use separate numbering for floats within appendix
-[twocolappendix] - make appendix in two-col mode in a two-col paper
-[revtex4] - force using revtex4
+ The first version of this package was written by Maxim Markevitch.
+ Pieces of AASTeX code are used for compatibility with aastex.cls.
-NOTE 2: Starting from version 11/10/2009, emulateapj tries to load
-revtex4-1 if present on the system. This may cause small changes in
-typesetting for old documents. If you want full compatibility, please
-download the last version based on revtex4,
-http://hea-www.harvard.edu/~alexey/emulateapj/emulateapj-rtx4.cls
-and bundle it with your TeX source code
+ This program can be redistributed and/or modified under the terms of
+ the LaTeX Project Public License available from CTAN archives in
+ macros/latex/base/lppl.txt. This means you are free to use and
+ distribute this package; however, if you modify anything, please
+ change the file name and remove the author's email address.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-Copyright 2000-2009 Alexey Vikhlinin
+ Alexey Vikhlinin <alexey@head.cfa.harvard.edu>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-The first version of this package was written by Maxim Markevitch.
-Pieces of AASTeX code are used for compatibility with aastex.cls.
+ `emulateapj' is a LaTeX2e class to emulate the Astrophysical Journal
+ (ApJ) page layout. The page length of the resulting document is very
+ close to that in ApJ when Times fonts are used instead of the LaTeX
+ default CM fonts.
+
+ If a manuscript is prepared for ApJ submission using the standard
+ American Astronomical Society LaTeX macros and the `aastex' style
+ (see instructions for authors on the ApJ web site), the only thing
+ required from the user should be to replace \documentclass{aastex}
+ with \documentclass{emulateapj}, and perhaps resize figures as
+ desired and replace {deluxetable} with {deluxetable*}. Possible minor
+ problems are described below.
-This program can be redistributed and/or modified under the terms of
-the LaTeX Project Public License available from CTAN archives in
-macros/latex/base/lppl.txt. This means you are free to use and
-distribute this package; however, if you modify anything, please
-change the file name and remove the author's email address.
+ emulateapj requires revtex4.cls. If you don't have it already, it can be
+ downloaded from http://publish.aps.org/revtex4/ (it's a small package).
+ Other extrnal packages used are latexsym, graphicx, amssymb, longtable,
+ epsf. They should already be present in the modern TeX distributions; if
+ not, download them from www.ctan.org.
-Alexey Vikhlinin <alexey@head.cfa.harvard.edu>
+ For release notes and change log, see at bottom of emulateapj.cls
-%% For release notes and change log, read the bottom of emulateapj.cls
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/emulateapj/emulateapj.cls b/macros/latex/contrib/emulateapj/emulateapj.cls
index 97eba95bd6..b9ba2739c3 100644
--- a/macros/latex/contrib/emulateapj/emulateapj.cls
+++ b/macros/latex/contrib/emulateapj/emulateapj.cls
@@ -1,10 +1,10 @@
-%% This is emulateapj.cls, version Aug 17, 2012
+%% This is emulateapj.cls, version February 19, 2025
%% For the latest version check http://hea-www.harvard.edu/~alexey/emulateapj
%%
%% NOTE: ApJ has moved its publishing to IOP and they have slightly changed
%% the formatting. To implement these changes, call emulateapj with the iop
%% option, as in
-%% \usepackage[iop]{emulateapj}
+%% \documentclass[iop]{emulateapj}
%%
%% Other available options:
%%
@@ -18,6 +18,7 @@
%% [appendixfloats] - use separate numbering for floats within appendix
%% [twocolappendix] - make appendix in two-col mode in a two-col paper
%% [revtex4] - force using revtex4
+%% [astrosymb] - load Astrosymb font and define \astro commands from aastex
%%
%% NOTE 2: Starting from version 11/10/2009, emulateapj tries to load
%% revtex4-1 if present on the system. This may cause small changes in
@@ -27,10 +28,10 @@
%% download the last version based on revtex4,
%% http://hea-www.harvard.edu/~alexey/emulateapj/emulateapj-rtx4.cls
%% and bundle it with your TeX source code. Starting with the
-%% 8/17/2012 version, you can also use the [revtx4] option.
+%% 8/17/2012 version, you can also use the [revtex4] option.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Copyright 2000-2011 Alexey Vikhlinin
+%% Copyright 2000-2025 Alexey Vikhlinin
%%
%% The first version of this package was written by Maxim Markevitch.
%% Pieces of AASTeX code are used for compatibility with aastex.cls.
@@ -67,7 +68,7 @@
%% For release notes and change log, see at bottom
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\emulapj@ver{12/16/11}
+\def\emulapj@ver{02/19/25}
\ProvidesClass{emulateapj}
@@ -106,6 +107,14 @@
\@apj@lettertrue
}
+\DeclareOption{astrosymb}{
+ \def\astro#1{\leavevmode\hbox{\astro@font#1}}%
+ \def\load@astro@font{%
+ \font\astro@font=Astrosym at\f@size pt
+ }%
+ \AtBeginDocument{\load@astro@font}
+}
+
\DeclareOption{tighten}{
% lineskiplimits to facilitate grid typesetting
\lineskiplimit=-2mm
@@ -153,9 +162,9 @@
\let\@startsection@from@latex=\@startsection
\if@two@col
- \LoadClass[twocolumn,nofootinbib,showkeys,twoside,floatfix,unsortedaddress,flushbottom]{\@revtex@cls}
+ \LoadClass[twocolumn,nofootinbib,showkeys,twoside,floatfix,unsortedaddress,flushbottom,10pt,aps,pra]{\@revtex@cls}
\else
- \LoadClass[nofootinbib,showkeys,twoside,floatfix,unsortedaddress,flushbottom,notitlepage]{\@revtex@cls}
+ \LoadClass[nofootinbib,showkeys,twoside,floatfix,unsortedaddress,flushbottom,notitlepage,10pt,aps,pra]{\@revtex@cls}
\fi
\def\blankaffiliation{~}%
@@ -163,10 +172,12 @@
\def\@eapj@cap@font{\scshape}
\def\@eapj@figname{Fig.}
\def\@eapj@tabname{TABLE}
+ \def\@eapj@ApJLetters{ApJ}
\else
\def\@eapj@cap@font{\bfseries}
\def\@eapj@figname{Figure}
\def\@eapj@tabname{Table}
+ \def\@eapj@ApJLetters{ApJL}
\fi
% Restore natbib package without sorting.
@@ -411,7 +422,7 @@
\let\@AF@join\@title@join
}%
\def\frontmatter@title@format{\normalsize\centering}
-\def\frontmatter@title@below{\vspace*{-2.63\baselineskip\vspace*{0.25in}}}%
+\def\frontmatter@title@below{\vspace*{-2.63\baselineskip}\vspace*{0.25in}}%
\def\frontmatter@above@affilgroup{\vspace*{0.25in}}%
\def\frontmatter@authorformat{\small\scshape\centering}%
@@ -853,7 +864,8 @@
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist
- \onecolumngrid
+ \onecolumngrid % to balance references
+ \if@two@col \twocolumngrid \fi
}
% %% AV:
@@ -1143,7 +1155,7 @@
\newcommand\Capricornus{\astro{\char20}}%
\newcommand\Aquarius{\astro{\char21}}%
\newcommand\Pisces{\astro{\char22}}%
-
+
\newcommand\sbond{\chem@bnd{\@sbnd}}%
\newcommand\dbond{\chem@bnd{\@dbnd}}%
\newcommand\tbond{\chem@bnd{\@tbnd}}%
@@ -1189,7 +1201,7 @@
\newcommand\aj{\ref@jnl{AJ}}% % Astronomical Journal
\newcommand\araa{\ref@jnl{ARA\&A}}% % Annual Review of Astron and Astrophys
\renewcommand\apj{\ref@jnl{ApJ}}% % Astrophysical Journal
-\newcommand\apjl{\ref@jnl{ApJ}}% % Astrophysical Journal, Letters
+\newcommand\apjl{\ref@jnl{\@eapj@ApJLetters}}% % Astrophysical Journal, Letters
\newcommand\apjs{\ref@jnl{ApJS}}% % Astrophysical Journal, Supplement
\renewcommand\ao{\ref@jnl{Appl.~Opt.}}% % Applied Optics
\newcommand\apss{\ref@jnl{Ap\&SS}}% % Astrophysics and Space Science
@@ -1233,6 +1245,17 @@
\newcommand\physscr{\ref@jnl{Phys.~Scr}}% % Physica Scripta
\newcommand\planss{\ref@jnl{Planet.~Space~Sci.}}% % Planetary Space Science
\newcommand\procspie{\ref@jnl{Proc.~SPIE}}% % Proceedings of the SPIE
+
+\newcommand\actaa{\ref@jnl{Acta Astron.}}% % Acta Astronomica
+\newcommand\caa{\ref@jnl{Chinese Astron. Astrophys.}}% % Chinese Astronomy and Astrophysics
+\newcommand\cjaa{\ref@jnl{Chinese J. Astron. Astrophys.}}% % Chinese Journal of Astronomy and Astrophysics
+\newcommand\jcap{\ref@jnl{J. Cosmology Astropart. Phys.}}% % Journal of Cosmology and Astroparticle Physics
+\newcommand\na{\ref@jnl{New A}}% % New Astronomy
+\newcommand\nar{\ref@jnl{New A Rev.}}% % New Astronomy Review
+\newcommand\pasa{\ref@jnl{PASA}}% % Publications of the Astron. Soc. of Australia
+\newcommand\rmxaa{\ref@jnl{Rev. Mexicana Astron. Astrofis.}}% % Revista Mexicana de Astronomia y Astrofisica
+
+
\let\astap=\aap
\let\apjlett=\apjl
\let\apjsupp=\apjs
@@ -1424,7 +1447,10 @@
\centering
\begin{minipage}{\deluxe@table@width}
\lt@expand@linewidth
- \begin{longtable}{\lt@expand@linewidth@#1}
+ \def\@tmpa{\begin{longtable}}
+ \expandafter\expandafter\expandafter\@tmpa%
+ \expandafter\expandafter\expandafter{\lt@expand@linewidth@#1}
+% \begin{longtable}{\lt@expand@linewidth@#1}
}{
\restore@tablenum%
\end{longtable}%
@@ -1455,7 +1481,10 @@
\find@table@width
\begin{minipage}{\deluxe@table@width}
\lt@expand@linewidth
- \begin{longtable*}{\lt@expand@linewidth@#1}
+ \def\@tmpa{\begin{longtable*}}
+ \expandafter\expandafter\expandafter\@tmpa%
+ \expandafter\expandafter\expandafter{\lt@expand@linewidth@#1}
+ %\begin{longtable*}{\lt@expand@linewidth@#1}
}{\gdef\pt@width{\LTcapwidth}%
\restore@tablenum%
\end{longtable*}%
@@ -1845,5 +1874,23 @@
%% 12/16/11: copy \sbond, dbond, tbond commands from AASTeX
%
%% 08/17/12: option to force using revtex4
+%%
+%% 03/07/13: load astro@font to go with the \astro commands
+%% ([astrosymb] option)
+%%
+%% 04/17/13: in the two column mode, force a switch to twocolumngrid
+%% after references. This is needed for twocolappendix,
+%% among other things
+%%
+%% 05/03/13 add 10pt,aps,pra option to \LoadClass revtex4 to avoid warnings
+%%
+%% 05/12/14 More journal abbreviations
+%%
+%% 01/23/15 Fix collision with array package: expand
+%% \lt@expand@linewidth@ twice before passing into longtable
+%%
+%% 01/23/15 \apjl with the iop option expands to ApJL
+%%
+%% 02/19/25 Fix bug in \def\frontmatter@title@below noticed by Nicolas Tessore
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/latex/contrib/knowledge/README.md b/macros/latex/contrib/knowledge/README.md
index a03e55834a..cdf894e443 100644
--- a/macros/latex/contrib/knowledge/README.md
+++ b/macros/latex/contrib/knowledge/README.md
@@ -3,8 +3,8 @@ This directory contains the package
name: knowledge
license: LaTeX Project Public License version 1.2 or above
- version: v1.29
- date: 2024/03/10
+ version: v1.30
+ date: 2025/02/20
author: Thomas Colcombet
mail: thomas.colcombet@irif.fr
web: https://ctan.org/pkg/knowledge
diff --git a/macros/latex/contrib/knowledge/knowledge-code.dtx b/macros/latex/contrib/knowledge/knowledge-code.dtx
index 6bc619c558..1e40569de1 100644
--- a/macros/latex/contrib/knowledge/knowledge-code.dtx
+++ b/macros/latex/contrib/knowledge/knowledge-code.dtx
@@ -23,7 +23,7 @@
%
% \iffalse
%<head>\usepackage{expl3}
-%<head>\ProvidesExplPackage{knowledge}{2024/03/10}{1.29}{}
+%<head>\ProvidesExplPackage{knowledge}{2025/02/20}{1.30}{}
%<*driver>
\def\knowledgecode{active}
\input{knowledge.tex}
@@ -62,6 +62,7 @@
% \changes{1.27}{2022/01/12}{doc changes} %
% \changes{1.28}{2022/02/12}{imakeidx support} %
% \changes{1.29}{2024/03/10}{typographic bug corrected} %
+% \changes{1.30}{2025/02/20}{bug correction} %
% \GetFileInfo{knowledge.sty} %
% \DoNotIndex{}
%
@@ -81,8 +82,8 @@ This directory contains the package
name: knowledge
license: LaTeX Project Public License version 1.2 or above
- version: v1.29
- date: 2024/03/10
+ version: v1.30
+ date: 2025/02/20
author: Thomas Colcombet
mail: thomas.colcombet@irif.fr
web: https://ctan.org/pkg/knowledge
@@ -3822,7 +3823,7 @@ This directory contains the package
}
\NewDocumentCommand\knowledge_knowledgified_NewDocumentCommand:NNnn{mmmm}{
#1#2{#3}{\withkl{\kl[{#2}]}{#4}}
- \knowledge{#2}{cmdkl}
+ \knowledge{#2}{automatic~in~command}
}
\NewDocumentCommand\KnowledgifyNewcommand{m}{
\cs_if_exist:NTF#1{
diff --git a/macros/latex/contrib/knowledge/knowledge-example.tex b/macros/latex/contrib/knowledge/knowledge-example.tex
index 7d86805131..c4469eb521 100644
--- a/macros/latex/contrib/knowledge/knowledge-example.tex
+++ b/macros/latex/contrib/knowledge/knowledge-example.tex
@@ -4,7 +4,6 @@
% If the output is a PDF (avoids some display problems, in particular in arXiv).
\pdfoutput = 1
-%
% This is the file
%
% knowledge-example.tex
@@ -25,15 +24,11 @@
\usepackage{xcolor}
%
% The package 'knowledge' has now to be loaded.
-% The options
-% 'paper', 'electronic' or 'composition' (default)
-% can be used. These activates different rendering styles:
-% - 'paper' produce a paper to be printed:
-% text in black and white
-% - 'electronic' highlights links using colors:
-% for being read on an electronic device
+% The options 'paper', 'electronic' or 'composition' (by default) activate the different rendering styles:
+% - 'paper' produce a paper to be printed: text in black and white
+% - 'electronic' highlights links using colors: for being read on an electronic device
% - 'composition' (or default) highlights missing knowledges as
-% well as agives other pieces of information. It should always
+% provides other pieces of information. It should always
% be used but when the paper is ready.
%
\usepackage{knowledge} % default
diff --git a/macros/latex/contrib/knowledge/knowledge.pdf b/macros/latex/contrib/knowledge/knowledge.pdf
index a4a481ddb0..9dba1059f9 100644
--- a/macros/latex/contrib/knowledge/knowledge.pdf
+++ b/macros/latex/contrib/knowledge/knowledge.pdf
Binary files differ
diff --git a/macros/latex/contrib/knowledge/knowledge.tex b/macros/latex/contrib/knowledge/knowledge.tex
index 8d0c1102aa..e157a93b32 100644
--- a/macros/latex/contrib/knowledge/knowledge.tex
+++ b/macros/latex/contrib/knowledge/knowledge.tex
@@ -791,6 +791,7 @@ I have seen Till Tantau who explained me how to test whether a material is displ
\item[2022-01-12] Minor changes. Removing dead link for the webpage. V1.27
\item[2022-02-12] Adding support of "imakeidx@@package" and the directive "index name=" (request and code change by Maximilian Keßler). V1.28
\item[2024-03-10] Correcting typographic bug of \cs\withkl\ and \cs\cmdkl\ when in combination with e.g. \cs\mathrel\ (suggested by Rémi Morvan). V1.29
+\item[2025-02-20] Correcting macro bug with \cs\KnowledgeNewDocumentCommand\ (thanks to Sarah Winter). V1.30
\end{compactdesc}
\normalsize
%\restoregeometry
diff --git a/macros/latex/contrib/siunitx/CHANGELOG.md b/macros/latex/contrib/siunitx/CHANGELOG.md
index f35ae069c3..2281544f8e 100644
--- a/macros/latex/contrib/siunitx/CHANGELOG.md
+++ b/macros/latex/contrib/siunitx/CHANGELOG.md
@@ -7,6 +7,12 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
## [Unreleased]
+## [v3.4.5] - 2025-02-19
+
+### Fixed
+- Alignment of separated uncertainty when an exponent is present (see issue
+ [\#777](https://github.com/josephwright/siunitx/issues/777))
+
## [v3.4.4] - 2025-01-21
### Fixed
@@ -2235,7 +2241,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
### Added
- First public testing release (as `si`)
-[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.4.4...HEAD
+[Unreleased]: https://github.com/josephwright/siunitx/compare/v3.4.5...HEAD
+[v3.4.5]: https://github.com/josephwright/siunitx/compare/v3.4.4...v3.4.5
[v3.4.4]: https://github.com/josephwright/siunitx/compare/v3.4.3...v3.4.4
[v3.4.3]: https://github.com/josephwright/siunitx/compare/v3.4.2...v3.4.3
[v3.4.2]: https://github.com/josephwright/siunitx/compare/v3.4.1...v3.4.2
diff --git a/macros/latex/contrib/siunitx/siunitx-code.pdf b/macros/latex/contrib/siunitx/siunitx-code.pdf
index c0b6f0748a..b1e6cc7f13 100644
--- a/macros/latex/contrib/siunitx/siunitx-code.pdf
+++ b/macros/latex/contrib/siunitx/siunitx-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/siunitx/siunitx-table.dtx b/macros/latex/contrib/siunitx/siunitx-table.dtx
index 4f06ee8945..26e0767c8e 100644
--- a/macros/latex/contrib/siunitx/siunitx-table.dtx
+++ b/macros/latex/contrib/siunitx/siunitx-table.dtx
@@ -1682,7 +1682,7 @@
+ \box_wd:N \l_@@_tmp_box
}
{
- \hbox_unpack:N \l_@@_decimal_box
+ \box_use:N \l_@@_decimal_box
\@@_fil:
\hbox_unpack:N \l_@@_tmp_box
}
diff --git a/macros/latex/contrib/siunitx/siunitx.dtx b/macros/latex/contrib/siunitx/siunitx.dtx
index 276ebf9775..73c181c94a 100644
--- a/macros/latex/contrib/siunitx/siunitx.dtx
+++ b/macros/latex/contrib/siunitx/siunitx.dtx
@@ -137,7 +137,7 @@
%
% Identify the package and give the over all version information.
% \begin{macrocode}
-\ProvidesExplPackage {siunitx} {2025-01-21} {3.4.4}
+\ProvidesExplPackage {siunitx} {2025-02-19} {3.4.5}
{A comprehensive (SI) units package}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/siunitx/siunitx.pdf b/macros/latex/contrib/siunitx/siunitx.pdf
index 56963c0808..064b766e54 100644
--- a/macros/latex/contrib/siunitx/siunitx.pdf
+++ b/macros/latex/contrib/siunitx/siunitx.pdf
Binary files differ
diff --git a/macros/latex/contrib/standalone/DEPENDS.txt b/macros/latex/contrib/standalone/DEPENDS.txt
index 6f17f86d9b..7e54b58cab 100644
--- a/macros/latex/contrib/standalone/DEPENDS.txt
+++ b/macros/latex/contrib/standalone/DEPENDS.txt
@@ -7,4 +7,4 @@ soft varwidth
soft shellesc
soft ifluatex
soft ifpdf
-soft ifxetex \ No newline at end of file
+soft ifxetex
diff --git a/macros/latex/contrib/standalone/README b/macros/latex/contrib/standalone/README
deleted file mode 100644
index 04e021db29..0000000000
--- a/macros/latex/contrib/standalone/README
+++ /dev/null
@@ -1,21 +0,0 @@
-LaTeX class and package 'standalone'
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Copyright (c) 2010-2022 by Martin Scharrer <martin.scharrer@web.de>
-Repository: https://github.com/MartinScharrer/standalone
-Issues: https://github.com/MartinScharrer/standalone/issues
-
-Allows TeX diagrams or other TeX code in sub-files to be compiled standalone
-or as part of a main document.
-Provides support for diagrams with beamer overlays.
-
-Since v0.3 the package provides options to automatically or manually include
-all sub-files preambles in the main document preamble.
-
-Since v1.0 the package provides the possibility to compile subfiles automatically
-to images from and include them into the main document as well as switch
-easily between source code and image mode. This is done using the \includestandalone
-macro which is designed after the common \includegraphics macro.
-The standalone class now supports cropping without the 'preview' package
-(which causes issues in some causes under XeLaTeX) and the conversion to
-raster images using external tools.
-
diff --git a/macros/latex/contrib/standalone/README.txt b/macros/latex/contrib/standalone/README.txt
new file mode 100644
index 0000000000..08124f7441
--- /dev/null
+++ b/macros/latex/contrib/standalone/README.txt
@@ -0,0 +1,16 @@
+LaTeX class and package 'standalone'
+====================================
+
+Copyright (c) 2010-2025 by Martin Scharrer <martin.scharrer@web.de>
+License: LaTeX Project Public License, v1.3 or later: http://www.latex-project.org/lppl.txt
+Repository: https://github.com/MartinScharrer/standalone
+Issues: https://github.com/MartinScharrer/standalone/issues
+
+A class and package is provided which allows TeX diagrams or other TEX code to be compiled standalone or as part of a
+main document. Special support for pictures with beamer overlays is also provided.
+
+The package is used in the main document and skips extra preambles in sub-files. The class may be used to simplify the
+preamble in sub-files. By default the preview package is used to display the typeset code without margins.
+
+The behaviour in standalone mode may adjusted using a configuration file standalone.cfg to redefine the standalone
+environment.
diff --git a/macros/latex/contrib/standalone/standalone.dtx b/macros/latex/contrib/standalone/standalone.dtx
index 322797c310..708a6b4e82 100644
--- a/macros/latex/contrib/standalone/standalone.dtx
+++ b/macros/latex/contrib/standalone/standalone.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%<=*COPYRIGHT>
-%% Copyright (C) 2010-2022 by Martin Scharrer <martin.scharrer@web.de>
+%% Copyright (C) 2010-2025 by Martin Scharrer <martin.scharrer@web.de>
%% ---------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -26,10 +26,10 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{standalone.dtx}[%
%<=*DATE>
- 2022/10/10
+ 2025/02/21
%<=/DATE>
%<=*VERSION>
- v1.3b
+ v1.5
%<=/VERSION>
DTX file of the standalone bundle]
\documentclass[a4paper,11pt]{ydoc}
@@ -61,7 +61,7 @@
%</driver>
% \fi
%
-% \CheckSum{3934}
+% \CheckSum{3944}
%
% \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
@@ -95,6 +95,8 @@
% Changed filemodedate code to support LuaTeX.
% Fixes for option combination multi,convert.}
% \changes{v1.3b}{2022/10/10}{Fixed incorrect/unwanted messages for conversion feature. Updated project URLs in documentation. Added dependency list file.}
+% \changes{v1.4}{2022/11/11}{Updated conversion feature.}
+% \changes{v1.5}{2025/02/21}{Set papersize special for lualatex/xelatex. Some corrections to the manual.}
%
% \GetFileInfo{\jobname.dtx}
%
@@ -236,8 +238,8 @@
% The package \cls{standalone} can be used in the main document to skip all extra preambles in included files. The main file must load all packages
% and settings required by the sub-files. Several package options are provided to collect the preambles of the sub-files automatically and execute them from the main file.
%
-% A \cls{standalone} class is also provided to minimise the extra preamble code needed in this files.
-% It's usage is optional, but simplifies and standardises how picture files are compiled standalone.
+% A \cls{standalone} class is also provided to minimise the extra preamble code needed in these files.
+% Its usage is optional, but simplifies and standardises how picture files are compiled standalone.
% The class uses by default the \opt{crop} option to create an output file which only contains the picture with no extra
% margins, page numbers or anything else.
% A configuration file \file{standalone.cfg} read by the class allows the user to adjust settings and macros easily
@@ -318,7 +320,7 @@
% Page number and other header or footer material will be suppressed.
%
% For pictures drawn with TikZ a dedicated \opt{tikz} option is provided which loads the \pkg{tikz} package and also configures the \env{tikzpicture} environment to create a single cropped page.
-% For PSTricks pictures an corresponding \opt{pstricks} option is provided.
+% For PSTricks pictures a corresponding \opt{pstricks} option is provided.
%
% \par\noindent
% \begin{minipage}{\textwidth}
@@ -368,7 +370,7 @@
% \DescribeKey{preview}'=true|false'
% If enabled this option loads the \pkg{preview} package with the \opt{tightpage} option
% and wraps the content into a \env{preview} environment. This crops the content to its natural size plus a specified border.
-% Issues with the \pkg{preview} options and TikZ shadings under \XeLaTeX have been reported. In this cases the \opt{crop} option should be used instead.
+% Issues with the \pkg{preview} option and TikZ shadings under \XeLaTeX{} have been reported. In this cases the \opt{crop} option should be used instead.
% Note that this option was enabled by default for versions before v1.0, but since then \opt{crop} is enabled by
% default.
%
@@ -405,7 +407,7 @@
% will not affect later code. Code in the preamble is not affected.
% It is recommended to keep this option disabled and only use it if really required.
% It should be noted that which \opt{preview} such material is always ignored while not affecting local settings.
-% Therefore the \opt{ignorrest} option can be seen as a compatibility setting to make \opt{crop} act more like \opt{preview}, if this is required by the user.
+% Therefore the \opt{ignorerest} option can be seen as a compatibility setting to make \opt{crop} act more like \opt{preview}, if this is required by the user.
%
%
% \DescribeKey{multido}'=true|false'
@@ -432,7 +434,7 @@
% but will always use the natural width of the content if it is smaller than the given maximum width.
% The resulting effect is that the created paragraph will not cause any additional width and that multiple paragraphs can be included as part of the content.
% The used maximal width (which is provided to the underlying \env{minipage} environment) is \Macro\linewidth by default, but can be set
-% by provided a width as value to the option. Doing so will also switch the option on.
+% by providing a width as value to the option. Doing so will also switch the option on.
%
% If the \opt{crop} option is used the content is placed in restricted horizontal mode which ignores paragraph breaks.
% Using the \opt{varwidth} option paragraph breaks are enabled again.
@@ -468,6 +470,10 @@
%
% \DescribeKey{convert}'='{<conversion options>}
% \DescribeKey{png}'='{<conversion options>}
+% \DescribeKey{jpg}'='{<conversion options>}
+% \DescribeKey{gif}'='{<conversion options>}
+% \DescribeKey{svg}'='{<conversion options>}
+% \DescribeKey{emf}'='{<conversion options>}
% These options allow to enable and configure the conversion feature. See \autoref{sec:convert} for the full description.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -606,13 +612,85 @@
% Because it can be assumed that the bundle configuration file resides inside a \file{standalone} directory, therefore it can be loaded from a user configuration file using
% \Macro\input{standalone/standalone.cfg}.
%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsection{Simple TeX File}
+% A simple \file{standalone.tex} file is provided together with the bundle, which may be useful in special occasions.
+% It will set the \cs{ifstandalone} switch to \emph{true} when compiled standalone but to \emph{false}
+% when loaded after any |\documentclass| macro, as long the switch isn't defined yet.
+% It must be used if this switch is required before the |\documentclass| of a standalone file.
+%
+% \noindent
+% \begin{minipage}{\textwidth}\noindent
+% \begin{lstlisting}[language={[latex]tex},gobble=4,frame=lines,numbers=none,caption={Usage of 'standalone.tex'.}]
+% \input{standalone} % use before any '\documentclass'
+% \ifstandalone
+% % Used only if compiled standalone
+% \fi
+% \end{lstlisting}
+% \end{minipage}
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \subsection{Conversion to images}\label{sec:convert}
+% \subsection{FAQ / Troubleshooting}\label{sec:classfaq}
+% This section expands some issues and their solution which can arise with the \cls{standalone} class.
+%
+% \subsubsection*{Large white space / border at the right side}
+% A large white space / border on the right side occurs when the content is placed inside a paragraph.
+% This causes the content to be \Macro\linewidth wide and so smaller pictures will contain now a white space at the right.
+% A common cause for this is that there was is a empty line between the content and \Macro\end{document} which causes a paragraph break.
+%
+% This issue can be solved by either removing any trailing lines or other paragraph breaks, or by using the \opt{varwidth} option which suppresses the extra added width.
+% It is also possible to use the \opt{multi} option and \Macro\standaloneenv{<environment name>} to declare certain environments as page content.
+% The \opt{tikz} option does this for \env{tikzpictures} and the \opt{pstricks} option for \env{pspicture}. See the descriptions of these options for more details.
+%
+% \subsubsection*{Some amount of the content on the right side is missing}
+% If the content is cropped to much on the right side, check if the \opt{varwidth} option is used. In this case the used maximum width (\Macro\linewidth by default) is too small.
+% A larger width can be set using \hbox{\opt{varwidth}\MacroArgs'='<length>} or the option can be disabled altogether using \hbox{\opt{varwidth}|=false|}.
+% The largest width possible is given by \Macro\maxdimen, which however might cause internal overflows.
+%
+% This can also be caused with \cls{beamer} content (i.e.\ when the \opt{beamer} option is used). In this case no cropping or \env{varwidth} environment is used at all,
+% but the content is simply to large to fit on a \cls{beamer} \env{frame}. To avoid this rescale the content to do fit. This can be realised by either using
+% scaling facilities of the used picture environment (like |scale| with \env{environment}, but this only scales coordinates) or using \Macro\scalebox or \Macro\resizebox from \pkg{graphicx}.
+% For complicated code which contains verbatim or other catcode changing code either the \Macro\Resizebox from the \pkg{realboxes} package
+% or the \MacroArgs{adjustbox}{scale=<factor>} environment from the \pkg{adjustbox} package should be used.
+%
+% \subsubsection*{A multi-page document contains some pages with unwanted content}
+% This is caused while \opt{multi}|=true| and \opt{crop}|=true| are set but \opt{ignorerest}|=false| \emph{and} the document contains
+% typeset material outside of environments declared with \Macro\standaloneenv. To avoid that this extra material should be removed or \opt{ignorerest} should be set to |true|.
+% This will also ignore all settings inside the document body which are not inside a declared environment. These can be moved to the preamble instead.
+% See the description of the \opt{ignorerest} option for more details.
+%
+% \subsubsection*{In a multi-page document using DVI/PS mode all pages except the first have a vertical offset}
+% The vertical reference points in PostScript could does not change when the pages are resized to fit the individual content of every page.
+% Therefore an offset is added to compensate for this, which shifts the content to the appropriate vertical position.
+% Should this not work as expected please inform the package author and provide a small example which causes this issue, together with the version number of the used |latex| compiler and tools (like |dvips|, |ps2pdf|)
+% as well as the used \cls{standalone} bundle.
+%
+% \subsubsection*{Issues with cropped files in DVI mode}
+% The \opt{crop} option uses PostScript commans in DVI mode, i.e.\ when |latex| not |pdflatex| (or others) is used as a compiler.
+% This PostScript commands will only work once the DVI is converted to PS or EPS.
+% Currently this cropping code is experimental and might not produce a full (E)PS standard compatible file.
+% This can lead to wrong bounding boxes and wrong orientations or, dependent on the used PostScript tool, even to PostScript compiler errors.
+% Some issues can be overcome by converting the the (E)PS file to a (more) standard compatible version using tools like |eps2eps| or Ghostscript.
+%
+% \subsubsection*{Errors ``Float(s) lost'' or ``not in outer par mode''}
+% Floating environments like \env{figure} or \env{table} can not be used while \Key{float}'=true' and either \Key{crop}'=true' or \Key{preview}'=true' is set.
+% The last two options will try to store the float into a box which is not allowed (because it can't the float any longer).
+% Usually \Key{float}'=false' will solve this error, because it turns these environments into non-floating alternatives.
+% Because both the \Key{crop} and \Key{preview} option will set \Key{float}'=false' themselves, this issue can only arise when the \Key{float} option is manually set afterwards.
+%
+% \subsubsection*{Image conversion does not work}
+% In order for the image conversion to work an external conversion software must be installed. By default either Image Magkick or GhostScript is used. Please insure that either or both of these softwares are installed.
+% Installation guide for your operating system should be easily available on the Internet. The \LaTeX\ compiler option |-shell-escape| must be used to allow this external software to be executed from within the \LaTeX\ code.
+% If this two points are fulfilled but the conversion does still not work, please check the log file. The lines in question start with `|runsystem|' (at least with \TeX\ Live 2011).
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \section{Conversion to images}\label{sec:convert}
% Using the \opt{convert} class option the standalone file can be easily converted to an raster image. This is done by executing an external program to convert the output file (PDF or PS) to
% an image (recommended is the lossless PNG format, but also others are supported).
%
-% \subsubsection{Conversion settings}
+% \subsection{Conversion settings}
% Conversion settings can be given as the value of the \Key{convert}'='{<settings>} option.
% By default conversion is disabled (\Key{convert}'=false'). If enabled without providing own settings (\Key{convert}, \Key{convert}'=true')
% the following default settings are used: PNG format, a density of 300dpi, no explicit size and the output file name is given by \Macro\jobname, i.e.\ the name of the \LaTeX\ document.
@@ -634,22 +712,39 @@
% true & Conversion enabled (with default settings if no other options are given) & (no value) \\
% false & Conversion disabled & (no value) \\
% \midrule
+% png & Selects PNG output format & \\
+% jpg & Selects JPG output format & \\
+% gif & Selects GIF output format using \emph{ImageMagick}. & \\
+% svg & Selects SVG output format using \emph{Inkscape}. & \\
+% emf & Selects EMF output format using \emph{Inkscape}. & \\
+% \midrule
% density & Sets the density in dots-per-inch (dpi). Can be a single numerical value or `\meta{X}|x|\meta{Y}'. & |300| \\
% size & Sets the size of the image. Can be a single numerical value or `\meta{X}|x|\meta{Y}'. If empty the size is determined by the density setting and the size of the PDF. & (empty) \\
% subjobname & The jobname used for the internal \LaTeX\ run & |\jobname| \\
% inext & Input file extension including the leading dot & |.pdf| or |.ps| \\
% inname & Name base of input file (i.e.\ file name without extension) & |\subjobname| \\
-% infile & Input file name & |\inname\inext| \\
+% infile & Input file name & |\indir\inname\inext| \\
% outext & Output file extension including the leading dot & |.png| \\
% outname & Name base of output file & |\inname| \\
-% outfile & Output file name & |\outname\outext| \\
+% outfile & Output file name & |\outdir\outname\outext| \\
+% \midrule
+% outputdir & Directory to be used for the \LaTeX\ compilers |-output-directory| option.
+% This will cause that all \LaTeX\ output files from the internal run will be created and read-back from the given directory.
+% This option shall be set if the main \LaTeX\ compiler run is called with the |-output-directory| option but can also be used on its own.
+% If not empty the directory must end with a slash `/'. & (empty) \\
+% outdir & Output directory where the conversion result shall be created. If not empty the directory must end with a slash `/'. & |\outputdir| \\
+% indir & Input directory, e.g.\ where the PDF is created. If not empty the directory must end with a slash `/'. & |\outputdir| \\
% \bottomrule\noalign{\smallskip}
% \multicolumn{3}{l}{%
% \strut Note: the settings (except 'true' and 'false') can also be used as macros in other settings.
% }%
-% \end{tabular}
-% \hss}
-% \medskip
+% \end{tabular}%
+% \hss}%
+% \end{table}
+%
+% \begin{table}
+% \vspace*{-10ex}%
+% \belowcaptionskip=\abovecaptionskip
% \caption{Advanced Conversion Options}\label{tab:advconvopt}
% \hbox to \textwidth{\hss%
% \begin{tabular}{>{\ttfamily}lp{\dimexpr.6\textwidth\relax}l}
@@ -657,6 +752,7 @@
% \multicolumn{1}{l}{Sub-Option} & Description & Default value \\
% \midrule
% command & Command line used for conversion. & (see |imagemagick|) \\
+% perpage & Boolean value. If set to |true| (default if used without a value) the conversion command is called once per page. Needs the \opt{multi} option to be enabled. \\
% imagemagick & Sets the convert command to use Image Magick: \newline\bigskip
% \hspace*{-5em}\hbox{\vtop{\hbox{\strut|command=\unexpanded{{\convertexe\space -density \density\space |\vrule height 2\ht\strutbox width 0pt{}}%
% \hbox{\strut| \infile\space \ifx\size\empty\else |}%
@@ -666,42 +762,46 @@
% \hspace*{-5em}\hbox{\vtop{\hbox{\strut|command=\unexpanded{{\gsexe\space -dSAFER -dBATCH -dNOPAUSE|\vrule height 2\ht\strutbox width 0pt{}}%
% \hbox{\strut| -sDEVICE=\gsdevice\space -r\density\space|}%
% \hbox{\strut| -sOutputFile=\outfile\space \infile}}|}}\hss} \\
+% ghostscript32 & Sets the convert command to use Ghostscript and |gsexe| to the 32-bit executable. \\
+% ghostscript64 & Sets the convert command to use Ghostscript and |gsexe| to the 64-bit executable. \\
% gsexe & Name of the executable of Ghostscript. & (see \autoref{sec:convprogs}) \\
-% precommand & Command to be executed before the actual conversion command. & {\tabular[t]{@{}l@{}}|dvips \subjobname| (DVI/PS),\\empty (PDF)\endtabular} \\
% gsdevice & The output device to be used for ghostscript. Already set up for PNG and JPG output. & \parbox[t]{15em}{Uses known device if defined for output format, otherwise the output format itself.}\\
+% precommand & Command to be executed before the actual conversion command. & {\tabular[t]{@{}l@{}}|dvips \subjobname| (DVI/PS),\\empty (PDF)\endtabular} \\
% onfailure & Sets if an type of `message' which should be triggered on conversion failure: |error|, |warning|, |info| or |ignore|. & |warning| \\
+%
% \bottomrule
-% \end{tabular}
-% \hss}
+% \end{tabular}%
+% \hss}%
% \end{table}
%
-% \subsubsection{Conversion software}\label{sec:convprogs}
-% The conversion requires an external image converter program to be installed. By default the two following tools are supported and either of them must be installed in order to use the conversion feature.
+% \subsection{Conversion software}\label{sec:convprogs}
+% The conversion requires an external image converter program to be installed. The two following tools are supported.
% In order for an external program to be executed the \texttt{-shell-escape} option\footnote{Maybe named differently depending on the used \LaTeX\ distribution} must be used for the
-% compiler executable, e.g.\ \texttt{pdflatex -shell-escape filename}. Without this option no conversion is possible.
+% compiler executable, e.g.\ \texttt{pdflatex -shell-escape filename}. Without this option no conversion is possible as \LaTeX\ will block calls to the shell.
%
-% By default the conversion program of \href{http://www.imagemagick.org/}{Image Magick} is used for PDF \LaTeX\ files, which is freely available for Unix/Linux, Mac and MS Windows.
-% Under Ubuntu Linux it can be installed using the shell command `\texttt{sudo apt-get install imagemagick}'.
-% The conversion executable is simply called `|convert|'. However, there is another program with the same name provided by MS Windows itself which
-% converts old FAT filesystems to NTFS! It has been suggested to rename the Image Magick executable to `|imgconvert|' instead.
-% By default \cls{standalone} uses `|imgconvert|' as executable if MS Windows is detected and `|convert|' otherwise.
-% The executable name can be change manually using the `|convertexe|' conversion option or by using
-% \codeline{\AlsoMacro\standaloneconfig{'convert='{'convertexe='{convert}}}}
-% in the configuration file `|standalone.cfg|'.
-%
-% Another conversion program is \href{http://pages.cs.wisc.edu/~ghost/}{Ghostscript} which is a very common PostScript interpreter which also supports PDF.
-% It is used by default for DVI/PS files.
-% Under Ubuntu Linux it is most likely already installed but otherwise can be installed using `|sudo apt-get install ghostscript|' or
-% `|sudo apt-get install gs|'.
+% By default the conversion program \href{https://pages.cs.wisc.edu/~ghost/}{Ghostscript} is used, which is a very common PostScript interpreter which also supports PDF.
+% Under Ubuntu Linux it is most likely already installed but otherwise can be installed using `\texttt{sudo apt-get install ghostscript}' or
+% `\texttt{sudo apt-get install gs}'.
% It can convert both to various output formats and is freely available for Unix/Linux, Max OS X and MS Windows.
% It requires to set the correct output device which is not always fully identical to the output format (e.g.\ `|png16m|' for a PNG (with 16 million colors)).
% The devices for PNG and JPG are already configured.
% Other devices can be configured using the \Key{defgsdevice}'='{<.extension>}{<device>} conversion setting.
-% The Ghostscript executable is usually named `|gs|' under Linux/Unix and `|gswin32c|' under MS Windows and configured this way by default,
-% but this may be changed using the |gsexe| setting.
+% The Ghostscript executable is usually named `|gs|' under Linux/Unix and `|gswin64c|' (32-bit version: `|gswin32c|') under MS Windows and configured this way by default,
+% but this may be changed using the |gsexe| setting. By default the 64-bit version is used, which can be changed to the 32-bit version using the \opt{ghostscript32} convert option.
+%
+% Also supported is the conversion program \href{https://www.imagemagick.org/}{Image Magick}, which is freely available for Unix/Linux, Mac and MS Windows.
+% For PDF input it will however use \emph{Ghostscript} internally, but adds more output filetypes like the GIF format.
+% Under Ubuntu Linux it can be installed using the shell command `\texttt{sudo apt-get install imagemagick}'.
+% The conversion executable was orinally called `|convert|', which clashed with a MS Windows FAT-to-NTFS converter.
+% Newer version name the executable `|magick|' where the convert command must be given as an argument: `|magick convert|'.
+% If needed the executable name can be change manually using the `|convertexe|' conversion option or by using
+% \codeline{\AlsoMacro\standaloneconfig{'convert='{'convertexe='{...}}}} in the configuration file `|standalone.cfg|'.
%
+% Furthermore the vector graphics software \href{https://inkscape.org/}{Inkscape} is supported.
+% It allows the conversion from PDF files to SVG, useful for web publishing, and to EMF, which is useful for including the diagrams in MS Office.
+% It is also freely available for MS Windows, Linux and macOS.
%
-% \subsubsection{Conversion process}
+% \subsection{Conversion process}
% The conversion process is currently implemented in the following way to allow the normal compilation and subsequent conversion using only one (manual) compiler run.
% Because the document must be fully compiled before the conversion can occur the \cls{standalone} executes the same \LaTeX\ compiler (e.g.\ texttt{pdflatex}) again as
% a sub-process which compiles the current document fully. This is done when the \cls{standalone} class is loaded, so that the main compiler instance is still at \Macro\documentclass
@@ -711,9 +811,34 @@
% A drawback of this implementation is that the log file created by the sub-process is overwritten by the main process and does not hold meaningful information.
% This can be compensated by setting a different jobname for the sub-process using the \Key{subjobname} conversion setting.
%
-% \subsubsection{Conversion examples}
+% \subsection{Conversion examples}
+%
+% \par\medskip\noindent
+% Produces PNG (default) with a size of 640px (suitable to be uploaded on StackExchange sites without the image getting downscaled):\\*[\smallskipamount]
+% | \documentclass[convert={size=640}]{standalone}|
+%
+% \par\medskip\noindent
+% Produces EMF, a vector format suitable for inclusion in MS Word or other MS Office software. Text content will be rendered as curves and will not be able to be copied
+% as text. This needs \emph{Inkscape} to be installed as other conversion softwares do not support this output format.\\*[\smallskipamount]
+% | \documentclass[emf]{standalone}|\\
+% or \\
+% | \documentclass[convert={emf}]{standalone}|
+%
+% \par\medskip\noindent
+% Produces SVG, a vector format suitable for inclusion in websites. Text content will be rendered as curves and will not be able to be copied
+% as text. This needs \emph{Inkscape} to be installed as other conversion softwares do not support this output format.\\*[\smallskipamount]
+% | \documentclass[svg]{standalone}|\\
+% or \\
+% | \documentclass[convert={svg}]{standalone}|
+%
+% \par\medskip\noindent
+% Produces GIF with a size of 640px. This needs \emph{ImageMagick} to be installed as other conversion softwares do not support this output format.\\*[\smallskipamount]
+% | \documentclass[gif={size=640}]{standalone}|\\
+% or \\
+% | \documentclass[convert={gif,size=640}]{standalone}|
%
-% PDF/PS is rastered with 600x100dpi and then converted to JPG:\\*[\smallskipamount]
+% \par\medskip\noindent
+% PDF/PS is rastered with 600x100dpi and then converted to JPG (not recommended):\\*[\smallskipamount]
% | \documentclass[convert={density=600x100,outext=.jpg}]{standalone}|
%
% \par\medskip\noindent
@@ -725,82 +850,6 @@
% | \documentclass[convert={ghostscript,gsdevice=tiffg4,|\\*
% | outext=.tiff,density=72}]{standalone}|
%
-% \par\medskip\noindent
-% Produces PNG (default) with a size of 640px (suitable to be uploaded on StackExchange sites without the image getting downscaled):\\*[\smallskipamount]
-% | \documentclass[convert={size=640}]{standalone}|
-%
-%
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% \subsection{Simple TeX File}
-% A simple \file{standalone.tex} file is provided together with the bundle, which may be useful in special occasions.
-% It will set the \cs{ifstandalone} switch to \emph{true} when compiled standalone but to \emph{false}
-% when loaded after any |\documentclass| macro, as long the switch isn't defined yet.
-% It must be used if this switch is required before the |\documentclass| of a standalone file.
-%
-% \noindent
-% \begin{minipage}{\textwidth}\noindent
-% \begin{lstlisting}[language={[latex]tex},gobble=4,frame=lines,numbers=none,caption={Usage of 'standalone.tex'.}]
-% \input{standalone} % use before any '\documentclass'
-% \ifstandalone
-% % Used only if compiled standalone
-% \fi
-% \end{lstlisting}
-% \end{minipage}
-%
-% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% \subsection{FAQ / Troubleshooting}\label{sec:classfaq}
-% This section expands some issues and their solution which can arise with the \cls{standalone} class.
-%
-% \subsubsection*{Large white space / border at the right side}
-% A large white space / border on the right side occurs when the content is placed inside a paragraph.
-% This causes the content to be \Macro\linewidth wide and so smaller pictures will contain now a white space at the right.
-% A common cause for this is that there was is a empty line between the content and \Macro\end{document} which causes a paragraph break.
-%
-% This issue can be solved by either removing any trailing lines or other paragraph breaks, or by using the \opt{varwidth} option which suppresses the extra added width.
-% It is also possible to use the \opt{multi} option and \Macro\standaloneenv{<environment name>} to declare certain environments as page content.
-% The \opt{tikz} option does this for \env{tikzpictures} and the \opt{pstricks} option for \env{pspicture}. See the descriptions of these options for more details.
-%
-% \subsubsection*{Some amount of the content on the right side is missing}
-% If the content is cropped to much on the right side, check if the \opt{varwidth} option is used. In this case the used maximum width (\Macro\linewidth by default) is too small.
-% A larger width can be set using \hbox{\opt{varwidth}\MacroArgs'='<length>} or the option can be disabled altogether using \hbox{\opt{varwidth}|=false|}.
-% The largest width possible is given by \Macro\maxdimen, which however might cause internal overflows.
-%
-% This can also be caused with \cls{beamer} content (i.e.\ when the \opt{beamer} option is used). In this case no cropping or \env{varwidth} environment is used at all,
-% but the content is simply to large to fit on a \cls{beamer} \env{frame}. To avoid this rescale the content to do fit. This can be realised by either using
-% scaling facilities of the used picture environment (like |scale| with \env{environment}, but this only scales coordinates) or using \Macro\scalebox or \Macro\resizebox from \pkg{graphicx}.
-% For complicated code which contains verbatim or other catcode changing code either the \Macro\Resizebox from the \pkg{realboxes} package
-% or the \MacroArgs{adjustbox}{scale=<factor>} environment from the \pkg{adjustbox} package should be used.
-%
-% \subsubsection*{A multi-page document contains some pages with unwanted content}
-% This is caused while \opt{multi}|=true| and \opt{crop}|=true| are set but \opt{ignorerest}|=false| \emph{and} the document contains
-% typeset material outside of environments declared with \Macro\standaloneenv. To avoid that this extra material should be removed or \opt{ignorerest} should be set to |true|.
-% This will also ignore all settings inside the document body which are not inside a declared environment. These can be moved to the preamble instead.
-% See the description of the \opt{ignorerest} option for more details.
-%
-% \subsubsection*{In a multi-page document using DVI/PS mode all pages except the first have a vertical offset}
-% The vertical reference points in PostScript could does not change when the pages are resized to fit the individual content of every page.
-% Therefore an offset is added to compensate for this, which shifts the content to the appropriate vertical position.
-% Should this not work as expected please inform the package author and provide a small example which causes this issue, together with the version number of the used |latex| compiler and tools (like |dvips|, |ps2pdf|)
-% as well as the used \cls{standalone} bundle.
-%
-% \subsubsection*{Issues with cropped files in DVI mode}
-% The \opt{crop} option uses PostScript commans in DVI mode, i.e.\ when |latex| not |pdflatex| (or others) is used as a compiler.
-% This PostScript commands will only work once the DVI is converted to PS or EPS.
-% Currently this cropping code is experimental and might not produce a full (E)PS standard compatible file.
-% This can lead to wrong bounding boxes and wrong orientations or, dependent on the used PostScript tool, even to PostScript compiler errors.
-% Some issues can be overcome by converting the the (E)PS file to a (more) standard compatible version using tools like |eps2eps| or Ghostscript.
-%
-% \subsubsection*{Errors ``Float(s) lost'' or ``not in outer par mode''}
-% Floating environments like \env{figure} or \env{table} can not be used while \Key{float}'=true' and either \Key{crop}'=true' or \Key{preview}'=true' is set.
-% The last two options will try to store the float into a box which is not allowed (because it can't the float any longer).
-% Usually \Key{float}'=false' will solve this error, because it turns these environments into non-floating alternatives.
-% Because both the \Key{crop} and \Key{preview} option will set \Key{float}'=false' themselves, this issue can only arise when the \Key{float} option is manually set afterwards.
-%
-% \subsubsection*{Image conversion does not work}
-% In order for the image conversion to work an external conversion software must be installed. By default either Image Magkick or GhostScript is used. Please insure that either or both of these softwares are installed.
-% Installation guide for your operating system should be easily available on the Internet. The \LaTeX\ compiler option |-shell-escape| must be used to allow this external software to be executed from within the \LaTeX\ code.
-% If this two points are fulfilled but the conversion does still not work, please check the log file. The lines in question start with `|runsystem|' (at least with \TeX\ Live 2011).
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1325,6 +1374,7 @@
\newif\ifsa@convert
\newif\ifsa@float
\newif\ifsa@math
+\newif\ifsa@convert@perpage
% \end{macrocode}
%
% The \cs{ifstandalonebeamer} switch is in the user-level.
@@ -1708,6 +1758,17 @@
% \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}{png}
% \begin{macrocode}
\sa@convertoption{png}[]{%
@@ -1724,16 +1785,6 @@
% \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}
@@ -1755,7 +1806,7 @@
% \begin{key}{standalone.cls/convert}{gif}
% \begin{macrocode}
\sa@convertoption{gif}[]{%
- \setkeys{standalone.cls/convert}{true,outext={.gif}}%
+ \setkeys{standalone.cls/convert}{true,imagemagick,outext={.gif}}%
}
% \end{macrocode}
% \end{key}
@@ -1769,6 +1820,40 @@
% \end{key}
%
%
+% \begin{key}{standalone.cls/convert}{svg}
+% \begin{macrocode}
+\sa@convertoption{svg}[]{%
+ \setkeys{standalone.cls/convert}{true,inkscape,outext={.svg}}%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{standalone.cls}{svg}
+% \begin{macrocode}
+\sa@clsoption{svg}[]{%
+ \setkeys{standalone.cls/convert}{svg,#1}%
+}
+% \end{macrocode}
+% \end{key}
+%
+%
+% \begin{key}{standalone.cls/convert}{emf}
+% \begin{macrocode}
+\sa@convertoption{emf}[]{%
+ \setkeys{standalone.cls/convert}{true,inkscape,outext={.emf}}%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{standalone.cls}{emf}
+% \begin{macrocode}
+\sa@clsoption{emf}[]{%
+ \setkeys{standalone.cls/convert}{emf,#1}%
+}
+% \end{macrocode}
+% \end{key}
+%
+%
% \begin{key}{standalone.cls/convert}{onfailure}
% \begin{macrocode}
\sa@convertoption{onfailure}{%
@@ -1806,6 +1891,14 @@
% \end{macrocode}
% \end{key}
%
+% \begin{key}{standalone.cls/convert}{perpage}
+% Boolean key to indicate to run the convert command once per page.
+% \begin{macrocode}
+\sa@convertoption{perpage}[true]{%
+ \sa@boolean{convert@perpage}{#1}%
+}
+% \end{macrocode}
+% \end{key}
%
% \begin{key}{standalone.cls/convert}{gsdevice}
% \begin{macrocode}
@@ -1840,8 +1933,13 @@
% \begin{key}{standalone.cls/convert}{imagemagick}
% \begin{macrocode}
\sa@convertoption{imagemagick}[]{%
- \def\sa@convert@command{\convertexe\space -density \density\space -units PixelsPerInch \infile\space \ifx\size\empty\else -resize \size\fi\space -quality 90 \outfile}%
- \let\sa@convert@pageoffset\m@ne
+ \def\sa@convert@command{\convertexe\space
+ -density \density\space
+ -units PixelsPerInch
+ \infile\ifsa@convert@perpage[\prevpagenum]\fi\space
+ -scene 1
+ \ifx\size\empty\else -resize \size\fi\space
+ -quality 90 \outfile}%
}
% \end{macrocode}
% \end{key}
@@ -1849,26 +1947,66 @@
% \begin{key}{standalone.cls/convert}{ghostscript}
% \begin{macrocode}
\sa@convertoption{ghostscript}[]{%
- \def\sa@convert@command{\gsexe\space -dSAFER -dBATCH -dNOPAUSE -sDEVICE=\gsdevice\space -r\density\space -sOutputFile=\outfile\space \infile}%
- \let\sa@convert@pageoffset\z@
+ \def\sa@convert@command{\gsexe\space -dSAFER -dBATCH -dNOPAUSE
+ \ifsa@convert@perpage-sPageList=\pagenum\fi\space
+ -sDEVICE=\gsdevice\space
+ -r\density\space
+ -sOutputFile=\outfile\space \infile
+ }%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{standalone.cls/convert}{ghostscript32}
+% \begin{macrocode}
+\sa@convertoption{ghostscript32}[]{%
+ \setkeys{standalone.cls/convert}{ghostscript,gsexe=\@nameuse{sa@convert@gsexe32}}%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{standalone.cls/convert}{ghostscript64}
+% \begin{macrocode}
+\sa@convertoption{ghostscript64}[]{%
+ \setkeys{standalone.cls/convert}{ghostscript,gsexe=\@nameuse{sa@convert@gsexe64}}%
}
% \end{macrocode}
% \end{key}
%
+% \begin{key}{standalone.cls/convert}{inkscape}
% \begin{macrocode}
-\sa@convertvar{latexoptions}{ -shell-escape }
+\sa@convertoption{inkscape}[]{%
+ \def\sa@convert@command{\inkscapeexe\space
+ --pdf-poppler \sa@inkscape@bgcolor\space
+ --export-type="\expandafter\@gobble\outext"
+ --pdf-page=\pagenum\space
+ -o \outfile\space \infile}
+ \sa@convert@perpagetrue
+ \def\sa@multi@pagemark{\pagenum}%
+}
+\def\sa@inkscape@bgcolor{\ifx\sa@convert@bgcolor\@empty\else--actions="export-background:\sa@convert@bgcolor"\fi}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{macrocode}
+\sa@convertvar{latexoptions}{ -shell-escape \ifx\outputdir\empty\else-output-directory \sa@convert@quote\outputdir\sa@convert@quote\fi\space}
\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}
+\sa@convertvar{infile}{\indir\inname\inext}
+\sa@convertvar{outputdir}{}
+\sa@convertvar{indir}{\outputdir}
+\sa@convertvar{outdir}{\outputdir}
\sa@convertvar{outext}{.png}
\sa@convertvar{outname}{\inname}
-\sa@convertvar{outfile}{\outname\ifsa@multi\sa@multi@pagemark\fi\outext}
-\def\sa@multi@pagemark{-\percent0d}%
+\sa@convertvar{outfile}{\outdir\outname\ifsa@multi\sa@multi@pagemark\fi\outext}
+\def\sa@multi@pagemark{-\percent0d}
+\def\sa@convert@pagenum{1}
\sa@convertvar{density}{300}
+\sa@convertvar{bgcolor}{}
\sa@convertvar{gsdevice}{%
\expandafter\ifx\csname sa@gsdevice@\outext\endcsname\relax
\expandafter\@gobble\outext
@@ -1880,19 +2018,19 @@
\sa@convertvar{latex}{lualatex}
\sa@convertvar{inext}{.pdf}
\sa@convertvar{precommand}{}
- \setkeys{standalone.cls/convert}{imagemagick}
+ \setkeys{standalone.cls/convert}{ghostscript}
\else
\ifpdf
\sa@convertvar{latex}{pdflatex}
\sa@convertvar{inext}{.pdf}
\sa@convertvar{precommand}{}
- \setkeys{standalone.cls/convert}{imagemagick}
+ \setkeys{standalone.cls/convert}{ghostscript}
\else
\ifxetex
\sa@convertvar{latex}{xelatex}
\sa@convertvar{inext}{.pdf}
\sa@convertvar{precommand}{}
- \setkeys{standalone.cls/convert}{imagemagick}
+ \setkeys{standalone.cls/convert}{ghostscript}
\else
\sa@convertvar{latex}{latex}
\sa@convertvar{inext}{.ps}
@@ -1901,8 +2039,7 @@
\fi\fi\fi
% \end{macrocode}
%
-% Test for windows to avoid using the 'convert' executable there.
-% It is also the FAT-to-NTFS conversion tool!
+% Test for windows to set executable correctly.
% \begin{macrocode}
\begingroup
\ifluatex
@@ -1918,16 +2055,20 @@
\fi
\if@tempswa
\endgroup
- \sa@convertvar{convertexe}{imgconvert}
- \sa@convertvar{gsexe}{gswin32c}
+ \@namedef{sa@convert@gsexe32}{gswin32c}
+ \@namedef{sa@convert@gsexe64}{gswin64c}
\else
\endgroup
- \sa@convertvar{convertexe}{convert}
- \sa@convertvar{gsexe}{gs}
+ \@namedef{sa@convert@gsexe32}{gs}
+ \@namedef{sa@convert@gsexe64}{gs}
\fi
+\sa@convertvar{gsexe}{\@nameuse{sa@convert@gsexe64}}
+\sa@convertvar{convertexe}{magick convert}
+\sa@convertvar{inkscapeexe}{inkscape}
% \end{macrocode}
%
%
+%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \subsubsection{General macros}
%
@@ -2438,6 +2579,7 @@
\fi
\global\paperwidth=\wd\sa@box
\global\paperheight=\ht\sa@box
+ \special{papersize=\the\paperwidth,\the\paperheight}
\global\hsize=\wd\sa@box
\global\vsize=\ht\sa@box
\global\@colht=\ht\sa@box
@@ -2449,6 +2591,7 @@
\def\sa@placebox{%
\global\paperwidth=\wd\sa@box
\global\paperheight=\ht\sa@box
+ \special{papersize=\the\paperwidth,\the\paperheight}
\global\@colht=\maxdimen
\global\@colroom=\maxdimen
\global\hsize=\maxdimen
@@ -2598,6 +2741,13 @@
\ifsa@convert
% \end{macrocode}
%
+% Disable \Macro\sa@convert@perpage if 'multi' option is not set.
+% \begin{macrocode}
+\ifsa@multi\else
+\sa@convert@perpagefalse
+\fi
+% \end{macrocode}
+%
% \begin{macrocode}
\def\sa@convert@stop{\csname fi\endcsname\stop}%
\begingroup
@@ -2660,7 +2810,9 @@
\endgroup
%
\@tempcnta\sa@multi@numpages\relax
- \advance\@tempcnta\sa@convert@pageoffset\relax
+ \ifsa@convert@perpage
+ \def\sa@multi@pagemark{-\pagenum}%
+ \else
\ifnum\@tempcnta=\z@
\def\sa@multi@pagemark{}%
\edef\sa@lastoutfile{\outfile}%
@@ -2676,6 +2828,7 @@
\repeat
\edef\sa@multi@pagemark{-\percent0\the\@tempcntb d}%
\fi
+ \fi
%
\if@tempswa
\edef\infile@filemodafter{\csname pdf\ifluatex @\fi filemoddate\endcsname{\infile}}%
@@ -2690,20 +2843,40 @@
\message{Executing precommand:^^J\sa@convert@precommand^^J^^J}%
\ShellEscape{\sa@convert@precommand}%
\fi
+ \ifsa@convert@perpage
+ \begingroup
+ \@tempcnta\sa@multi@numpages\relax
+ \@tempcntb\z@
+ \def\pagenum{\the\@tempcntb}%
+ \loop\ifnum\@tempcntb<\@tempcnta
+ \edef\prevpagenum{\pagenum}%
+ \advance\@tempcntb\@ne
+ \sa@execute@convert@command
+ \sa@checkoutfile{\outfile}{#1}%
+ \repeat
+ \endgroup
+ \else
+ \sa@execute@convert@command
+ \sa@checkoutfile{\sa@lastoutfile}{#1}%
+ \fi
+ \@tempswafalse
+}
+\def\sa@execute@convert@command{%
\message{Executing command:^^J\sa@convert@command^^J^^J}%
\ShellEscape{\sa@convert@command}%
- \@tempswafalse
- \IfFileExists{\sa@lastoutfile}{%
- \edef\filemodafter{\csname pdf\ifluatex @\fi filemoddate\endcsname{\sa@lastoutfile}}%
+}
+\def\sa@checkoutfile#1#2{%
+ \IfFileExists{#1}{%
+ \edef\filemodafter{\csname pdf\ifluatex @\fi filemoddate\endcsname{#1}}%
\ifx\filemodbefore\filemodafter
\expandafter\ifx\csname pdf\ifluatex @\fi filemoddate\endcsname\relax\else
- \sa@convert@failuremsg{standalone}{#1}{}%
+ \sa@convert@failuremsg{standalone}{#2}{}%
\fi
\else
- \typeout{Class standalone:^^JOutput written on \sa@lastoutfile.}%
+ \typeout{Class standalone:^^JOutput written on #1.}%
\fi
}{%
- \sa@convert@failuremsg{standalone}{#1}{}%
+ \sa@convert@failuremsg{standalone}{#2}{}%
}%
}
% \end{macrocode}
@@ -2716,14 +2889,20 @@
\let\infile\sa@convert@infile
\let\inext\sa@convert@inext
\let\inname\sa@convert@inname
+\let\indir\sa@convert@indir
+\let\outdir\sa@convert@outdir
+\let\outputdir\sa@convert@outputdir
\let\gsdevice\sa@convert@gsdevice
\let\convertexe\sa@convert@convertexe
\let\gsexe\sa@convert@gsexe
+\let\inkscapeexe\sa@convert@inkscapeexe
+\let\gsexe\sa@convert@gsexe
\let\density\sa@convert@density
\let\size\sa@convert@size
\let\outext\sa@convert@outext
\let\outname\sa@convert@outname
\let\outfile\sa@convert@outfile
+\let\pagenum\sa@convert@pagenum
\let\percent\@percentchar
\let\quote\sa@convert@quote
% \end{macrocode}
diff --git a/macros/latex/contrib/standalone/standalone.pdf b/macros/latex/contrib/standalone/standalone.pdf
index 3c494438ff..d3e23e26a2 100644
--- a/macros/latex/contrib/standalone/standalone.pdf
+++ b/macros/latex/contrib/standalone/standalone.pdf
Binary files differ