diff options
author | Karl Berry <karl@freefriends.org> | 2011-04-28 22:36:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-04-28 22:36:09 +0000 |
commit | 7baa3b2da85b6c1521d5f52417f2ebbf0f51ce41 (patch) | |
tree | eadaf3c57105662f582b67417a6a28ed9a76637f /Master/texmf-dist | |
parent | 97073d3a436fba10891a4529c3b2f96a6b11b08f (diff) |
xpackages 2155 (28apr11)
git-svn-id: svn://tug.org/texlive/trunk@22237 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
23 files changed, 881 insertions, 398 deletions
diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf Binary files differindex 46ddb3af2d7..488d40afe53 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex index 5684ce7a90f..5684ce7a90f 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex index 489e9f2304a..489e9f2304a 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf Binary files differindex e0658ab2cfc..7463a0680ae 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex index d981888d450..d981888d450 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf Binary files differindex cac2713ab39..129ab8a8032 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf Binary files differindex 602171eabae..c3f91ddeb4e 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf diff --git a/Master/texmf-dist/doc/latex/xpackages/xcoffins/l3coffins.pdf b/Master/texmf-dist/doc/latex/xpackages/xcoffins/l3coffins.pdf Binary files differindex cea7c8213a9..70f77b26e66 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xcoffins/l3coffins.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xcoffins/l3coffins.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins-test.tex b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-test.tex index 1ede1770c08..1ede1770c08 100644 --- a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins-test.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-test.tex diff --git a/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-tschichold-example-keyval.tex b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-tschichold-example-keyval.tex new file mode 100644 index 00000000000..e83c0b490b6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-tschichold-example-keyval.tex @@ -0,0 +1,281 @@ + +\documentclass{article} + +\usepackage[a4paper,margin=5pt]{geometry} + +\usepackage[T1]{fontenc} +\usepackage{times,multicol,graphicx} +\usepackage{xcoffins} + +\usepackage{times,color} +\newcommand\cbox[2][.8]{{\setlength\fboxsep{0pt}\colorbox[gray]{#1}{#2}}} + +\ExplSyntaxOn + +\ExplSyntaxOff + + + +%\scrollmode + +\pagestyle{empty} + +\begin{document} + + \NewCoffin \result + \NewCoffin \aaa + \NewCoffin \bbb + \NewCoffin \ccc + \NewCoffin \ddd + \NewCoffin \eee + \NewCoffin \fff + \NewCoffin \rulei + \NewCoffin \ruleii + \NewCoffin \ruleiii + +\SetHorizontalCoffin \result {} +\SetHorizontalCoffin \aaa {\fontsize{52}{50}\sffamily\bfseries mitteilungen} +\SetHorizontalCoffin \bbb {\fontsize{52}{50}\sffamily\bfseries typographische} +\SetHorizontalCoffin \ccc {\fontsize{12}{10}\sffamily + \quad zeitschrift des bildungsverbandes der + deutschen buchdrucker leipzig + \textbullet{} oktoberheft 1925} +\SetHorizontalCoffin \ddd {\fontsize{28}{20}\sffamily sonderheft} +\SetVerticalCoffin \eee {180pt} + {\raggedleft\fontsize{31}{36}\sffamily\bfseries + elementare\\ + typographie} +\SetVerticalCoffin \fff {140pt} + {\raggedright \fontsize{13}{14}\sffamily\bfseries + natan altman \\ + otto baumberger \\ + herbert mayer \\ + max burchartz \\ + el lissitzky \\ + ladislaus moholy-nagy \\ + moln\'ar f.~farkas \\ + johannes molzahn \\ + kurt schwitters \\ + mart stam \\ + ivan tschichold} + +\RotateCoffin \bbb {90} +\RotateCoffin \ccc {270} + +\SetHorizontalCoffin \rulei {\color{red}\rule{6.5in}{1pc}} +\SetHorizontalCoffin \ruleii {\color{red}\rule{1pc}{23.5cm}} +\SetHorizontalCoffin \ruleiii{\color{black}\rule{10pt}{152pt}} + + +\JoinCoffins \result \aaa +\JoinCoffins [ + coffin1-hpole = \aaa-t , + coffin1-vpole = \aaa-r , + coffin2-hpole = b , + coffin2-vpole = r , + voffset = 2 mm , +] \result \rulei +\JoinCoffins [ + coffin1-hpole = \aaa-b , + coffin1-vpole = \aaa-l , + coffin2-hpole = B , + coffin2-vpole = r , + hoffset = 2 pt , +] \result \bbb +\JoinCoffins [ + coffin1-hpole = \bbb-t , + coffin1-vpole = \bbb-r , + coffin2-hpole = t , + coffin2-vpole = r , + hoffset = -2 mm , +] \result \ruleii +\JoinCoffins [ + coffin1-hpole = \aaa-B , + coffin1-vpole = \aaa-r , + coffin2-hpole = B , + coffin2-vpole = l , + hoffset = 66 pt , + voffset = 14 pc , +] \result \ccc +\JoinCoffins [ + coffin1-hpole = \bbb-l , + coffin1-vpole = \ccc-B , + coffin2-hpole = t , + coffin2-vpole = r , + hoffset = -2 mm , +] \result \fff +\JoinCoffins [ + coffin1-hpole = \fff-b , + coffin1-vpole = \fff-r , + coffin2-hpole = b , + coffin2-vpole = l , + hoffset = 2 mm , +] \result \ruleiii +\JoinCoffins [ + coffin1-hpole = \ccc-r , + coffin1-vpole = \fff-l , + coffin2-hpole = B , + coffin2-vpole = r , +] \result \eee +\JoinCoffins [ + coffin1-hpole = \eee-T , + coffin1-vpole = \eee-r , + coffin2-hpole = B , + coffin2-vpole = r , + voffset = 4 pc , +] \result \ddd + + +\vspace*{3cm} +\begin{center} + {\Large Title page of ``elementare typographie'' by Ivan Tschichold\par} + +\large +\vspace*{1cm} + + 1. first the scanned original from 1925 + +\vspace*{6mm} + + 2. then the recreated \TeX{} version from 2010 using coffins---not + attempting\\ to match the fonts and size but the structure + +\vspace*{6mm} + + 3. and finally the source code used. + + This document uses the new + implementation by Joseph in \texttt{l3coffins-new}. + +\end{center} + +\newpage + + +\begin{center} + \null + \fbox{\includegraphics[scale=.95]{elementare-typographie-title.jpg}} +\end{center} + +\newpage + +\TypesetCoffin \result + +\newpage + +\vspace*{3cm} +\begin{center} + {\Large Code used: \par} +\vspace*{1cm} + + +\begin{minipage}{14cm} +\begin{verbatim} +\SetHorizontalCoffin\result{} +\SetHorizontalCoffin \aaa {\fontsize{52}{50}\sffamily\bfseries mitteilungen} +\SetHorizontalCoffin \bbb {\fontsize{52}{50}\sffamily\bfseries typographische} +\SetHorizontalCoffin \ccc {\fontsize{12}{10}\sffamily + \quad zeitschrift des bildungsverbandes der + deutschen buchdrucker leipzig + \textbullet{} oktoberheft 1925} +\SetHorizontalCoffin \ddd {\fontsize{28}{20}\sffamily sonderheft} +\SetVerticalCoffin \eee {180pt} + {\raggedleft\fontsize{31}{36}\sffamily\bfseries + elementare\\ + typographie} +\SetVerticalCoffin \fff {140pt} + {\raggedright \fontsize{13}{14}\sffamily\bfseries + natan altman \\ + otto baumberger \\ + herbert mayer \\ + max burchartz \\ + el lissitzky \\ + ladislaus moholy-nagy \\ + moln\'ar f.~farkas \\ + jahannes molzahn \\ + kurt schwitters \\ + mart stam \\ + ivan tschichold} + +\RotateCoffin \bbb {90} +\RotateCoffin \ccc {270} + +\SetHorizontalCoffin \rulei {\color{red}\rule{6.5in}{1pc}} +\SetHorizontalCoffin \ruleii {\color{red}\rule{1pc}{23.5cm}} +\SetHorizontalCoffin \ruleiii{\color{black}\rule{10pt}{152pt}} + +\JoinCoffins \result \aaa +\JoinCoffins [ + coffin1-hpole = \aaa-t , + coffin1-vpole = \aaa-r , + coffin2-hpole = b , + coffin2-vpole = r , + voffset = 2 mm , +] \result \rulei +\JoinCoffins [ + coffin1-hpole = \aaa-b , + coffin1-vpole = \aaa-l , + coffin2-hpole = B , + coffin2-vpole = r , + hoffset = 2 pt , +] \result \bbb +\JoinCoffins [ + coffin1-hpole = \bbb-t , + coffin1-vpole = \bbb-r , + coffin2-hpole = t , + coffin2-vpole = r , + hoffset = -2 mm , +] \result \ruleii +\JoinCoffins [ + coffin1-hpole = \aaa-B , + coffin1-vpole = \aaa-r , + coffin2-hpole = B , + coffin2-vpole = l , + hoffset = 66 pt , + voffset = 14 pc , +] \result \ccc +\JoinCoffins [ + coffin1-hpole = \bbb-l , + coffin1-vpole = \ccc-B , + coffin2-hpole = t , + coffin2-vpole = r , + hoffset = -2 mm , +] \result \fff +\JoinCoffins [ + coffin1-hpole = \fff-b , + coffin1-vpole = \fff-r , + coffin2-hpole = b , + coffin2-vpole = l , + hoffset = 2 mm , +] \result \ruleiii +\JoinCoffins [ + coffin1-hpole = \ccc-r , + coffin1-vpole = \fff-l , + coffin2-hpole = B , + coffin2-vpole = r , +] \result \eee +\JoinCoffins [ + coffin1-hpole = \eee-T , + coffin1-vpole = \eee-r , + coffin2-hpole = B , + coffin2-vpole = r , + voffset = 4 pc , +] \result \ddd +\SetHorizontalCoffin\result{} +\SetHorizontalCoffin \aaa {\fontsize{52}{50}\sffamily\bfseries + mitteilungen} +\SetHorizontalCoffin \bbb {\fontsize{52}{50}\rotatebox{90}{\sffamily\bfseries + typographische}} + +\TypesetCoffin \result +\end{verbatim} + +This is not necessarily the final syntax but for now it does its job. For +example, flexible support for adding ornaments (lines, \ldots) is still +missing, so above the rules got added as predefined individual coffins. + +\end{minipage} +\end{center} + +\end{document} + diff --git a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins-tschichold-example.tex b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-tschichold-example.tex index 1d76806feb2..343c9d7e29f 100644 --- a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins-tschichold-example.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins-tschichold-example.tex @@ -5,7 +5,7 @@ \usepackage[T1]{fontenc} \usepackage{times,multicol,graphicx} -\usepackage{l3coffins-new} +\usepackage{xcoffins} \usepackage{times,color} \newcommand\cbox[2][.8]{{\setlength\fboxsep{0pt}\colorbox[gray]{#1}{#2}}} @@ -110,7 +110,7 @@ \end{center} \newpage -xw + \TypesetCoffin \result \newpage diff --git a/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins.pdf b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins.pdf Binary files differindex 1efc45c081d..91e9f8d7eb1 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xcoffins/xcoffins.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xhead/xhead-test.tex b/Master/texmf-dist/doc/latex/xpackages/xhead/xhead-test.tex index f845a1f077a..f845a1f077a 100644 --- a/Master/texmf-dist/source/latex/xpackages/xhead/xhead-test.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xhead/xhead-test.tex diff --git a/Master/texmf-dist/doc/latex/xpackages/xhead/xhead.pdf b/Master/texmf-dist/doc/latex/xpackages/xhead/xhead.pdf Binary files differindex a1cd0c615b7..a935588fe4b 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xhead/xhead.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xhead/xhead.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex index a00531e0741..a00531e0741 100644 --- a/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex +++ b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex diff --git a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf Binary files differindex 68746b10821..fd09b43327e 100644 --- a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf +++ b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx index ab45217f33f..1a90d4891f4 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx @@ -41,7 +41,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: xparse.dtx 2136 2011-01-23 12:15:49Z joseph $ +\GetIdInfo$Id: xparse.dtx 2219 2011-04-08 21:07:45Z joseph $ {Generic document command parser} %\iffalse %<*driver> @@ -1433,7 +1433,10 @@ } \xparse_declare_cmd_aux:Nnn #1 {#2} } -\cs_new:Npn \xparse_declare_cmd_aux:Nnn #1#2#3 { +\cs_new:Npn \xparse_declare_cmd_aux:Nnn #1#2#3 { + \cs_if_exist:cF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } + { \tl_new:c { l_xparse_ \token_to_str:N #1 _arg_spec_tl } } + \tl_set:cn { l_xparse_ \token_to_str:N #1 _arg_spec_tl } {#2} \xparse_count_mandatory:n {#2} \xparse_prepare_signature:n {#2} \bool_if:NTF \l_xparse_m_only_bool { @@ -1448,11 +1451,16 @@ #1 \cs_set_protected_nopar:Npn \l_xparse_total_args_int {#2} } \cs_new:Npn \xparse_declare_cmd_mixed:Nn #1#2 { + \group_begin: + \tex_escapechar:D 92 \scan_stop: + \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1 } + \exp_args:NNNo \group_end: + \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } \cs_set_protected_nopar:Npx #1 { \exp_not:n { \int_zero:N \l_xparse_processor_int \tl_set:Nn \l_xparse_args_tl - } { \exp_not:c { \token_to_str:N #1 } } + } { \exp_not:c { \l_xparse_function_tl } } \exp_not:V \l_xparse_signature_tl \exp_not:N \l_xparse_args_tl } @@ -2423,7 +2431,11 @@ \msg_kernel_info:nnxx { xparse } { define-command } { \token_to_str:N #1 } { \exp_not:n {#2} } } - \tl_set:Nn \l_xparse_function_tl {#1} + \group_begin: + \tex_escapechar:D 92 \scan_stop: + \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1} + \exp_args:NNNo \group_end: + \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } \xparse_exp_prepare_function:n {#2} \int_compare:nTF { \l_xparse_total_args_int = \l_xparse_m_args_int @@ -2564,27 +2576,32 @@ % %\subsection{Access to the argument specification} % -%\begin{macro}{\parse_get_arg_spec:N} -%\begin{macro}{\parse_get_arg_spec:n} +%\begin{macro}{\xparse_get_arg_spec:N} +%\begin{macro}{\xparse_get_arg_spec:n} %\begin{macro}{\ArgumentSpecification} % Recovering the argument specification is also trivial, using the % \cs{tl_set_eq:cN} function. % \begin{macrocode} -\cs_new_protected:Npn \parse_get_arg_spec:N #1 { - \cs_if_exist:cTF { l_parse_ \token_to_str:N #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_get_arg_spec:N #1 { + \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } { \tl_set_eq:Nc \ArgumentSpecification - { l_parse_ \token_to_str:N #1 _arg_spec_tl } + { l_xparse_ \token_to_str:N #1 _arg_spec_tl } } { - \msg_kernel_error:nx { unknown-document-command } + \msg_kernel_error:nnx { xparse } { unknown-document-command } { \token_to_str:N #1 } } } -\cs_new_protected:Npn \parse_get_arg_spec:n #1 { - \cs_if_exist:cTF { l_parse_ #1 _arg_spec_tl } - { \tl_set_eq:Nc \ArgumentSpecification { l_parse_ #1 _arg_spec_tl } } - { \msg_kernel_error:nx { unknown-document-environment } {#1} } +\cs_new_protected:Npn \xparse_get_arg_spec:n #1 { + \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } + { + \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } + } + { + \msg_kernel_error:nnx { xparse } + { unknown-document-environment } {#1} + } } \tl_new:N \ArgumentSpecification % \end{macrocode} @@ -2592,30 +2609,33 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\parse_show_arg_spec:N} -%\begin{macro}{\parse_show_arg_spec:n} +%\begin{macro}{\xparse_show_arg_spec:N} +%\begin{macro}{\xparse_show_arg_spec:n} % Showing the argument specification simply means finding it and then % calling the \cs{tl_show:c} function. % \begin{macrocode} -\cs_new_protected:Npn \parse_show_arg_spec:N #1 { - \cs_if_exist:cTF { l_parse_ \token_to_str:N #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_show_arg_spec:N #1 { + \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } { \tl_set_eq:Nc \ArgumentSpecification - { l_parse_ \token_to_str:N #1 _arg_spec_tl } + { l_xparse_ \token_to_str:N #1 _arg_spec_tl } \tl_show:N \ArgumentSpecification } { - \msg_kernel_error:nx { unknown-document-command } + \msg_kernel_error:nnx { xparse } { unknown-document-command } { \token_to_str:N #1 } } } -\cs_new_protected:Npn \parse_show_arg_spec:n #1 { - \cs_if_exist:cTF { l_parse_ #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_show_arg_spec:n #1 { + \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } { - \tl_set_eq:Nc \ArgumentSpecification { l_parse_ #1 _arg_spec_tl } + \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } \tl_show:N \ArgumentSpecification } - { \msg_kernel_error:nx { unknown-document-environment } {#1} } + { + \msg_kernel_error:nnx { xparse } + { unknown-document-environment } {#1} + } } % \end{macrocode} %\end{macro} @@ -2691,7 +2711,7 @@ Argument~specification~'#1'~contains~a~processor~function:\\ this~is~only~supported~for~standard~robust~functions. } -\msg_kernel_set:nnnn { xparse } { split-excess-tokens } +\msg_kernel_new:nnnn { xparse } { split-excess-tokens } { Too~many~'#1'~tokens~when~trying~to~split~argument. } { LaTeX~was~asked~to~split~the~input~'#3'\\ @@ -2704,6 +2724,18 @@ The~letter~#1'~does~not~specify~a~known~argument~type.\\ I'm~assuming~you~want~a~standard~mandatory~argument~(type~'m'). } +\msg_kernel_new:nnnn { xparse } { unknown-document-command } + { Unknown~document~command~'#1'. } + { + You~have~asked~for~the~argument~specification~for~a~command~'#1',~ + but~this~is~not~a~document~command. + } +\msg_kernel_new:nnnn { xparse } { unknown-document-environment } + { Unknown~document~environment~'#1'. } + { + You~have~asked~for~the~argument~specification~for~a~command~'#1',~ + but~this~is~not~a~document~environment. + } % \end{macrocode} % % Intended more for information. @@ -2934,10 +2966,10 @@ %\begin{macro}{\ShowDocumentEnvironmentArgSpec} % More simple mappings. % \begin{macrocode} -\cs_new_eq:NN \GetDocumentCommandArgSpec \parse_get_arg_spec:N -\cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \parse_get_arg_spec:n -\cs_new_eq:NN \ShowDocumentCommandArgSpec \parse_show_arg_spec:N -\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \parse_show_arg_spec:n +\cs_new_eq:NN \GetDocumentCommandArgSpec \xparse_get_arg_spec:N +\cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \xparse_get_arg_spec:n +\cs_new_eq:NN \ShowDocumentCommandArgSpec \xparse_show_arg_spec:N +\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \xparse_show_arg_spec:n % \end{macrocode} %\end{macro} %\end{macro} diff --git a/Master/texmf-dist/source/latex/xpackages/xcoffins/l3coffins.dtx b/Master/texmf-dist/source/latex/xpackages/xcoffins/l3coffins.dtx index 44dbb52fd61..59958df042f 100644 --- a/Master/texmf-dist/source/latex/xpackages/xcoffins/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xcoffins/l3coffins.dtx @@ -35,7 +35,7 @@ %<*driver|package> \RequirePackage{expl3} \RequirePackage{graphicx,xcolor,trace} -\GetIdInfo$Id: l3coffins.dtx 2109 2010-12-23 19:39:41Z joseph $ +\GetIdInfo$Id: l3coffins.dtx 2209 2011-03-23 08:33:19Z joseph $ {Coffins} %</driver|package> %<*driver> @@ -83,7 +83,8 @@ %\section{Code-level functions} % %\begin{function}{ -% \coffin_new:N | +% \coffin_new:N , +% \coffin_new:c , %} % \begin{syntax} % \cs{coffin_new:N} \meta{coffin} @@ -94,7 +95,8 @@ %\end{function} % %\begin{function}{ -% \coffin_clear:N | +% \coffin_clear:N , +% \coffin_clear:c , %} % \begin{syntax} % \cs{coffin_clear:N} \meta{coffin} @@ -104,7 +106,10 @@ %\end{function} % %\begin{function}{ -% \coffin_set_eq:NN | +% \coffin_set_eq:NN , +% \coffin_set_eq:Nc , +% \coffin_set_eq:cN , +% \coffin_set_eq:cc , %} % \begin{syntax} % \cs{coffin_set_eq:NN} \meta{coffin1} \meta{coffin2} @@ -113,7 +118,10 @@ % of \meta{coffin2} within the current \TeX\ group level. %\end{function} % -%\begin{function}{ \hcoffin_set:Nn } +%\begin{function}{ +% \hcoffin_set:Nn , +% \hcoffin_set:cn , +%} % \begin{syntax} % \cs{hcoffin_set:Nn} \meta{coffin} \Arg{material} % \end{syntax} @@ -122,7 +130,10 @@ % then set up based on the size of the typeset material. %\end{function} % -%\begin{function}{ \vcoffin_set:Nnn } +%\begin{function}{ +% \vcoffin_set:Nnn , +% \vcoffin_set:cnn , +%} % \begin{syntax} % \cs{vcoffin_set:Nnn} \meta{coffin} \Arg{width} \Arg{material} % \end{syntax} @@ -133,7 +144,8 @@ %\end{function} % %\begin{function}{ -% \coffin_set_horizontal_pole:Nnn | +% \coffin_set_horizontal_pole:Nnn , +% \coffin_set_horizontal_pole:cnn , %} % \begin{syntax} % \cs{coffin_set_horizontal_pole:Nnn} \meta{coffin} @@ -149,7 +161,8 @@ %\end{function} % %\begin{function}{ -% \coffin_set_vertical_pole:Nnn | +% \coffin_set_vertical_pole:Nnn , +% \coffin_set_vertical_pole:cnn , %} % \begin{syntax} % \cs{coffin_set_vertical_pole:Nnn} \meta{coffin} @@ -165,7 +178,8 @@ %\end{function} % %\begin{function}{ -% \coffin_rotate:Nn | +% \coffin_rotate:Nn , +% \coffin_rotate:cn , %} % \begin{syntax} % \cs{coffin_rotate:Nn} \meta{coffin} \Arg{angle} @@ -177,7 +191,10 @@ %\end{function} % %\begin{function}{ -% \coffin_attach:NnnNnnnn | +% \coffin_attach:NnnNnnnn , +% \coffin_attach:cnnNnnnn , +% \coffin_attach:Nnncnnnn , +% \coffin_attach:cnncnnnn , %} % \begin{syntax} % \cs{coffin_attach:NnnNnnnn} @@ -199,7 +216,10 @@ %\end{function} % %\begin{function}{ -% \coffin_join:NnnNnnnn | +% \coffin_join:NnnNnnnn , +% \coffin_join:cnnNnnnn , +% \coffin_join:Nnncnnnn , +% \coffin_join:cnncnnnn , %} % \begin{syntax} % \cs{coffin_join:NnnNnnnn} @@ -222,6 +242,7 @@ % %\begin{function}{ % \coffin_typeset:Nnnnn | +% \coffin_typeset:cnnnn | %} % \begin{syntax} % \cs{coffin_typeset:Nnnnn} \meta{coffin} \Arg{pole1} \Arg{pole2} @@ -238,7 +259,8 @@ %\end{function} % %\begin{function}{ -% \coffin_display_handles:Nn | +% \coffin_display_handles:cn , +% \coffin_display_handles:cn , %} % \begin{syntax} % \cs{coffin_display_handles:Nn} \meta{coffin} \Arg{colour} @@ -253,7 +275,8 @@ %\end{function} % %\begin{function}{ -% \coffin_mark_handle:Nnnn | +% \coffin_mark_handle:Nnnn , +% \coffin_mark_handle:cnnn , %} % \begin{syntax} % \cs{coffin_mark_handle:Nnnn} \meta{coffin} \Arg{pole1} \Arg{pole2} @@ -268,7 +291,8 @@ %\end{function} % %\begin{function}{ -% \coffin_show_structure:N | +% \coffin_show_structure:N , +% \coffin_show_structure:c , %} % \begin{syntax} % \cs{coffin_show_structure:N} \meta{coffin} @@ -481,97 +505,152 @@ % There are a number of basic functions needed for creating coffins and % placing material in them. This all relies on the following data % structures. +% +%\begin{macro}{\coffin_if_exist_execute:Nn} +% Several of the higher-level coffin functions will give multiple +% errors if the coffin does not exist. A cleaner way to handle this +% is provided here: both the box and the coffin structure are +% checked. +% \begin{macrocode} +\cs_new_protected:Npn \coffin_if_exist_execute:Nn #1#2 { + \cs_if_exist:NTF #1 + { + \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } + { #2 } + { + \msg_kernel_error:nnx { coffin } { unknown-coffin } + { \token_to_str:N #1 } + } + } + { + \msg_kernel_error:nnx { coffin } { unknown-coffin } + { \token_to_str:N #1 } + } +} +% \end{macrocode} +%\end{macro} % -%\begin{macro}{\coffin_clear:N} +%\begin{macro}{ +% \coffin_clear:N , +% \coffin_clear:c , +%} % Clearing coffins means emptying the box and resetting all of the % structures. % \begin{macrocode} \cs_new_protected_nopar:Npn \coffin_clear:N #1 { - \box_clear:N #1 - \coffin_reset_structure:N #1 + \coffin_if_exist_execute:Nn #1 + { + \box_clear:N #1 + \coffin_reset_structure:N #1 + } } +\cs_generate_variant:Nn \coffin_clear:N { c } % \end{macrocode} %\end{macro} % -%\begin{macro}{\coffin_new:N} +%\begin{macro}{ +% \coffin_new:N , +% \coffin_new:c , +%} % Creating a new coffin means making the underlying box and adding the % data structures. These are created globally, as there is a need to % avoid any strange effects if the coffin is created inside a group. % This means that the usual rule about \cs{l_\ldots} variables has -% to be broken. +% to be broken. % \begin{macrocode} \cs_new_protected_nopar:Npn \coffin_new:N #1 { - \cs_if_free:NTF #1 - { - \box_new:N #1 - \prop_new:c { l_coffin_corners_ \tex_number:D #1 _prop } - \prop_new:c { l_coffin_poles_ \tex_number:D #1 _prop } - \prop_gset_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } - \c_coffin_corners_prop - \prop_gset_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } - \c_coffin_poles_prop - } - { - \msg_kernel_error:nnx { coffin }{ variable-already-defined } - { \token_to_str:N #1 } - } + \box_new:N #1 + \cs_gundefine:c { l_coffin_corners_ \tex_number:D #1 _prop } + \cs_gundefine:c { l_coffin_poles_ \tex_number:D #1 _prop } + \prop_new:c { l_coffin_corners_ \tex_number:D #1 _prop } + \prop_new:c { l_coffin_poles_ \tex_number:D #1 _prop } + \prop_gset_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } + \c_coffin_corners_prop + \prop_gset_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } + \c_coffin_poles_prop } +\cs_generate_variant:Nn \coffin_new:N { c } % \end{macrocode} %\end{macro} % -%\begin{macro}{\hcoffin_set:Nn} +%\begin{macro}{ +% \hcoffin_set:Nn , +% \hcoffin_set:cn , +%} % Horizontal coffins are relatively easy: set the appropriate box, % reset the structures then update the handle positions. % \begin{macrocode} \cs_new_protected:Npn \hcoffin_set:Nn #1#2 { - \hbox_set:Nn #1 - { - \group_begin: - \set@color - #2 - \group_end: + \coffin_if_exist_execute:Nn #1 + { + \hbox_set:Nn #1 + { + \group_begin: + \set@color + #2 + \group_end: + } + \coffin_reset_structure:N #1 + \coffin_update_poles:N #1 + \coffin_update_corners:N #1 } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 } +\cs_generate_variant:Nn \hcoffin_set:Nn { c } % \end{macrocode} %\end{macro} % -%\begin{macro}{\vcoffin_set:Nnn} +%\begin{macro}{ +% \vcoffin_set:Nnn , +% \vcoffin_set:cnn , +%} % Setting vertical coffins is more complex. First, the material is % typeset with a given width. The default handles and poles are set as % for a horizontal coffin, before finding the top baseline using a % temporary box. % \begin{macrocode} \cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3 { - \vbox_set:Nn #1 + \coffin_if_exist_execute:Nn #1 { - \dim_set:Nn \tex_hsize:D {#2} - \group_begin: - \set@color - #3 - \group_end: + \vbox_set:Nn #1 + { + \dim_set:Nn \tex_hsize:D {#2} + \group_begin: + \set@color + #3 + \group_end: + } + \coffin_reset_structure:N #1 + \coffin_update_poles:N #1 + \coffin_update_corners:N #1 + \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } + \dim_set:Nn \l_coffin_tmp_dim + { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } + \coffin_set_pole:Nnx #1 { T } + { + { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } + } } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 - \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } - \dim_set:Nn \l_coffin_tmp_dim - { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } - \coffin_set_pole:Nnx #1 { T } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } } } +\cs_generate_variant:Nn \vcoffin_set:Nnn { c } % \end{macrocode} %\end{macro} % -%\begin{macro}{\coffin_set_eq:NN} +%\begin{macro}{ +% \coffin_set_eq:NN , +% \coffin_set_eq:Nc , +% \coffin_set_eq:cN , +% \coffin_set_eq:cc , +%} % Setting two coffins equal is just a wrapper around other functions. % \begin{macrocode} \cs_new_protected_nopar:Npn \coffin_set_eq:NN #1#2 { - \box_set_eq:NN #1 #2 - \coffin_set_eq_structure:NN #1 #2 + \coffin_if_exist_execute:Nn #1 + { + \box_set_eq:NN #1 #2 + \coffin_set_eq_structure:NN #1 #2 + } } +\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc } % \end{macrocode} %\end{macro} % @@ -671,42 +750,51 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\coffin_set_horizontal_pole:Nnn} -%\begin{macro}{\coffin_set_vertical_pole:Nnn} -%\begin{macro}{\coffin_set_pole:Nnn} -%\begin{macro}{\coffin_set_pole:Nnx} +%\begin{macro}{ +% \coffin_set_horizontal_pole:Nnn , +% \coffin_set_horizontal_pole:cnn , +% \coffin_set_vertical_pole:Nnn , +% \coffin_set_vertical_pole:cnn , +% \coffin_set_pole:Nnn , +% \coffin_set_pole:Nnx , +%} % Setting the pole of a coffin at the user/designer level requires a % bit more care. The idea here is to provide a reasonable interface to % the system, then to do the setting with full expansion. The % three-argument version is used internally to do a direct setting. % \begin{macrocode} \cs_new_protected_nopar:Npn \coffin_set_horizontal_pole:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} + \coffin_if_exist_execute:Nn #1 { - { 0 pt } { \tex_the:D \etex_dimexpr:D #3 \scan_stop: } - { 1000 pt } { 0 pt } + \coffin_set_user_dimensions:N #1 + \coffin_set_pole:Nnx #1 {#2} + { + { 0 pt } { \dim_eval:n {#3} } + { 1000 pt } { 0 pt } + } + \coffin_end_user_dimensions: } - \coffin_end_user_dimensions: } \cs_new_protected_nopar:Npn \coffin_set_vertical_pole:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} - { - { \tex_the:D \etex_dimexpr:D #3 \scan_stop: } { 0 pt } - { 0 pt } { 1000 pt } + \coffin_if_exist_execute:Nn #1 + { + \coffin_set_user_dimensions:N #1 + \coffin_set_pole:Nnx #1 {#2} + { + { \dim_eval:n {#3} } { 0 pt } + { 0 pt } { 1000 pt } + } + \coffin_end_user_dimensions: } - \coffin_end_user_dimensions: } \cs_new_protected_nopar:Npn \coffin_set_pole:Nnn #1#2#3 { \prop_put:cnn { l_coffin_poles_ \tex_number:D #1 _prop } {#2} {#3} } +\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c } +\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c } \cs_generate_variant:Nn \coffin_set_pole:Nnn { Nnx } % \end{macrocode} %\end{macro} -%\end{macro} -%\end{macro} -%\end{macro} % %\begin{macro}{\coffin_update_corners:N} % Updating the corners of a coffin is straight-forward as at this stage @@ -955,7 +1043,12 @@ % %\subsection{Aligning and typesetting of coffins} % -%\begin{macro}{\coffin_join:NnnNnnnn} +%\begin{macro}{ +% \coffin_join:NnnNnnnn , +% \coffin_join:cnnNnnnn , +% \coffin_join:Nnncnnnn , +% \coffin_join:cnncnnnn , +%} % This command joins two coffins, using a horizontal and vertical pole % from each coffin and making an offset between the two. The result % is stored as the as a third coffin, which will have all of its handles @@ -1016,11 +1109,17 @@ \coffin_update_vertical_poles:NNN #1 #4 \l_coffin_aligned_coffin \coffin_set_eq:NN #1 \l_coffin_aligned_coffin } +\cs_generate_variant:Nn \coffin_join:NnnNnnnn { c , Nnnc , cnnc } % \end{macrocode} %\end{macro} % -%\begin{macro}{\coffin_attach:NnnNnnnn} -%\begin{macro}{\coffin_attach_mark:NnnNnnnn} +%\begin{macro}{ +% \coffin_attach:NnnNnnnn , +% \coffin_attach:cnnNnnnn , +% \coffin_attach:Nnncnnnn , +% \coffin_attach:cnncnnnn , +% \coffin_attach_mark:NnnNnnnn , +%} % A more simple version of the above, as it simply uses the size of the % first coffin for the new one. This means that the work here is rather % simplified compared to the above code. The function used when marking @@ -1053,9 +1152,9 @@ \box_set_wd:Nn \l_coffin_aligned_coffin { \box_wd:N #1 } \box_set_eq:NN #1 \l_coffin_aligned_coffin } +\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { c , Nnnc , cnnc } % \end{macrocode} %\end{macro} -%\end{macro} % %\begin{macro}{\coffin_align:NnnNnnnnN} % The internal function aligns the two coffins into a third one, but @@ -1139,8 +1238,8 @@ { l_coffin_corners_ \tex_number:D \l_coffin_aligned_coffin _prop } { #1 - #2 } { - { \tex_the:D \etex_dimexpr:D #3 + #5 \scan_stop: } - { \tex_the:D \etex_dimexpr:D #4 + #6 \scan_stop: } + { \dim_eval:n { #3 + #5 } } + { \dim_eval:n { #4 + #6 } } } } % \end{macrocode} @@ -1194,8 +1293,10 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\coffin_typeset:Nnnnn} -%\begin{macro}{\coffin_typeset_overlay:Nnnnn} +%\begin{macro}{ +% \coffin_typeset:Nnnnn , +% \coffin_typeset:cnnnn , +%} % Typesetting a coffin means aligning it with the current position, % which is done using a coffin with no content at all. This is done % using the same approach as \cs{coffin_align:NnnNnnnnN} but without the @@ -1219,18 +1320,9 @@ \hbox_unpack:N \c_empty_box \box_use:N \l_coffin_aligned_coffin } -\cs_new_protected_nopar:Npn \coffin_typeset_overlay:Nnnnn #1#2#3#4#5 { - \coffin_align:NnnNnnnnN \c_empty_coffin { H } { l } - #1 {#2} {#3} {#4} {#5} \l_coffin_aligned_coffin - \box_set_ht:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \box_set_dp:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \box_set_wd:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \hbox_unpack:N \c_empty_box - \box_use:N \l_coffin_aligned_coffin -} +\cs_generate_variant:Nn \coffin_typeset:Nnnnn { c } % \end{macrocode} %\end{macro} -%\end{macro} % %\subsection{Rotating coffins} % @@ -1266,7 +1358,10 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\coffin_rotate:Nn} +%\begin{macro}{ +% \coffin_rotate:Nn , +% \coffin_rotate:cn , +%} % Rotating a coffin requires several steps which can be conveniently % run together. The first step is to convert the angle given in degrees % to one in radians. This is then used to set \cs{l_coffin_sin_fp} and @@ -1337,6 +1432,7 @@ \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } { \coffin_shift_pole:Nnnnnn #1 {##1} ##2 } } +\cs_generate_variant:Nn \coffin_rotate:Nn { c } % \end{macrocode} %\end{macro} % @@ -1479,27 +1575,15 @@ \cs_new_protected_nopar:Npn \coffin_shift_corner:Nnnn #1#2#3#4 { \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _ prop } {#2} { - { - \tex_the:D \etex_dimexpr:D #3 - \l_coffin_left_corner_dim - \scan_stop: - } - { - \tex_the:D \etex_dimexpr:D #4 - \l_coffin_bottom_corner_dim - \scan_stop: - } + { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } + { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } } } \cs_new_protected_nopar:Npn \coffin_shift_pole:Nnnnnn #1#2#3#4#5#6 { \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _ prop } {#2} { - { - \tex_the:D \etex_dimexpr:D #3 - \l_coffin_left_corner_dim - \scan_stop: - } - { - \tex_the:D \etex_dimexpr:D #4 - \l_coffin_bottom_corner_dim - \scan_stop: - } + { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } + { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } {#5} {#6} } } @@ -1529,7 +1613,10 @@ %\end{macro} %\end{macro} % -%\begin{macro}{\coffin_resize:Nnn} +%\begin{macro}{ +% \coffin_resize:Nnn , +% \coffin_resize:cnn , +%} % Resizing a coffin begins by setting up the user-friendly names for % the dimensions of the coffin box. The new sizes are then turned into % scale factor. This is the same operation as takes place for the @@ -1547,6 +1634,7 @@ \hbox_set:Nn #1 { \resizebox * {#2} {#3} { \box_use:N #1 } } \coffin_resize_common:Nnn #1 {#2} {#3} } +\cs_generate_variant:Nn \coffin_resize:Nnn { c } % \end{macrocode} %\end{macro} % @@ -1575,7 +1663,10 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\coffin_scale:Nnn} +%\begin{macro}{ +% \coffin_scale:Nnn , +% \coffin_scale:cnn , +%} % For scaling, the opposite calculation is done to find the new % dimensions for the coffin. Only the total height is needed, as this % is the shift required for corners and poles. The scaling is done @@ -1596,6 +1687,7 @@ \coffin_resize_common:Nnn #1 { \l_coffin_scaled_width_dim } { \l_coffin_scaled_total_height_dim } } +\cs_generate_variant:Nn \coffin_scale:Nnn { c } % \end{macrocode} %\end{macro} % @@ -1772,8 +1864,11 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\coffin_mark_handle:Nnnn} -%\begin{macro}{\coffin_mark_handle_aux:nnnnNnn} +%\begin{macro}{ +% \coffin_mark_handle:Nnnn , +% \coffin_mark_handle:cnnn , +%} +%\begin{macro}[aux]{\coffin_mark_handle_aux:nnnnNnn} % Marking a single handle is relatively easy. The standard attachment % function is used, meaning that there are two calculations for the % location. However, this is likely to be okay given the load expected. @@ -1824,11 +1919,15 @@ { #3 \l_coffin_display_offset_dim } { #4 \l_coffin_display_offset_dim } } +\cs_generate_variant:Nn \coffin_mark_handle:Nnnn { c } % \end{macrocode} %\end{macro} %\end{macro} % -%\begin{macro}{\coffin_display_handles:Nn} +%\begin{macro}{ +% \coffin_display_handles:Nn , +% \coffin_display_handles:cn , +%} %\begin{macro}[aux]{\coffin_display_handles_aux:nnnnnn} %\begin{macro}[aux]{\coffin_display_handles_aux:nnnn} %\begin{macro}[aux]{\coffin_display_attach:Nnnnn} @@ -1918,6 +2017,7 @@ { #3 \l_coffin_display_offset_dim } { #4 \l_coffin_display_offset_dim } } +\cs_generate_variant:Nn \coffin_display_handles:Nn { c } % \end{macrocode} % This is a dedicated version of \cs{coffin_attach:NnnNnnnn} with % a hard-wired first coffin. As the intersection is already known @@ -1960,22 +2060,17 @@ % structure then the code complains. % \begin{macrocode} \cs_new_protected_nopar:Npn \coffin_show_structure:N #1 { - \iow_term:x - { - \iow_newline: - Size~of~coffin~\token_to_str:N #1 : \iow_newline: - > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: - > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: - > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: - } \toks_clear:N \l_coffin_show_toks - \cs_if_free:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { - \iow_term:x { ---~No~poles~found~--- } - \toks_put_right:Nn \l_coffin_show_toks - { Is~this~really~a~coffin? } - } + \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } { + \iow_term:x + { + \iow_newline: + Size~of~coffin~\token_to_str:N #1 : \iow_newline: + > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: + > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: + > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: + } \iow_term:x { Poles~of~coffin~\token_to_str:N #1 : } \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } { @@ -1988,6 +2083,11 @@ { ~ \exp_not:n {##1} \c_space_tl => ~ \exp_not:n {##2} } } } + { + \iow_term:x { ---~No~poles~found~--- } + \toks_put_right:Nn \l_coffin_show_toks + { Is~this~really~a~coffin? } + } \toks_show:N \l_coffin_show_toks } \cs_generate_variant:Nn \coffin_show_structure:N { c } diff --git a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx index e5e89912c3f..d59da40913b 100644 --- a/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx @@ -155,7 +155,7 @@ % name of the \meta{coffin} is not globally-unique. %\end{function} % -%\begin{function}{ \SetHorizontalCoffin } +%\begin{function}{\SetHorizontalCoffin} % \begin{syntax} % \cs{SetHorizontalCoffin} \meta{coffin} \Arg{material} % \end{syntax} @@ -164,7 +164,7 @@ % then set up based on the size of the typeset material. %\end{function} % -%\begin{function}{ \SetVerticalCoffin } +%\begin{function}{\SetVerticalCoffin} % \begin{syntax} % \cs{SetVerticalCoffin} \meta{coffin} \Arg{width} \Arg{material} % \end{syntax} @@ -206,7 +206,7 @@ % of the coffin. %\end{itemize} % -%\begin{function}{ \SetHorizontalPole } +%\begin{function}{\SetHorizontalPole} % \begin{syntax} % \cs{SetHorizontalPole} \meta{coffin} \Arg{pole} \Arg{offset} % \end{syntax} @@ -229,7 +229,7 @@ % horizontal baseline of the material in the coffin. %\end{function} % -%\begin{function}{ \SetVerticalPole } +%\begin{function}{\SetVerticalPole} % \begin{syntax} % \cs{SetVerticalPole} \meta{coffin} \Arg{pole} \Arg{offset} % \end{syntax} @@ -249,7 +249,7 @@ % of their \emph{horizontal} location in the coffin. %\end{function} % -%\begin{function}{ \TotalHeight } +%\begin{function}{\TotalHeight} % \begin{syntax} % \cs{TotalHeight} % \end{syntax} @@ -258,7 +258,7 @@ % the base to the top of the bounding box of the relevant coffin. %\end{function} % -%\begin{function}{ \Height } +%\begin{function}{\Height} % \begin{syntax} % \cs{Height} % \end{syntax} @@ -267,7 +267,7 @@ % baseline to the top of the bounding box of the relevant coffin. %\end{function} % -%\begin{function}{ \Depth } +%\begin{function}{\Depth} % \begin{syntax} % \cs{Depth} % \end{syntax} @@ -276,7 +276,7 @@ % baseline to the bottom of the bounding box of the relevant coffin. %\end{function} % -%\begin{function}{ \Width } +%\begin{function}{\Width} % \begin{syntax} % \cs{Width} % \end{syntax} @@ -288,7 +288,7 @@ % %\section{Rotating coffins} % -%\begin{function}{ \RotateCoffin } +%\begin{function}{\RotateCoffin} % \begin{syntax} % \cs{RotateCoffin} \meta{coffin} \Arg{angle} % \end{syntax} @@ -337,7 +337,7 @@ % the \meta{coffin}. %\end{function} % -%\begin{function}{ \ScaleCoffin } +%\begin{function}{\ScaleCoffin} % \begin{syntax} % \cs{ScaleCoffin} \meta{coffin} \Arg{x-scale} \Arg{y-scale} % \end{syntax} @@ -380,7 +380,7 @@ % `parent', and is updated by the alignment. The second % `child' coffin is not altered by the alignment process. % -%\begin{function}{ \JoinCoffins } +%\begin{function}{\JoinCoffins} % \begin{syntax} % \cs{JoinCoffins} * % ~~\meta{coffin1} [ \meta{coffin1-pole1} , \meta{coffin1-pole2} ] @@ -657,6 +657,48 @@ {\filename}{\filedate}{\fileversion}{\filedescription} \RequirePackage{l3coffins,xparse} % \end{macrocode} +% +% +%\begin{macro}{ +% \l_coffin_A_hpole_tl , +% \l_coffin_A_vpole_tl , +% \l_coffin_B_hpole_tl , +% \l_coffin_B_vpole_tl , +% \l_coffin_bound_box_grow_bool , +% \l_coffin_hoffset_dim , +% \l_coffin_voffset_dim , +%} +% Key--value definitions for the alignment system. With the exception +% of \texttt{grow-bounding-box}, all of these have to be given with a +% value. +% \begin{macrocode} +\keys_define:nn { coffin } { + coffin1-hpole .tl_set:N = \l_coffin_A_hpole_tl , + coffin1-hpole .value_required: , + coffin1-vpole .tl_set:N = \l_coffin_A_vpole_tl , + coffin1-vpole .value_required: , + coffin2-hpole .tl_set:N = \l_coffin_B_hpole_tl , + coffin2-hpole .value_required: , + coffin2-vpole .tl_set:N = \l_coffin_B_vpole_tl , + coffin2-vpole .value_required: , + grow-bounding-box .bool_set:N = \l_coffin_bound_box_grow_bool , + grow-bounding-box .default:n = true , + hoffset .dim_set:N = \l_coffin_hoffset_dim , + hoffset .value_required: , + voffset .dim_set:N = \l_coffin_voffset_dim , + voffset .value_required: , +} +\keys_set:nn { coffin } { + coffin1-hpole = H , + coffin1-vpole = l , + coffin2-hpole = H , + coffin2-vpole = l , + grow-bounding-box = true , + hoffset = 0 pt , + voffset = 0 pt , +} +% \end{macrocode} +%\end{macro} % % A lot of this is more-or-less just passing data straight through. % @@ -707,6 +749,7 @@ % \begin{macrocode} \NewDocumentCommand \JoinCoffins { + o s m > { \SplitArgument { 1 } { , } } O { H , l } @@ -715,9 +758,32 @@ > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt } } { - \IfBooleanTF #1 - { \coffin_attach:NnnNnnnn #2 #3 #4 #5 #6 } - { \coffin_join:NnnNnnnn #2 #3 #4 #5 #6 } + \IfNoValueTF {#1} + { + \IfBooleanTF #2 + { \coffin_attach:NnnNnnnn #3 #4 #5 #6 #7 } + { \coffin_join:NnnNnnnn #3 #4 #5 #6 #7 } + } + { + \group_begin: + \keys_set:nn { coffin } {#1} + \tl_set:Nx \l_coffin_tmp_tl + { + \group_end: + \bool_if:NTF \l_coffin_bound_box_grow_bool + { \coffin_join:NnnNnnnn } + { \coffin_attach:NnnNnnnn } + \exp_not:N #3 + { \exp_not:o { \l_coffin_A_hpole_tl } } + { \exp_not:o { \l_coffin_A_vpole_tl } } + \exp_not:N #5 + { \exp_not:o { \l_coffin_B_hpole_tl } } + { \exp_not:o { \l_coffin_B_vpole_tl } } + { \dim_use:N \l_coffin_hoffset_dim } + { \dim_use:N \l_coffin_voffset_dim } + } + \l_coffin_tmp_tl + } } % \end{macrocode} %\end{macro} diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty index a6c0132ec16..bdb507e62ff 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty @@ -57,7 +57,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xparse.dtx 2136 2011-01-23 12:15:49Z joseph $ +\GetIdInfo$Id: xparse.dtx 2219 2011-04-08 21:07:45Z joseph $ {Generic document command parser} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -240,6 +240,9 @@ \xparse_declare_cmd_aux:Nnn #1 {#2} } \cs_new:Npn \xparse_declare_cmd_aux:Nnn #1#2#3 { + \cs_if_exist:cF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } + { \tl_new:c { l_xparse_ \token_to_str:N #1 _arg_spec_tl } } + \tl_set:cn { l_xparse_ \token_to_str:N #1 _arg_spec_tl } {#2} \xparse_count_mandatory:n {#2} \xparse_prepare_signature:n {#2} \bool_if:NTF \l_xparse_m_only_bool { @@ -254,11 +257,16 @@ #1 \cs_set_protected_nopar:Npn \l_xparse_total_args_int {#2} } \cs_new:Npn \xparse_declare_cmd_mixed:Nn #1#2 { + \group_begin: + \tex_escapechar:D 92 \scan_stop: + \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1 } + \exp_args:NNNo \group_end: + \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } \cs_set_protected_nopar:Npx #1 { \exp_not:n { \int_zero:N \l_xparse_processor_int \tl_set:Nn \l_xparse_args_tl - } { \exp_not:c { \token_to_str:N #1 } } + } { \exp_not:c { \l_xparse_function_tl } } \exp_not:V \l_xparse_signature_tl \exp_not:N \l_xparse_args_tl } @@ -841,7 +849,11 @@ \msg_kernel_info:nnxx { xparse } { define-command } { \token_to_str:N #1 } { \exp_not:n {#2} } } - \tl_set:Nn \l_xparse_function_tl {#1} + \group_begin: + \tex_escapechar:D 92 \scan_stop: + \tl_set:Nx \l_xparse_function_tl { \token_to_str:N #1} + \exp_args:NNNo \group_end: + \tl_set:Nn \l_xparse_function_tl { \l_xparse_function_tl } \xparse_exp_prepare_function:n {#2} \int_compare:nTF { \l_xparse_total_args_int = \l_xparse_m_args_int @@ -944,42 +956,50 @@ } } \cs_new_eq:NN \xparse_exp_set:cpx \cs_set_nopar:cpx -\cs_new_protected:Npn \parse_get_arg_spec:N #1 { - \cs_if_exist:cTF { l_parse_ \token_to_str:N #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_get_arg_spec:N #1 { + \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } { \tl_set_eq:Nc \ArgumentSpecification - { l_parse_ \token_to_str:N #1 _arg_spec_tl } + { l_xparse_ \token_to_str:N #1 _arg_spec_tl } } { - \msg_kernel_error:nx { unknown-document-command } + \msg_kernel_error:nnx { xparse } { unknown-document-command } { \token_to_str:N #1 } } } -\cs_new_protected:Npn \parse_get_arg_spec:n #1 { - \cs_if_exist:cTF { l_parse_ #1 _arg_spec_tl } - { \tl_set_eq:Nc \ArgumentSpecification { l_parse_ #1 _arg_spec_tl } } - { \msg_kernel_error:nx { unknown-document-environment } {#1} } +\cs_new_protected:Npn \xparse_get_arg_spec:n #1 { + \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } + { + \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } + } + { + \msg_kernel_error:nnx { xparse } + { unknown-document-environment } {#1} + } } \tl_new:N \ArgumentSpecification -\cs_new_protected:Npn \parse_show_arg_spec:N #1 { - \cs_if_exist:cTF { l_parse_ \token_to_str:N #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_show_arg_spec:N #1 { + \cs_if_exist:cTF { l_xparse_ \token_to_str:N #1 _arg_spec_tl } { \tl_set_eq:Nc \ArgumentSpecification - { l_parse_ \token_to_str:N #1 _arg_spec_tl } + { l_xparse_ \token_to_str:N #1 _arg_spec_tl } \tl_show:N \ArgumentSpecification } { - \msg_kernel_error:nx { unknown-document-command } + \msg_kernel_error:nnx { xparse } { unknown-document-command } { \token_to_str:N #1 } } } -\cs_new_protected:Npn \parse_show_arg_spec:n #1 { - \cs_if_exist:cTF { l_parse_ #1 _arg_spec_tl } +\cs_new_protected:Npn \xparse_show_arg_spec:n #1 { + \cs_if_exist:cTF { l_xparse_ #1 _arg_spec_tl } { - \tl_set_eq:Nc \ArgumentSpecification { l_parse_ #1 _arg_spec_tl } + \tl_set_eq:Nc \ArgumentSpecification { l_xparse_ #1 _arg_spec_tl } \tl_show:N \ArgumentSpecification } - { \msg_kernel_error:nx { unknown-document-environment } {#1} } + { + \msg_kernel_error:nnx { xparse } + { unknown-document-environment } {#1} + } } \msg_kernel_new:nnnn { xparse } { command-already-defined } { Command~'#1'~already~defined! } @@ -1047,7 +1067,7 @@ Argument~specification~'#1'~contains~a~processor~function:\\ this~is~only~supported~for~standard~robust~functions. } -\msg_kernel_set:nnnn { xparse } { split-excess-tokens } +\msg_kernel_new:nnnn { xparse } { split-excess-tokens } { Too~many~'#1'~tokens~when~trying~to~split~argument. } { LaTeX~was~asked~to~split~the~input~'#3'\\ @@ -1060,6 +1080,18 @@ The~letter~#1'~does~not~specify~a~known~argument~type.\\ I'm~assuming~you~want~a~standard~mandatory~argument~(type~'m'). } +\msg_kernel_new:nnnn { xparse } { unknown-document-command } + { Unknown~document~command~'#1'. } + { + You~have~asked~for~the~argument~specification~for~a~command~'#1',~ + but~this~is~not~a~document~command. + } +\msg_kernel_new:nnnn { xparse } { unknown-document-environment } + { Unknown~document~environment~'#1'. } + { + You~have~asked~for~the~argument~specification~for~a~command~'#1',~ + but~this~is~not~a~document~environment. + } \msg_kernel_new:nnn { xparse } { define-command } { Defining~document~command~#1\\ @@ -1157,10 +1189,10 @@ \cs_new_eq:NN \ReverseBoolean \_xparse_bool_reverse:N \cs_new_eq:NN \SplitArgument \_xparse_split_argument:nnn \cs_new_eq:NN \SplitList \_xparse_split_list:nn -\cs_new_eq:NN \GetDocumentCommandArgSpec \parse_get_arg_spec:N -\cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \parse_get_arg_spec:n -\cs_new_eq:NN \ShowDocumentCommandArgSpec \parse_show_arg_spec:N -\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \parse_show_arg_spec:n +\cs_new_eq:NN \GetDocumentCommandArgSpec \xparse_get_arg_spec:N +\cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \xparse_get_arg_spec:n +\cs_new_eq:NN \ShowDocumentCommandArgSpec \xparse_show_arg_spec:N +\cs_new_eq:NN \ShowDocumentEnvironmentArgSpec \xparse_show_arg_spec:n \endinput %% %% End of file `xparse.sty'. diff --git a/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty b/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty index cf83a54f0c5..9c3636292f5 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xcoffins/l3coffins.sty @@ -54,7 +54,7 @@ %% \RequirePackage{expl3} \RequirePackage{graphicx,xcolor,trace} -\GetIdInfo$Id: l3coffins.dtx 2109 2010-12-23 19:39:41Z joseph $ +\GetIdInfo$Id: l3coffins.dtx 2209 2011-03-23 08:33:19Z joseph $ {Coffins} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -108,60 +108,89 @@ \cs_new_nopar:Npn \coffin_saved_Height: { } \cs_new_nopar:Npn \coffin_saved_TotalHeight: { } \cs_new_nopar:Npn \coffin_saved_Width: { } -\cs_new_protected_nopar:Npn \coffin_clear:N #1 { - \box_clear:N #1 - \coffin_reset_structure:N #1 -} -\cs_new_protected_nopar:Npn \coffin_new:N #1 { - \cs_if_free:NTF #1 +\cs_new_protected:Npn \coffin_if_exist_execute:Nn #1#2 { + \cs_if_exist:NTF #1 { - \box_new:N #1 - \prop_new:c { l_coffin_corners_ \tex_number:D #1 _prop } - \prop_new:c { l_coffin_poles_ \tex_number:D #1 _prop } - \prop_gset_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } - \c_coffin_corners_prop - \prop_gset_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } - \c_coffin_poles_prop + \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } + { #2 } + { + \msg_kernel_error:nnx { coffin } { unknown-coffin } + { \token_to_str:N #1 } + } } { - \msg_kernel_error:nnx { coffin }{ variable-already-defined } + \msg_kernel_error:nnx { coffin } { unknown-coffin } { \token_to_str:N #1 } } } +\cs_new_protected_nopar:Npn \coffin_clear:N #1 { + \coffin_if_exist_execute:Nn #1 + { + \box_clear:N #1 + \coffin_reset_structure:N #1 + } +} +\cs_generate_variant:Nn \coffin_clear:N { c } +\cs_new_protected_nopar:Npn \coffin_new:N #1 { + \box_new:N #1 + \cs_gundefine:c { l_coffin_corners_ \tex_number:D #1 _prop } + \cs_gundefine:c { l_coffin_poles_ \tex_number:D #1 _prop } + \prop_new:c { l_coffin_corners_ \tex_number:D #1 _prop } + \prop_new:c { l_coffin_poles_ \tex_number:D #1 _prop } + \prop_gset_eq:cN { l_coffin_corners_ \tex_number:D #1 _prop } + \c_coffin_corners_prop + \prop_gset_eq:cN { l_coffin_poles_ \tex_number:D #1 _prop } + \c_coffin_poles_prop +} +\cs_generate_variant:Nn \coffin_new:N { c } \cs_new_protected:Npn \hcoffin_set:Nn #1#2 { - \hbox_set:Nn #1 + \coffin_if_exist_execute:Nn #1 { - \group_begin: - \set@color - #2 - \group_end: + \hbox_set:Nn #1 + { + \group_begin: + \set@color + #2 + \group_end: + } + \coffin_reset_structure:N #1 + \coffin_update_poles:N #1 + \coffin_update_corners:N #1 } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 } +\cs_generate_variant:Nn \hcoffin_set:Nn { c } \cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3 { - \vbox_set:Nn #1 - { - \dim_set:Nn \tex_hsize:D {#2} - \group_begin: - \set@color - #3 - \group_end: - } - \coffin_reset_structure:N #1 - \coffin_update_poles:N #1 - \coffin_update_corners:N #1 - \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } - \dim_set:Nn \l_coffin_tmp_dim - { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } - \coffin_set_pole:Nnx #1 { T } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } } + \coffin_if_exist_execute:Nn #1 + { + \vbox_set:Nn #1 + { + \dim_set:Nn \tex_hsize:D {#2} + \group_begin: + \set@color + #3 + \group_end: + } + \coffin_reset_structure:N #1 + \coffin_update_poles:N #1 + \coffin_update_corners:N #1 + \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } + \dim_set:Nn \l_coffin_tmp_dim + { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } + \coffin_set_pole:Nnx #1 { T } + { + { 0 pt } { \dim_use:N \l_coffin_tmp_dim } { 1000 pt } { 0 pt } + } + } } +\cs_generate_variant:Nn \vcoffin_set:Nnn { c } \cs_new_protected_nopar:Npn \coffin_set_eq:NN #1#2 { - \box_set_eq:NN #1 #2 - \coffin_set_eq_structure:NN #1 #2 + \coffin_if_exist_execute:Nn #1 + { + \box_set_eq:NN #1 #2 + \coffin_set_eq_structure:NN #1 #2 + } } +\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc } \coffin_new:N \c_empty_coffin \hbox_set:Nn \c_empty_coffin { } \coffin_new:N \l_coffin_aligned_coffin @@ -208,26 +237,34 @@ \cs_set_eq:NN \Width \coffin_saved_Width: } \cs_new_protected_nopar:Npn \coffin_set_horizontal_pole:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} + \coffin_if_exist_execute:Nn #1 { - { 0 pt } { \tex_the:D \etex_dimexpr:D #3 \scan_stop: } - { 1000 pt } { 0 pt } + \coffin_set_user_dimensions:N #1 + \coffin_set_pole:Nnx #1 {#2} + { + { 0 pt } { \dim_eval:n {#3} } + { 1000 pt } { 0 pt } + } + \coffin_end_user_dimensions: } - \coffin_end_user_dimensions: } \cs_new_protected_nopar:Npn \coffin_set_vertical_pole:Nnn #1#2#3 { - \coffin_set_user_dimensions:N #1 - \coffin_set_pole:Nnx #1 {#2} + \coffin_if_exist_execute:Nn #1 { - { \tex_the:D \etex_dimexpr:D #3 \scan_stop: } { 0 pt } - { 0 pt } { 1000 pt } + \coffin_set_user_dimensions:N #1 + \coffin_set_pole:Nnx #1 {#2} + { + { \dim_eval:n {#3} } { 0 pt } + { 0 pt } { 1000 pt } + } + \coffin_end_user_dimensions: } - \coffin_end_user_dimensions: } \cs_new_protected_nopar:Npn \coffin_set_pole:Nnn #1#2#3 { \prop_put:cnn { l_coffin_poles_ \tex_number:D #1 _prop } {#2} {#3} } +\cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c } +\cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c } \cs_generate_variant:Nn \coffin_set_pole:Nnn { Nnx } \cs_new_protected_nopar:Npn \coffin_update_corners:N #1 { \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _prop } { tl } @@ -406,6 +443,7 @@ \coffin_update_vertical_poles:NNN #1 #4 \l_coffin_aligned_coffin \coffin_set_eq:NN #1 \l_coffin_aligned_coffin } +\cs_generate_variant:Nn \coffin_join:NnnNnnnn { c , Nnnc , cnnc } \cs_new_protected_nopar:Npn \coffin_attach:NnnNnnnn #1#2#3#4#5#6#7#8 { \coffin_align:NnnNnnnnN #1 {#2} {#3} #4 {#5} {#6} {#7} {#8} \l_coffin_aligned_coffin @@ -432,6 +470,7 @@ \box_set_wd:Nn \l_coffin_aligned_coffin { \box_wd:N #1 } \box_set_eq:NN #1 \l_coffin_aligned_coffin } +\cs_generate_variant:Nn \coffin_attach:NnnNnnnn { c , Nnnc , cnnc } \cs_new_protected_nopar:Npn \coffin_align:NnnNnnnnN #1#2#3#4#5#6#7#8#9 { \coffin_calculate_intersection:Nnn #4 {#5} {#6} @@ -478,8 +517,8 @@ { l_coffin_corners_ \tex_number:D \l_coffin_aligned_coffin _prop } { #1 - #2 } { - { \tex_the:D \etex_dimexpr:D #3 + #5 \scan_stop: } - { \tex_the:D \etex_dimexpr:D #4 + #6 \scan_stop: } + { \dim_eval:n { #3 + #5 } } + { \dim_eval:n { #4 + #6 } } } } \cs_new_protected_nopar:Npn \coffin_update_vertical_poles:NNN #1#2#3 { @@ -532,15 +571,7 @@ \hbox_unpack:N \c_empty_box \box_use:N \l_coffin_aligned_coffin } -\cs_new_protected_nopar:Npn \coffin_typeset_overlay:Nnnnn #1#2#3#4#5 { - \coffin_align:NnnNnnnnN \c_empty_coffin { H } { l } - #1 {#2} {#3} {#4} {#5} \l_coffin_aligned_coffin - \box_set_ht:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \box_set_dp:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \box_set_wd:Nn \l_coffin_aligned_coffin { \c_zero_dim } - \hbox_unpack:N \c_empty_box - \box_use:N \l_coffin_aligned_coffin -} +\cs_generate_variant:Nn \coffin_typeset:Nnnnn { c } \prop_new:N \l_coffin_bounding_prop \dim_new:N \l_coffin_bounding_shift_dim \dim_new:N \l_coffin_left_corner_dim @@ -580,6 +611,7 @@ \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } { \coffin_shift_pole:Nnnnnn #1 {##1} ##2 } } +\cs_generate_variant:Nn \coffin_rotate:Nn { c } \cs_new_protected_nopar:Npn \coffin_set_bounding:N #1 { \prop_put:Nnx \l_coffin_bounding_prop { tl } { { 0 pt } { \dim_use:N \box_ht:N #1 } } @@ -653,27 +685,15 @@ \cs_new_protected_nopar:Npn \coffin_shift_corner:Nnnn #1#2#3#4 { \prop_put:cnx { l_coffin_corners_ \tex_number:D #1 _ prop } {#2} { - { - \tex_the:D \etex_dimexpr:D #3 - \l_coffin_left_corner_dim - \scan_stop: - } - { - \tex_the:D \etex_dimexpr:D #4 - \l_coffin_bottom_corner_dim - \scan_stop: - } + { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } + { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } } } \cs_new_protected_nopar:Npn \coffin_shift_pole:Nnnnnn #1#2#3#4#5#6 { \prop_put:cnx { l_coffin_poles_ \tex_number:D #1 _ prop } {#2} { - { - \tex_the:D \etex_dimexpr:D #3 - \l_coffin_left_corner_dim - \scan_stop: - } - { - \tex_the:D \etex_dimexpr:D #4 - \l_coffin_bottom_corner_dim - \scan_stop: - } + { \dim_eval:n { #3 - \l_coffin_left_corner_dim } } + { \dim_eval:n { #4 - \l_coffin_bottom_corner_dim } } {#5} {#6} } } @@ -692,6 +712,7 @@ \hbox_set:Nn #1 { \resizebox * {#2} {#3} { \box_use:N #1 } } \coffin_resize_common:Nnn #1 {#2} {#3} } +\cs_generate_variant:Nn \coffin_resize:Nnn { c } \cs_new_protected_nopar:Npn \coffin_resize_common:Nnn #1#2#3 { \prop_map_inline:cn { l_coffin_corners_ \tex_number:D #1 _prop } { \coffin_scale_corner:Nnnn #1 {##1} ##2 } @@ -720,6 +741,7 @@ \coffin_resize_common:Nnn #1 { \l_coffin_scaled_width_dim } { \l_coffin_scaled_total_height_dim } } +\cs_generate_variant:Nn \coffin_scale:Nnn { c } \cs_new_protected_nopar:Npn \coffin_scale_vector:nnNN #1#2#3#4 { \fp_set_from_dim:Nn \l_coffin_tmp_fp {#1} \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_scale_x_fp } @@ -847,6 +869,7 @@ { #3 \l_coffin_display_offset_dim } { #4 \l_coffin_display_offset_dim } } +\cs_generate_variant:Nn \coffin_mark_handle:Nnnn { c } \cs_new_protected_nopar:Npn \coffin_display_handles:Nn #1#2 { \hcoffin_set:Nn \l_coffin_display_pole_coffin { @@ -921,6 +944,7 @@ { #3 \l_coffin_display_offset_dim } { #4 \l_coffin_display_offset_dim } } +\cs_generate_variant:Nn \coffin_display_handles:Nn { c } \cs_new_protected_nopar:Npn \coffin_display_attach:Nnnnn #1#2#3#4#5 { \coffin_calculate_intersection:Nnn #1 {#2} {#3} \dim_set:Nn \l_coffin_x_prime_dim { \l_coffin_x_dim } @@ -945,22 +969,17 @@ \box_set_eq:NN \l_coffin_display_coffin \l_coffin_aligned_coffin } \cs_new_protected_nopar:Npn \coffin_show_structure:N #1 { - \iow_term:x - { - \iow_newline: - Size~of~coffin~\token_to_str:N #1 : \iow_newline: - > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: - > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: - > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: - } \toks_clear:N \l_coffin_show_toks - \cs_if_free:cTF { l_coffin_poles_ \tex_number:D #1 _prop } - { - \iow_term:x { ---~No~poles~found~--- } - \toks_put_right:Nn \l_coffin_show_toks - { Is~this~really~a~coffin? } - } + \cs_if_exist:cTF { l_coffin_poles_ \tex_number:D #1 _prop } { + \iow_term:x + { + \iow_newline: + Size~of~coffin~\token_to_str:N #1 : \iow_newline: + > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: + > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: + > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: + } \iow_term:x { Poles~of~coffin~\token_to_str:N #1 : } \prop_map_inline:cn { l_coffin_poles_ \tex_number:D #1 _prop } { @@ -973,6 +992,11 @@ { ~ \exp_not:n {##1} \c_space_tl => ~ \exp_not:n {##2} } } } + { + \iow_term:x { ---~No~poles~found~--- } + \toks_put_right:Nn \l_coffin_show_toks + { Is~this~really~a~coffin? } + } \toks_show:N \l_coffin_show_toks } \cs_generate_variant:Nn \coffin_show_structure:N { c } diff --git a/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty b/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty index efed9bd8982..f201481052b 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xcoffins/xcoffins.sty @@ -59,6 +59,31 @@ \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} \RequirePackage{l3coffins,xparse} +\keys_define:nn { coffin } { + coffin1-hpole .tl_set:N = \l_coffin_A_hpole_tl , + coffin1-hpole .value_required: , + coffin1-vpole .tl_set:N = \l_coffin_A_vpole_tl , + coffin1-vpole .value_required: , + coffin2-hpole .tl_set:N = \l_coffin_B_hpole_tl , + coffin2-hpole .value_required: , + coffin2-vpole .tl_set:N = \l_coffin_B_vpole_tl , + coffin2-vpole .value_required: , + grow-bounding-box .bool_set:N = \l_coffin_bound_box_grow_bool , + grow-bounding-box .default:n = true , + hoffset .dim_set:N = \l_coffin_hoffset_dim , + hoffset .value_required: , + voffset .dim_set:N = \l_coffin_voffset_dim , + voffset .value_required: , +} +\keys_set:nn { coffin } { + coffin1-hpole = H , + coffin1-vpole = l , + coffin2-hpole = H , + coffin2-vpole = l , + grow-bounding-box = true , + hoffset = 0 pt , + voffset = 0 pt , +} \NewDocumentCommand \NewCoffin { m } { \coffin_new:N #1 } @@ -76,6 +101,7 @@ } \NewDocumentCommand \JoinCoffins { + o s m > { \SplitArgument { 1 } { , } } O { H , l } @@ -84,9 +110,32 @@ > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt } } { - \IfBooleanTF #1 - { \coffin_attach:NnnNnnnn #2 #3 #4 #5 #6 } - { \coffin_join:NnnNnnnn #2 #3 #4 #5 #6 } + \IfNoValueTF {#1} + { + \IfBooleanTF #2 + { \coffin_attach:NnnNnnnn #3 #4 #5 #6 #7 } + { \coffin_join:NnnNnnnn #3 #4 #5 #6 #7 } + } + { + \group_begin: + \keys_set:nn { coffin } {#1} + \tl_set:Nx \l_coffin_tmp_tl + { + \group_end: + \bool_if:NTF \l_coffin_bound_box_grow_bool + { \coffin_join:NnnNnnnn } + { \coffin_attach:NnnNnnnn } + \exp_not:N #3 + { \exp_not:o { \l_coffin_A_hpole_tl } } + { \exp_not:o { \l_coffin_A_vpole_tl } } + \exp_not:N #5 + { \exp_not:o { \l_coffin_B_hpole_tl } } + { \exp_not:o { \l_coffin_B_vpole_tl } } + { \dim_use:N \l_coffin_hoffset_dim } + { \dim_use:N \l_coffin_voffset_dim } + } + \l_coffin_tmp_tl + } } \NewDocumentCommand \TypesetCoffin { diff --git a/Master/texmf-dist/tex/latex/xpackages/xhead/xtextblock.sty b/Master/texmf-dist/tex/latex/xpackages/xhead/xtextblock.sty deleted file mode 100644 index 3f1907a5b5d..00000000000 --- a/Master/texmf-dist/tex/latex/xpackages/xhead/xtextblock.sty +++ /dev/null @@ -1,101 +0,0 @@ -% tmp file during development - -\DeclareObjectType {textblock-1} {1} -\DeclareObjectType {textblock-2} {2} -\DeclareObjectType {textblock-3} {3} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\DeclareTemplateInterface {textblock-1} {std} {1} - { - font : tokenlist = , - parshape : instance {parshape} = plain , - justification : instance {justification} = default , - } - - -\tl_new:N \l_tblock_font_tl - -\cs_new:Npn \tblock_parshape: {} -\cs_new:Npn \tblock_justification: {} - - -\DeclareTemplateCode {textblock-1} {std} {1} - { - font = \l_tblock_font_tl , - parshape = \tblock_parshape: , - justification = \tblock_justification: , - } - { - \AssignTemplateKeys - \group_begin: - \l_tblock_font_tl - \tblock_parshape: - \tblock_justification: - #1 - \@@par - \group_end: -} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\dim_new:N \l_tblock_h_dim -\tl_new:N \l_tblock_font_ii_tl - -\DeclareTemplateInterface {textblock-2} {hangfrom} {2} - { - font-1 : tokenlist = , - font-2 : tokenlist = , - h-sep : length = 1em , - parshape : instance {parshape} = plain , - justification : instance {justification} = default , - } - - -\DeclareTemplateCode {textblock-2} {hangfrom} {2} - { - - font-1 = \l_tblock_font_tl , - font-2 = \l_tblock_font_ii_tl , - h-sep = \l_tblock_h_dim , - parshape = \tblock_parshape: , - justification = \tblock_justification: , - } - { - \AssignTemplateKeys - \group_begin: - \l_tblock_font_tl - - \hbox_set:Nn \l_tmpa_box - { \tl_if_empty:oF {#1} {#1 \hskip \l_tblock_h_dim } } - - \UseInstance{measure}{fullwidth} - { \box_wd:N \l_tmpa_box } - - \l_tblock_font_ii_tl - \tblock_parshape: - \tblock_justification: - - \leavevmode - \box_set_to_last:N \l_tmpb_box - \hskip -\leftskip - \hbox_overlap_left:n{ \box_use:N \l_tmpa_box } - \hskip \leftskip - \box_use:N \l_tmpb_box - #2 - \@@par - \group_end: -} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%555 - - -\DeclareTemplateInterface {textblock-3} {std} {3} - { - } - - - |