[latex3-commits] [git/LaTeX3-latex3-latex3] master: xbox: Renew not New (8691a9983)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Aug 24 11:19:09 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/8691a9983cc03190fda5fcee998e7d689bab1285
>---------------------------------------------------------------
commit 8691a9983cc03190fda5fcee998e7d689bab1285
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Aug 22 11:21:48 2020 +0100
xbox: Renew not New
Reflects thinking on IniTeX mode.
>---------------------------------------------------------------
8691a9983cc03190fda5fcee998e7d689bab1285
l3trial/xbox/xbox.dtx | 57 +++++++++++++++------------------------------------
1 file changed, 16 insertions(+), 41 deletions(-)
diff --git a/l3trial/xbox/xbox.dtx b/l3trial/xbox/xbox.dtx
index 755522704..901b30fc5 100644
--- a/l3trial/xbox/xbox.dtx
+++ b/l3trial/xbox/xbox.dtx
@@ -771,38 +771,13 @@
% \end{macro}
% \end{macro}
%
-% \subsection{Removing \LaTeXe{} commands}
-%
-% Remove the \LaTeXe{} definitions of various box commands, meaning that
-% \cs{NewDocumentCommand} can then be used.
-%
-% \begin{macrocode}
-\tl_map_inline:nn
- {
- \mbox
- \makebox
- \fbox
- \framebox
- \raisebox
- \newsavebox
- \sbox
- \savebox
- \lrbox \endlrbox
- \usebox
- \rule
- \llap \rlap
- \leftline \centerline \rightline
- }
- { \cs_undefine:N #1 }
-% \end{macrocode}
-%
% \subsection{Directly typesetting material in boxes}
%
% \begin{macro}{\mbox}
% The basic horizontal box command for \LaTeX{}: simply box things up
% as there is nothing complicated to do.
% \begin{macrocode}
-\NewDocumentCommand \mbox { +m }
+\RenewDocumentCommand \mbox { +m }
{
\mode_leave_vertical:
\hbox:n {#1}
@@ -816,7 +791,7 @@
% is present~|#1| is simply dropped entirely. Picture syntax is converted
% into dimensions here before handing off to the internal code.
% \begin{macrocode}
-\NewDocumentCommand \makebox
+\RenewDocumentCommand \makebox
{ o > { \SplitArgument { 1 } { , } } d ( ) O { c } +m }
{
\mode_leave_vertical:
@@ -839,7 +814,7 @@
% \begin{macro}{\fbox}
% Simply frame up material: no need to do anything complex.
% \begin{macrocode}
-\NewDocumentCommand \fbox { +m }
+\RenewDocumentCommand \fbox { +m }
{
\mode_leave_vertical:
\hbox_frame:nnn {#1} { \fboxrule } { \fboxsep }
@@ -854,7 +829,7 @@
% test for \texttt{-NoValue-} here. Thus with no optional arguments this
% command does exactly the same as \cs{fbox}.
% \begin{macrocode}
-\NewDocumentCommand \framebox
+\RenewDocumentCommand \framebox
{ o > { \SplitArgument { 1 } { , } } d ( ) O { c } +m }
{
\mode_leave_vertical:
@@ -877,7 +852,7 @@
% one by one. This avoids needing to have detail of the implementation in
% the user interface.
% \begin{macrocode}
-\NewDocumentCommand \raisebox { m o o +m }
+\RenewDocumentCommand \raisebox { m o o +m }
{
\IfNoValueTF {#2}
{ \xbox_raise:nn {#1} {#4} }
@@ -895,14 +870,14 @@
% \begin{macro}{\newsavebox}
% Allocate a new \enquote{savebox}.
% \begin{macrocode}
-\NewDocumentCommand \newsavebox { m } { \coffin_new:N #1 }
+\RenewDocumentCommand \newsavebox { m } { \coffin_new:N #1 }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\sbox}
% Save |#2| in a coffin: like \cs{mbox}, no messing about.
% \begin{macrocode}
-\NewDocumentCommand \sbox { m +m } { \hcoffin_set:Nn #1 {#2} }
+\RenewDocumentCommand \sbox { m +m } { \hcoffin_set:Nn #1 {#2} }
% \end{macrocode}
% \end{macro}
%
@@ -914,7 +889,7 @@
% setting. Question: should the syntax processing (\cs{IFNoValueTF} test)
% take place inside or outside of the coffin setting stage?
% \begin{macrocode}
-\NewDocumentCommand \savebox
+\RenewDocumentCommand \savebox
{ m o > { \SplitArgument { 1 } { , } } d ( ) O { c } +m }
{
\IfNoValueTF {#3}
@@ -957,7 +932,7 @@
% an \pkg{xparse} argument, but it's very much tied to how \LaTeXe{}
% environment syntax works and so this seems reasonable.
% \begin{macrocode}
-\NewDocumentEnvironment { lrbox } { m }
+\RenewDocumentEnvironment { lrbox } { m }
{
\use:x
{
@@ -987,7 +962,7 @@
% done using the box syntax for speed (should this be done using
% \cs{coffin_typeset:Nnnnn}?).
% \begin{macrocode}
-\NewDocumentCommand \usebox { m }
+\RenewDocumentCommand \usebox { m }
{
\mode_leave_vertical:
\box_use:N #1
@@ -1000,7 +975,7 @@
% \begin{macro}{\rule}
% Simple conversion.
% \begin{macrocode}
-\NewDocumentCommand \rule { O { 0 pt } m m }
+\RenewDocumentCommand \rule { O { 0 pt } m m }
{
\mode_leave_vertical:
\rule:nnn { #1 + ( #3 ) } { 0 pt - ( #1 ) } {#2}
@@ -1018,12 +993,12 @@
% without taking up space. Unlike the plain \TeX{} versions, these correctly
% leave vertical mode.
% \begin{macrocode}
-\NewDocumentCommand \llap { m }
+\RenewDocumentCommand \llap { m }
{
\mode_leave_vertical:
\hbox_overlap_left:n {#1}
}
-\NewDocumentCommand \rlap { m }
+\RenewDocumentCommand \rlap { m }
{
\mode_leave_vertical:
\hbox_overlap_right:n {#1}
@@ -1035,9 +1010,9 @@
% These macros place text on a full line either centered or left or right
% adjusted.
% \begin{macrocode}
-\NewDocumentCommand \leftline { m } { \hbox_line_left:n {#1} }
-\NewDocumentCommand \centerline { m } { \hbox_line_center:n {#1} }
-\NewDocumentCommand \rightline { m } { \hbox_line_right:n {#1} }
+\RenewDocumentCommand \leftline { m } { \hbox_line_left:n {#1} }
+\RenewDocumentCommand \centerline { m } { \hbox_line_center:n {#1} }
+\RenewDocumentCommand \rightline { m } { \hbox_line_right:n {#1} }
% \end{macrocode}
% \end{macro}
%
More information about the latex3-commits
mailing list.