texlive[43337] Master/texmf-dist: autobreak (25feb17)

commits+karl at tug.org commits+karl at tug.org
Sat Feb 25 22:41:45 CET 2017


Revision: 43337
          http://tug.org/svn/texlive?view=revision&revision=43337
Author:   karl
Date:     2017-02-25 22:41:45 +0100 (Sat, 25 Feb 2017)
Log Message:
-----------
autobreak (25feb17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/autobreak/autobreak.pdf
    trunk/Master/texmf-dist/source/latex/autobreak/autobreak.dtx
    trunk/Master/texmf-dist/source/latex/autobreak/autobreak.ins
    trunk/Master/texmf-dist/tex/latex/autobreak/autobreak.sty

Modified: trunk/Master/texmf-dist/doc/latex/autobreak/autobreak.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/autobreak/autobreak.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/autobreak/autobreak.dtx	2017-02-25 01:05:38 UTC (rev 43336)
+++ trunk/Master/texmf-dist/source/latex/autobreak/autobreak.dtx	2017-02-25 21:41:45 UTC (rev 43337)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright (C) 2016 by Takahiro Ueda <tueda at nikhef.nl>
+% Copyright (C) 2016-2017 by Takahiro Ueda <tueda at nikhef.nl>
 %
 % This file may be distributed and/or modified under the conditions of
 % the LaTeX Project Public License, either version 1.3 of this license
@@ -34,7 +34,7 @@
 
 This is a generated file.
 
-Copyright (C) 2016 by Takahiro Ueda <tueda at nikhef.nl>
+Copyright (C) 2016-2017 by Takahiro Ueda <tueda at nikhef.nl>
 
 This file may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3 of this license
@@ -92,6 +92,7 @@
 \documentclass{ltxdoc}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}
+\usepackage{color}
 \usepackage{hypdoc}
 \usepackage{amsmath}
 \usepackage{autobreak}
@@ -104,6 +105,12 @@
 % The default value of IndexColumns=3 never fits in pages.
 \setcounter{IndexColumns}{2}
 
+\definecolor{hilite}{rgb}{0.2,0.4,0.7}
+\makeatletter
+\renewcommand{\HDorg at theCodelineNo}{%
+  \textcolor{hilite}{\rmfamily\scriptsize\arabic{CodelineNo}}}
+\makeatother
+
 \providecommand\env[1]{\texttt{#1}}
 \providecommand\pkg[1]{\textsf{#1}}
 
@@ -193,7 +200,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{330}
+% \CheckSum{409}
 %
 % \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
@@ -217,7 +224,7 @@
 %        to \pkg{autobreak}~\fileversion, dated \filedate.}}
 % \author{Takahiro Ueda}
 %
-% \date{19 June 2016}
+% \date{23 February 2017}
 %
 % \maketitle
 %
@@ -459,6 +466,47 @@
 % In the next run, the layout of the equations will be corrected.
 %
 % \begin{decl}
+% |\MoveEqLeft|\oarg{number}
+% \end{decl}
+% This command is desinged to work like \cs{MoveEqLeft} of
+% the \pkg{mathtools} package^^A
+% \footnote{^^A
+%   \url{https://www.ctan.org/pkg/mathtools}.
+% }. If it is put at the beginning of an \env{autobreak} environment,
+% then all subsequent lines after the first line are indented by 2 em
+% (the default value).
+% \begin{example}
+%   \begin{align}
+%     \begin{autobreak}
+%       \MoveEqLeft
+%       (n_1+n_2+n_3+n_4)^3 =
+%       n_1^3
+%       + 3 n_1^2 n_2
+%       + 3 n_1 n_2^2
+%       + n_2^3
+%       + 3 n_1^2 n_3
+%       + 6 n_1 n_2 n_3
+%       + 3 n_2^2 n_3
+%       + 3 n_1 n_3^2
+%       + 3 n_2 n_3^2
+%       + n_3^3
+%       + 3 n_1^2 n_4
+%       + 6 n_1 n_2 n_4
+%       + 3 n_2^2 n_4
+%       + 6 n_1 n_3 n_4
+%       + 6 n_2 n_3 n_4
+%       + 3 n_3^2 n_4
+%       + 3 n_1 n_4^2
+%       + 3 n_2 n_4^2
+%       + 3 n_3 n_4^2
+%       + n_4^3 .
+%     \end{autobreak}
+%   \end{align}
+% \end{example}
+% The indent width can be changed by an optional argument of
+% the command.
+%
+% \begin{decl}
 % |\everybeforeautobreak| \marg{tokens} \\
 % |\everyaftereautobreak| \marg{tokens}
 % \end{decl}
@@ -598,7 +646,7 @@
 %<*package>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{autobreak}%
-  [2016/07/03 v0.2 simple line breaking of long formulae]
+  [2017/02/23 v0.3 simple line breaking of long formulae]
 %    \end{macrocode}
 %
 % \subsection{Registers and constants}
@@ -886,7 +934,7 @@
   \if at autobreak@newlinedef
   \else
     \PackageError{autobreak}{%
-      autobreak is not allowed here
+      autobreak is not allowed here%
     }{%
       Use autobreak inside align.
     }%
@@ -926,6 +974,7 @@
   \@autobreak at alltoks={}%
   \@autobreak at linetoks={}%
   \@autobreak at lhswidth=\z@
+  \let\MoveEqLeft=\@autobreak at MoveEqLeft
 }
 %    \end{macrocode}
 % \end{macro}
@@ -1003,6 +1052,64 @@
   }%
 }
 %    \end{macrocode}
+% Catch \cs{MoveEqLeft}.
+% \changes{v0.3}{2017/02/23}{Add \cs{MoveEqLeft} command}
+%    \begin{macrocode}
+\def\@autobreak at scanline@@@{%
+  \@ifnextchar\MoveEqLeft{%
+    \@autobreak at scanline@MoveEqLeft
+  }{%
+    \@autobreak at scanline@@@@
+  }%
+}
+%    \end{macrocode}
+% The argument |#1| is \cs{MoveEqLeft}. This command accepts an
+% optional number.
+%    \begin{macrocode}
+\def\@autobreak at scanline@MoveEqLeft#1{%
+  \@ifnextchar[{%
+    \@autobreak at scanline@MoveEqLeft@
+  }{%
+    \@autobreak at scanline@MoveEqLeft@[2]%
+  }%
+}
+%    \end{macrocode}
+%    \begin{macrocode}
+\def\@autobreak at scanline@MoveEqLeft@[#1]{%
+  \ifdim#1\p@>\z@
+    \def\@tempa{\@autobreak at scanline@MvEqL at pos}%
+  \else\ifdim#1\p@=\z@
+    \def\@tempa{\@autobreak at scanline@MvEqL at zero}%
+  \else
+    \def\@tempa{\@autobreak at scanline@MvEqL at neg}%
+  \fi\fi
+  \@tempa{#1}%
+}
+%    \end{macrocode}
+%    \begin{macrocode}
+\def\@autobreak at scanline@MvEqL at pos#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern#1em}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-#1em%
+}
+%    \end{macrocode}
+% In the case with |#1| = 0, a special treatment is required because \\
+% \cs{@autobreak at processline} ignores a zero width. Insert a very tiny
+% space.
+%    \begin{macrocode}
+\def\@autobreak at scanline@MvEqL at zero#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern1sp}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-1sp%
+}
+%    \end{macrocode}
+% In the case with |#1| < 0, put a very tiny space, and then put the
+% space with a positive width such that the first line is indented to
+% the right.
+%    \begin{macrocode}
+\def\@autobreak at scanline@MvEqL at neg#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern1sp}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-1sp\kern-#1em%
+}
+%    \end{macrocode}
 % One may expect \cs{input}\marg{file} in \env{autobreak} is expanded by
 % the file content and \env{autobreak} treats new lines in it correctly.
 % But it needs more work. Because handling of \cs{input} in the middle
@@ -1012,15 +1119,15 @@
 %    \begin{macrocode}
 \IfFileExists{catchfile.sty}{
   \RequirePackage{catchfile}
-  \def\@autobreak at scanline@@@{%
+  \def\@autobreak at scanline@@@@{%
     \@ifnextchar\input{%
       \@autobreak at scanline@input
     }{%
       \@autobreak at scanline
     }%
-  }
+  }%
 }{
-  \def\@autobreak at scanline@@@{%
+  \def\@autobreak at scanline@@@@{%
     \@ifnextchar\input{%
       \PackageWarning{autobreak}{%
         Cannot handle new lines in a file via \protect\input,
@@ -1028,7 +1135,7 @@
       }%
     }%
     \@autobreak at scanline
-  }
+  }%
 }
 %    \end{macrocode}
 % The argument |#1| is \cs{input} and |#2| is the file name.
@@ -1040,6 +1147,22 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@autobreak at MoveEqLeft}
+% This definition is expanded only when \cs{@autobreak at scanline} cannot
+% detect \cs{MoveEqLeft} in an \env{autobreak} environment, in other
+% words, when it appears in the middle of a line.
+%    \begin{macrocode}
+\def\@autobreak at MoveEqLeft{%
+  \PackageError{autobreak}{%
+    \protect\MoveEqLeft\space is not allowed here%
+  }{%
+    \protect\MoveEqLeft\space must be put at the beginning of
+    an autobreak environment.
+  }%
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@autobreak at processline}
 % \changes{v0.2}{2016/07/03}{Fix space calculation around alignment
 %   tabs}

Modified: trunk/Master/texmf-dist/source/latex/autobreak/autobreak.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/autobreak/autobreak.ins	2017-02-25 01:05:38 UTC (rev 43336)
+++ trunk/Master/texmf-dist/source/latex/autobreak/autobreak.ins	2017-02-25 21:41:45 UTC (rev 43337)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2016 by Takahiro Ueda <tueda at nikhef.nl>
+%% Copyright (C) 2016-2017 by Takahiro Ueda <tueda at nikhef.nl>
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3 of this license
@@ -28,7 +28,7 @@
 
 This is a generated file.
 
-Copyright (C) 2016 by Takahiro Ueda <tueda at nikhef.nl>
+Copyright (C) 2016-2017 by Takahiro Ueda <tueda at nikhef.nl>
 
 This file may be distributed and/or modified under the conditions of
 the LaTeX Project Public License, either version 1.3 of this license

Modified: trunk/Master/texmf-dist/tex/latex/autobreak/autobreak.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/autobreak/autobreak.sty	2017-02-25 01:05:38 UTC (rev 43336)
+++ trunk/Master/texmf-dist/tex/latex/autobreak/autobreak.sty	2017-02-25 21:41:45 UTC (rev 43337)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2016 by Takahiro Ueda <tueda at nikhef.nl>
+%% Copyright (C) 2016-2017 by Takahiro Ueda <tueda at nikhef.nl>
 %% 
 %% This file may be distributed and/or modified under the conditions of
 %% the LaTeX Project Public License, either version 1.3 of this license
@@ -22,7 +22,7 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{autobreak}%
-  [2016/07/03 v0.2 simple line breaking of long formulae]
+  [2017/02/23 v0.3 simple line breaking of long formulae]
 \newtoks\everybeforeautobreak
 \newtoks\everyafterautobreak
 \newtoks\@autobreak at alltoks
@@ -132,7 +132,7 @@
   \if at autobreak@newlinedef
   \else
     \PackageError{autobreak}{%
-      autobreak is not allowed here
+      autobreak is not allowed here%
     }{%
       Use autobreak inside align.
     }%
@@ -151,6 +151,7 @@
   \@autobreak at alltoks={}%
   \@autobreak at linetoks={}%
   \@autobreak at lhswidth=\z@
+  \let\MoveEqLeft=\@autobreak at MoveEqLeft
 }
 \def\@autobreak at end{%
   \expandafter\@autobreak at addtoks\expandafter\@autobreak at alltoks
@@ -200,17 +201,53 @@
     \@autobreak at scanline@@@
   }%
 }
+\def\@autobreak at scanline@@@{%
+  \@ifnextchar\MoveEqLeft{%
+    \@autobreak at scanline@MoveEqLeft
+  }{%
+    \@autobreak at scanline@@@@
+  }%
+}
+\def\@autobreak at scanline@MoveEqLeft#1{%
+  \@ifnextchar[{%
+    \@autobreak at scanline@MoveEqLeft@
+  }{%
+    \@autobreak at scanline@MoveEqLeft@[2]%
+  }%
+}
+\def\@autobreak at scanline@MoveEqLeft@[#1]{%
+  \ifdim#1\p@>\z@
+    \def\@tempa{\@autobreak at scanline@MvEqL at pos}%
+  \else\ifdim#1\p@=\z@
+    \def\@tempa{\@autobreak at scanline@MvEqL at zero}%
+  \else
+    \def\@tempa{\@autobreak at scanline@MvEqL at neg}%
+  \fi\fi
+  \@tempa{#1}%
+}
+\def\@autobreak at scanline@MvEqL at pos#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern#1em}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-#1em%
+}
+\def\@autobreak at scanline@MvEqL at zero#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern1sp}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-1sp%
+}
+\def\@autobreak at scanline@MvEqL at neg#1{%
+  \def\@tempa{\expandafter\@autobreak at scanline\kern1sp}%
+  \expandafter\@tempa\@autobreak at newlinechar\kern-1sp\kern-#1em%
+}
 \IfFileExists{catchfile.sty}{
   \RequirePackage{catchfile}
-  \def\@autobreak at scanline@@@{%
+  \def\@autobreak at scanline@@@@{%
     \@ifnextchar\input{%
       \@autobreak at scanline@input
     }{%
       \@autobreak at scanline
     }%
-  }
+  }%
 }{
-  \def\@autobreak at scanline@@@{%
+  \def\@autobreak at scanline@@@@{%
     \@ifnextchar\input{%
       \PackageWarning{autobreak}{%
         Cannot handle new lines in a file via \protect\input,
@@ -218,12 +255,20 @@
       }%
     }%
     \@autobreak at scanline
-  }
+  }%
 }
 \def\@autobreak at scanline@input#1#2{%
   \CatchFileDef\@tempa{#2}{\catcode`\^^M=\active}%
   \expandafter\@autobreak at scanline\@tempa
 }
+\def\@autobreak at MoveEqLeft{%
+  \PackageError{autobreak}{%
+    \protect\MoveEqLeft\space is not allowed here%
+  }{%
+    \protect\MoveEqLeft\space must be put at the beginning of
+    an autobreak environment.
+  }%
+}
 \def\@autobreak at processline#1{%
   \ifdim\@autobreak at lhswidth=\z@
     \@autobreak at settowidth\@autobreak at lhswidth{#1{}}%



More information about the tex-live-commits mailing list