diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/xpackages/xcoffins/xcoffins.dtx | 94 |
1 files changed, 80 insertions, 14 deletions
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} |