diff options
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/autobreak/autobreak.sty | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/autobreak/autobreak.sty b/Master/texmf-dist/tex/latex/autobreak/autobreak.sty index cbcae2874de..db28b94b058 100644 --- a/Master/texmf-dist/tex/latex/autobreak/autobreak.sty +++ b/Master/texmf-dist/tex/latex/autobreak/autobreak.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2016 by Takahiro Ueda <tueda@nikhef.nl> +%% Copyright (C) 2016-2017 by Takahiro Ueda <tueda@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@alltoks @@ -132,7 +132,7 @@ \if@autobreak@newlinedef \else \PackageError{autobreak}{% - autobreak is not allowed here + autobreak is not allowed here% }{% Use autobreak inside align. }% @@ -151,6 +151,7 @@ \@autobreak@alltoks={}% \@autobreak@linetoks={}% \@autobreak@lhswidth=\z@ + \let\MoveEqLeft=\@autobreak@MoveEqLeft } \def\@autobreak@end{% \expandafter\@autobreak@addtoks\expandafter\@autobreak@alltoks @@ -200,17 +201,53 @@ \@autobreak@scanline@@@ }% } +\def\@autobreak@scanline@@@{% + \@ifnextchar\MoveEqLeft{% + \@autobreak@scanline@MoveEqLeft + }{% + \@autobreak@scanline@@@@ + }% +} +\def\@autobreak@scanline@MoveEqLeft#1{% + \@ifnextchar[{% + \@autobreak@scanline@MoveEqLeft@ + }{% + \@autobreak@scanline@MoveEqLeft@[2]% + }% +} +\def\@autobreak@scanline@MoveEqLeft@[#1]{% + \ifdim#1\p@>\z@ + \def\@tempa{\@autobreak@scanline@MvEqL@pos}% + \else\ifdim#1\p@=\z@ + \def\@tempa{\@autobreak@scanline@MvEqL@zero}% + \else + \def\@tempa{\@autobreak@scanline@MvEqL@neg}% + \fi\fi + \@tempa{#1}% +} +\def\@autobreak@scanline@MvEqL@pos#1{% + \def\@tempa{\expandafter\@autobreak@scanline\kern#1em}% + \expandafter\@tempa\@autobreak@newlinechar\kern-#1em% +} +\def\@autobreak@scanline@MvEqL@zero#1{% + \def\@tempa{\expandafter\@autobreak@scanline\kern1sp}% + \expandafter\@tempa\@autobreak@newlinechar\kern-1sp% +} +\def\@autobreak@scanline@MvEqL@neg#1{% + \def\@tempa{\expandafter\@autobreak@scanline\kern1sp}% + \expandafter\@tempa\@autobreak@newlinechar\kern-1sp\kern-#1em% +} \IfFileExists{catchfile.sty}{ \RequirePackage{catchfile} - \def\@autobreak@scanline@@@{% + \def\@autobreak@scanline@@@@{% \@ifnextchar\input{% \@autobreak@scanline@input }{% \@autobreak@scanline }% - } + }% }{ - \def\@autobreak@scanline@@@{% + \def\@autobreak@scanline@@@@{% \@ifnextchar\input{% \PackageWarning{autobreak}{% Cannot handle new lines in a file via \protect\input, @@ -218,12 +255,20 @@ }% }% \@autobreak@scanline - } + }% } \def\@autobreak@scanline@input#1#2{% \CatchFileDef\@tempa{#2}{\catcode`\^^M=\active}% \expandafter\@autobreak@scanline\@tempa } +\def\@autobreak@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@processline#1{% \ifdim\@autobreak@lhswidth=\z@ \@autobreak@settowidth\@autobreak@lhswidth{#1{}}% |