summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental/xcoffins
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-14 23:28:14 +0000
committerKarl Berry <karl@freefriends.org>2012-08-14 23:28:14 +0000
commitc33dd0f6eb3ee533df663d363845fc7d22578ba6 (patch)
tree537c0448e654b3e0868b94ad0e56ca6a3e9bbab8 /Master/texmf-dist/source/latex/l3experimental/xcoffins
parente15c57294632f6474030420648f16a9bf4efbd99 (diff)
l3* (14aug12)
git-svn-id: svn://tug.org/texlive/trunk@27406 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental/xcoffins')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx88
1 files changed, 55 insertions, 33 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
index 0cee83f61ab..1d2a22efea3 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
@@ -36,7 +36,7 @@
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: xcoffins.dtx 3876 2012-06-30 15:35:39Z joseph $
+\GetIdInfo$Id: xcoffins.dtx 4029 2012-07-29 18:16:03Z bruno $
{L3 Experimental design-level coffins}
%</driver|package>
%<*driver>
@@ -150,16 +150,6 @@
% name of the \meta{coffin} is not globally-unique.
% \end{function}
%
-% \begin{function}{\BoxToCoffin}
-% \begin{syntax}
-% \cs{BoxToCoffin} \meta{box}
-% \end{syntax}
-% Adds coffin structure to the \meta{box}, which should be a \LaTeXe{}
-% \enquote{user} box (e.g.~one created using \cs{newsavebox}). This function
-% allows standard \LaTeXe{} box material to be used in coffin-based
-% alignments.
-% \end{function}
-%
% \begin{function}{\SetHorizontalCoffin}
% \begin{syntax}
% \cs{SetHorizontalCoffin} \meta{coffin} \Arg{material}
@@ -338,10 +328,7 @@
% \cs{ResizeCoffin} \meta{coffin} \Arg{width} \Arg{total-height}
% \end{syntax}
% Resized the \meta{coffin} to \meta{width} and \meta{total-height},
-% both of which should be given as dimension expressions. These may
-% include the terms \cs{TotalHeight}, \cs{Height}, \cs{Depth} and
-% \cs{Width}, which will evaluate to the appropriate dimensions of
-% the \meta{coffin}.
+% both of which should be given as dimension expressions.
% \end{function}
%
% \begin{function}{\ScaleCoffin}
@@ -712,7 +699,6 @@
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
% \end{macrocode}
%
-%
% \begin{variable}
% {
% \l_@@_A_hpole_tl ,
@@ -757,6 +743,35 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{macro}{\@@_design_names:N}
+% \begin{variable}{\Height, \Depth, \Width, \TotalHeight}
+% \begin{variable}[int]
+% {\l_@@_height_dim, \l_@@_depth_dim, \l_@@_width_dim, \l_@@_totalheight_dim}
+% Sets up design-level names for the various coffin dimensions. These are
+% not defined outside of this scope, and are dimensions so that they work
+% correctly inside for example \cs{fp_eval:n}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_design_names:N #1
+ {
+ \dim_set:Nn \l_@@_height_dim { \coffin_ht:N #1 }
+ \dim_set:Nn \l_@@_depth_dim { \coffin_dp:N #1 }
+ \dim_set:Nn \l_@@_width_dim { \coffin_wd:N #1 }
+ \dim_set:Nn \l_@@_totalheight_dim
+ { \l_@@_height_dim + \l_@@_depth_dim }
+ \cs_set_eq:NN \Height \l_@@_height_dim
+ \cs_set_eq:NN \Depth \l_@@_depth_dim
+ \cs_set_eq:NN \Width \l_@@_width_dim
+ \cs_set_eq:NN \TotalHeight \l_@@_totalheight_dim
+ }
+\dim_new:N \l_@@_height_dim
+\dim_new:N \l_@@_depth_dim
+\dim_new:N \l_@@_width_dim
+\dim_new:N \l_@@_totalheight_dim
+% \end{macrocode}
+% \end{variable}
+% \end{variable}
+% \end{macro}
+%
% A lot of this is more-or-less just passing data straight through.
%
% \begin{macro}{\NewCoffin}
@@ -767,19 +782,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\BoxToCoffin}
-% For allowing a user-level \LaTeXe{} box to be used as a coffin.
-% \begin{macrocode}
-\NewDocumentCommand \BoxToCoffin { m }
- {
- \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop }
- \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop }
- \@@_update_corners:N #1
- \@@_update_poles:N #1
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\SetHorizontalCoffin}
% \begin{macro}{\SetVerticalCoffin}
% These are again straight-forward translations.
@@ -794,12 +796,32 @@
%
% \begin{macro}{\SetHorizontalPole}
% \begin{macro}{\SetVerticalPole}
-% Again straight-forward
+% Here, there is a need to set up the design-level names for coffin
+% dimensions. This requires grouping, but the coffin work has to occur
+% outside of the group. Hence there is a bit of expansion trickery.
% \begin{macrocode}
\NewDocumentCommand \SetHorizontalPole { m m m }
- { \coffin_set_horizontal_pole:Nnn #1 {#2} {#3} }
+ {
+ \group_begin:
+ \@@_design_names:N #1
+ \use:x
+ {
+ \group_end:
+ \coffin_set_horizontal_pole:Nnn #1
+ { \exp_not:n {#2} } { \dim_eval:n {#3} }
+ }
+ }
\NewDocumentCommand \SetVerticalPole { m m m }
- { \coffin_set_vertical_pole:Nnn #1 {#2} {#3} }
+ {
+ \group_begin:
+ \@@_design_names:N #1
+ \use:x
+ {
+ \group_end:
+ \coffin_set_vertical_pole:Nnn #1
+ { \exp_not:n {#2} } { \dim_eval:n {#3} }
+ }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -933,4 +955,4 @@
%
% \end{implementation}
%
-% \PrintIndex \ No newline at end of file
+% \PrintIndex