| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: mleftright.dtx |
| 4 |
% Version: 2019/12/03 v1.2 |
| 5 |
% Info: Math left/right delim. as open/close |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2010 Heiko Oberdiek |
| 9 |
% 2016-2019 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/mleftright/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/mleftright/issues |
| 27 |
% |
| 28 |
% The Base Interpreter refers to any `TeX-Format', |
| 29 |
% because some files are installed in TDS:tex/generic//. |
| 30 |
% |
| 31 |
% This work consists of the main source file mleftright.dtx |
| 32 |
% and the derived files |
| 33 |
% mleftright.sty, mleftright.pdf, mleftright.ins, mleftright.drv, |
| 34 |
% mleftright-test1.tex. |
| 35 |
% |
| 36 |
% Distribution: |
| 37 |
% CTAN:macros/latex/contrib/mleftright/mleftright.dtx |
| 38 |
% CTAN:macros/latex/contrib/mleftright/mleftright.pdf |
| 39 |
% |
| 40 |
% Unpacking: |
| 41 |
% (a) If mleftright.ins is present: |
| 42 |
% tex mleftright.ins |
| 43 |
% (b) Without mleftright.ins: |
| 44 |
% tex mleftright.dtx |
| 45 |
% (c) If you insist on using LaTeX |
| 46 |
% latex \let\install=y\input{mleftright.dtx} |
| 47 |
% (quote the arguments according to the demands of your shell) |
| 48 |
% |
| 49 |
% Documentation: |
| 50 |
% (a) If mleftright.drv is present: |
| 51 |
% latex mleftright.drv |
| 52 |
% (b) Without mleftright.drv: |
| 53 |
% latex mleftright.dtx; ... |
| 54 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 55 |
% if available. Here you can specify further options, e.g. |
| 56 |
% use A4 as paper format: |
| 57 |
% \PassOptionsToClass{a4paper}{article} |
| 58 |
% |
| 59 |
% Programm calls to get the documentation (example): |
| 60 |
% pdflatex mleftright.dtx |
| 61 |
% makeindex -s gind.ist mleftright.idx |
| 62 |
% pdflatex mleftright.dtx |
| 63 |
% makeindex -s gind.ist mleftright.idx |
| 64 |
% pdflatex mleftright.dtx |
| 65 |
% |
| 66 |
% Installation: |
| 67 |
% TDS:tex/generic/mleftright/mleftright.sty |
| 68 |
% TDS:doc/latex/mleftright/mleftright.pdf |
| 69 |
% TDS:source/latex/mleftright/mleftright.dtx |
| 70 |
% |
| 71 |
%<*ignore> |
| 72 |
\begingroup |
| 73 |
\catcode123=1 % |
| 74 |
\catcode125=2 % |
| 75 |
\def\x{LaTeX2e}% |
| 76 |
\expandafter\endgroup |
| 77 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 78 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 79 |
\ifx\fmtname\x\else 1\fi\relax |
| 80 |
\else\csname fi\endcsname |
| 81 |
%</ignore> |
| 82 |
%<*install> |
| 83 |
\input docstrip.tex |
| 84 |
\Msg{************************************************************************} |
| 85 |
\Msg{* Installation} |
| 86 |
\Msg{* Package: mleftright 2019/12/03 v1.2 Math left/right delim. as open/close (HO)} |
| 87 |
\Msg{************************************************************************} |
| 88 |
|
| 89 |
\keepsilent |
| 90 |
\askforoverwritefalse |
| 91 |
|
| 92 |
\let\MetaPrefix\relax |
| 93 |
\preamble |
| 94 |
|
| 95 |
This is a generated file. |
| 96 |
|
| 97 |
Project: mleftright |
| 98 |
Version: 2019/12/03 v1.2 |
| 99 |
|
| 100 |
Copyright (C) |
| 101 |
2010 Heiko Oberdiek |
| 102 |
2016-2019 Oberdiek Package Support Group |
| 103 |
|
| 104 |
This work may be distributed and/or modified under the |
| 105 |
conditions of the LaTeX Project Public License, either |
| 106 |
version 1.3c of this license or (at your option) any later |
| 107 |
version. This version of this license is in |
| 108 |
https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 109 |
and the latest version of this license is in |
| 110 |
https://www.latex-project.org/lppl.txt |
| 111 |
and version 1.3 or later is part of all distributions of |
| 112 |
LaTeX version 2005/12/01 or later. |
| 113 |
|
| 114 |
This work has the LPPL maintenance status "maintained". |
| 115 |
|
| 116 |
The Current Maintainers of this work are |
| 117 |
Heiko Oberdiek and the Oberdiek Package Support Group |
| 118 |
https://github.com/ho-tex/mleftright/issues |
| 119 |
|
| 120 |
|
| 121 |
The Base Interpreter refers to any `TeX-Format', |
| 122 |
because some files are installed in TDS:tex/generic//. |
| 123 |
|
| 124 |
This work consists of the main source file mleftright.dtx |
| 125 |
and the derived files |
| 126 |
mleftright.sty, mleftright.pdf, mleftright.ins, mleftright.drv, |
| 127 |
mleftright-test1.tex. |
| 128 |
|
| 129 |
\endpreamble |
| 130 |
\let\MetaPrefix\DoubleperCent |
| 131 |
|
| 132 |
\generate{% |
| 133 |
\file{mleftright.ins}{\from{mleftright.dtx}{install}}% |
| 134 |
\file{mleftright.drv}{\from{mleftright.dtx}{driver}}% |
| 135 |
\usedir{tex/generic/mleftright}% |
| 136 |
\file{mleftright.sty}{\from{mleftright.dtx}{package}}% |
| 137 |
% \usedir{doc/latex/mleftright/test}% |
| 138 |
% \file{mleftright-test1.tex}{\from{mleftright.dtx}{test1}}% |
| 139 |
} |
| 140 |
|
| 141 |
\catcode32=13\relax% active space |
| 142 |
\let =\space% |
| 143 |
\Msg{************************************************************************} |
| 144 |
\Msg{*} |
| 145 |
\Msg{* To finish the installation you have to move the following} |
| 146 |
\Msg{* file into a directory searched by TeX:} |
| 147 |
\Msg{*} |
| 148 |
\Msg{* mleftright.sty} |
| 149 |
\Msg{*} |
| 150 |
\Msg{* To produce the documentation run the file `mleftright.drv'} |
| 151 |
\Msg{* through LaTeX.} |
| 152 |
\Msg{*} |
| 153 |
\Msg{* Happy TeXing!} |
| 154 |
\Msg{*} |
| 155 |
\Msg{************************************************************************} |
| 156 |
|
| 157 |
\endbatchfile |
| 158 |
%</install> |
| 159 |
%<*ignore> |
| 160 |
\fi |
| 161 |
%</ignore> |
| 162 |
%<*driver> |
| 163 |
\NeedsTeXFormat{LaTeX2e} |
| 164 |
\ProvidesFile{mleftright.drv}% |
| 165 |
[2019/12/03 v1.2 Math left/right delim. as open/close (HO)]% |
| 166 |
\documentclass{ltxdoc} |
| 167 |
\usepackage{holtxdoc}[2011/11/22] |
| 168 |
\usepackage{mleftright}[2019/12/03] |
| 169 |
\begin{document} |
| 170 |
\DocInput{mleftright.dtx}% |
| 171 |
\end{document} |
| 172 |
%</driver> |
| 173 |
% \fi |
| 174 |
% |
| 175 |
% |
| 176 |
% |
| 177 |
% \GetFileInfo{mleftright.drv} |
| 178 |
% |
| 179 |
% \title{The \xpackage{mleftright} package} |
| 180 |
% \date{2019/12/03 v1.2} |
| 181 |
% \author{Heiko Oberdiek\thanks |
| 182 |
% {Please report any issues at \url{https://github.com/ho-tex/mleftright/issues}}} |
| 183 |
% |
| 184 |
% \maketitle |
| 185 |
% |
| 186 |
% \begin{abstract} |
| 187 |
% \TeX\ sets subformulas by \cs{left} and \cs{right} as inner formulas |
| 188 |
% with additional surrounding spaces in some situations. This package |
| 189 |
% provides \cs{mleft} and \cs{mright} that call \cs{left} and \cs{right}, |
| 190 |
% but the delimiters will act as normal \cs{mathopen} and \cs{mathclose} |
| 191 |
% delimiters without the additional space of an inner formula. |
| 192 |
% \end{abstract} |
| 193 |
% |
| 194 |
% \tableofcontents |
| 195 |
% |
| 196 |
% \section{Documentation} |
| 197 |
% |
| 198 |
% The package is a result of a thread in the newsgroup \textsf{comp.text.tex} |
| 199 |
% with the subject \textit{spacing after \cs{right}\texttt{)} |
| 200 |
% and before \cs{left}\texttt{)}} \cite{dave}. |
| 201 |
% The problem: \cs{left} and \cs{right} adjust the size of the |
| 202 |
% delimiters automatically. However, \TeX\ treats the whole expression |
| 203 |
% as inner formula. In some circumstances \TeX\ adds extra space |
| 204 |
% before or after an inner formula. |
| 205 |
% Example: |
| 206 |
% \begin{quote} |
| 207 |
% \thinmuskip=1.5\thinmuskip |
| 208 |
% \begin{tabular}{@{}l@{\quad$\Rightarrow$\quad}l@{}} |
| 209 |
% |$\sin(x^2), x$| |
| 210 |
% & $\sin(x^2), x$\\ |
| 211 |
% |$\sin\left(x^2\right), x$| |
| 212 |
% & $\sin\left(x^2\right), x$\\ |
| 213 |
% ^^A \multicolumn{1}{@{}r@{\quad$\Rightarrow$\quad}}{^^A |
| 214 |
% ^^A \itshape with exaggerated spacing^^A |
| 215 |
% ^^A } |
| 216 |
% ^^A & $\thinmuskip=4\thinmuskip |
| 217 |
% ^^A \sin\left(x^2\right){,}\mskip.25\thinmuskip x$\\ |
| 218 |
% |$\sin\mleft(x^2\mright), x$| |
| 219 |
% & $\sin\mleft(x^2\mright), x$\\ |
| 220 |
% \end{tabular}\\*[.5ex] |
| 221 |
% (\cs{mleft} and \cs{mright} are provided by this package.) |
| 222 |
% \end{quote} |
| 223 |
% |
| 224 |
% In the newsgroup Donald Arseneau answered with clever macros \cite{arseneau}: |
| 225 |
% \begin{quote} |
| 226 |
%\begin{verbatim} |
| 227 |
%\newcommand\lft{\mathopen{}\left} |
| 228 |
%\newcommand\rgt{\aftergroup\mathclose\aftergroup{\aftergroup}\right} |
| 229 |
%\end{verbatim} |
| 230 |
% \end{quote} |
| 231 |
% However one problem remains, a following subscript or superscript |
| 232 |
% is not applied to the right delimiter but the empty |
| 233 |
% \cs{mathclose}. |
| 234 |
% Thus Philipp Stephani provided an improvement \cite{stephani}: |
| 235 |
%\begin{quote} |
| 236 |
%\begin{verbatim} |
| 237 |
%\mathopen{} \mathclose{\left\| A^2 \right\|}_2 |
| 238 |
%\end{verbatim} |
| 239 |
%\end{quote} |
| 240 |
% Heiko Oberdiek converted this into macro form \cite{oberdiek}: |
| 241 |
%\begin{quote} |
| 242 |
%\begin{verbatim} |
| 243 |
%\newcommand\lft{\mathopen{}\mathclose\bgroup\left} |
| 244 |
%\newcommand\rgt{\aftergroup\egroup\right} |
| 245 |
%\end{verbatim} |
| 246 |
%\end{quote} |
| 247 |
% |
| 248 |
% The package uses longer macro names \cs{mleft} and \cs{mright} |
| 249 |
% to avoid name clashes. Also it adds some checks for error conditions. |
| 250 |
% |
| 251 |
% \subsection{Use} |
| 252 |
% |
| 253 |
% \begin{declcs}{mleft}\meta{delimL} \dots\unkern\ \cs{mright}\meta{delimR} |
| 254 |
% \end{declcs} |
| 255 |
% Macros \cs{mleft} and \cs{mright} are used in the same way as |
| 256 |
% \cs{left} and \cs{right}. Also \cs{middle} can be used inbetween if |
| 257 |
% \eTeX\ is present. |
| 258 |
% |
| 259 |
% \begin{declcs}{mleftright} |
| 260 |
% \end{declcs} |
| 261 |
% Macro \cs{mleftright} redefines \cs{left} as \cs{mleft} and |
| 262 |
% \cs{right} as \cs{mright}. The redefinition is local to the group. |
| 263 |
% |
| 264 |
% \begin{declcs}{mleftrightrestore} |
| 265 |
% \end{declcs} |
| 266 |
% Macro \cs{mleftright} restores \cs{left} and \cs{right} with |
| 267 |
% the original meaning if they were previously redefined by |
| 268 |
% \cs{mleftright} (also locally). |
| 269 |
% |
| 270 |
% |
| 271 |
% \StopEventually{ |
| 272 |
% } |
| 273 |
% |
| 274 |
% \section{Implementation} |
| 275 |
% \begin{macrocode} |
| 276 |
%<*package> |
| 277 |
% \end{macrocode} |
| 278 |
% Reload check, especially if the package is not used with \LaTeX. |
| 279 |
% \begin{macrocode} |
| 280 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 281 |
\catcode13=5 % ^^M |
| 282 |
\endlinechar=13 % |
| 283 |
\catcode35=6 % # |
| 284 |
\catcode39=12 % ' |
| 285 |
\catcode44=12 % , |
| 286 |
\catcode45=12 % - |
| 287 |
\catcode46=12 % . |
| 288 |
\catcode58=12 % : |
| 289 |
\catcode64=11 % @ |
| 290 |
\catcode123=1 % { |
| 291 |
\catcode125=2 % } |
| 292 |
\expandafter\let\expandafter\x\csname [email protected]\endcsname |
| 293 |
\ifx\x\relax % plain-TeX, first loading |
| 294 |
\else |
| 295 |
\def\empty{}% |
| 296 |
\ifx\x\empty % LaTeX, first loading, |
| 297 |
% variable is initialized, but \ProvidesPackage not yet seen |
| 298 |
\else |
| 299 |
\expandafter\ifx\csname PackageInfo\endcsname\relax |
| 300 |
\def\x#1#2{% |
| 301 |
\immediate\write-1{Package #1 Info: #2.}% |
| 302 |
}% |
| 303 |
\else |
| 304 |
\def\x#1#2{\PackageInfo{#1}{#2, stopped}}% |
| 305 |
\fi |
| 306 |
\x{mleftright}{The package is already loaded}% |
| 307 |
\aftergroup\endinput |
| 308 |
\fi |
| 309 |
\fi |
| 310 |
\endgroup% |
| 311 |
% \end{macrocode} |
| 312 |
% Package identification: |
| 313 |
% \begin{macrocode} |
| 314 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 315 |
\catcode13=5 % ^^M |
| 316 |
\endlinechar=13 % |
| 317 |
\catcode35=6 % # |
| 318 |
\catcode39=12 % ' |
| 319 |
\catcode40=12 % ( |
| 320 |
\catcode41=12 % ) |
| 321 |
\catcode44=12 % , |
| 322 |
\catcode45=12 % - |
| 323 |
\catcode46=12 % . |
| 324 |
\catcode47=12 % / |
| 325 |
\catcode58=12 % : |
| 326 |
\catcode64=11 % @ |
| 327 |
\catcode91=12 % [ |
| 328 |
\catcode93=12 % ] |
| 329 |
\catcode123=1 % { |
| 330 |
\catcode125=2 % } |
| 331 |
\expandafter\ifx\csname ProvidesPackage\endcsname\relax |
| 332 |
\def\x#1#2#3[#4]{\endgroup |
| 333 |
\immediate\write-1{Package: #3 #4}% |
| 334 |
\xdef#1{#4}% |
| 335 |
}% |
| 336 |
\else |
| 337 |
\def\x#1#2[#3]{\endgroup |
| 338 |
#2[{#3}]% |
| 339 |
\ifx#1\@undefined |
| 340 |
\xdef#1{#3}% |
| 341 |
\fi |
| 342 |
\ifx#1\relax |
| 343 |
\xdef#1{#3}% |
| 344 |
\fi |
| 345 |
}% |
| 346 |
\fi |
| 347 |
\expandafter\x\csname [email protected]\endcsname |
| 348 |
\ProvidesPackage{mleftright}% |
| 349 |
[2019/12/03 v1.2 Math left/right delim. as open/close (HO)]% |
| 350 |
% \end{macrocode} |
| 351 |
% |
| 352 |
% \begin{macrocode} |
| 353 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 354 |
\catcode13=5 % ^^M |
| 355 |
\endlinechar=13 % |
| 356 |
\catcode123=1 % { |
| 357 |
\catcode125=2 % } |
| 358 |
\catcode64=11 % @ |
| 359 |
\def\x{\endgroup |
| 360 |
\expandafter\edef\csname mleftright@AtEnd\endcsname{% |
| 361 |
\endlinechar=\the\endlinechar\relax |
| 362 |
\catcode13=\the\catcode13\relax |
| 363 |
\catcode32=\the\catcode32\relax |
| 364 |
\catcode35=\the\catcode35\relax |
| 365 |
\catcode61=\the\catcode61\relax |
| 366 |
\catcode64=\the\catcode64\relax |
| 367 |
\catcode123=\the\catcode123\relax |
| 368 |
\catcode125=\the\catcode125\relax |
| 369 |
}% |
| 370 |
}% |
| 371 |
\x\catcode61\catcode48\catcode32=10\relax% |
| 372 |
\catcode13=5 % ^^M |
| 373 |
\endlinechar=13 % |
| 374 |
\catcode35=6 % # |
| 375 |
\catcode64=11 % @ |
| 376 |
\catcode123=1 % { |
| 377 |
\catcode125=2 % } |
| 378 |
\def\TMP@EnsureCode#1#2{% |
| 379 |
\edef\mleftright@AtEnd{% |
| 380 |
\mleftright@AtEnd |
| 381 |
\catcode#1=\the\catcode#1\relax |
| 382 |
}% |
| 383 |
\catcode#1=#2\relax |
| 384 |
} |
| 385 |
\TMP@EnsureCode{38}{4}% & |
| 386 |
\TMP@EnsureCode{39}{12}% ' |
| 387 |
\TMP@EnsureCode{40}{12}% ( |
| 388 |
\TMP@EnsureCode{41}{12}% ) |
| 389 |
\TMP@EnsureCode{42}{12}% * |
| 390 |
\TMP@EnsureCode{43}{12}% + |
| 391 |
\TMP@EnsureCode{44}{12}% , |
| 392 |
\TMP@EnsureCode{45}{12}% - |
| 393 |
\TMP@EnsureCode{46}{12}% . |
| 394 |
\TMP@EnsureCode{47}{12}% / |
| 395 |
\TMP@EnsureCode{60}{12}% < |
| 396 |
\TMP@EnsureCode{91}{12}% [ |
| 397 |
\TMP@EnsureCode{93}{12}% ] |
| 398 |
\edef\mleftright@AtEnd{% |
| 399 |
\mleftright@AtEnd |
| 400 |
\escapechar\the\escapechar\relax |
| 401 |
\noexpand\endinput |
| 402 |
} |
| 403 |
\escapechar=92 % |
| 404 |
% \end{macrocode} |
| 405 |
% |
| 406 |
% \begin{macrocode} |
| 407 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 408 |
\expandafter\ifx\csname RequirePackage\endcsname\relax |
| 409 |
\input infwarerr.sty\relax |
| 410 |
\input ltxcmds.sty\relax |
| 411 |
\else |
| 412 |
\RequirePackage{infwarerr}[2010/04/08]% |
| 413 |
\RequirePackage{ltxcmds}[2010/04/26]% |
| 414 |
\fi |
| 415 |
% \end{macrocode} |
| 416 |
% |
| 417 |
% The original commands \cs{left} and \cs{right} |
| 418 |
% are saved and later used in \cs{mleft} and |
| 419 |
% \cs{mright} in order to deal with: |
| 420 |
% \begin{quote} |
| 421 |
%\begin{verbatim} |
| 422 |
%\let\left\mleft |
| 423 |
%\let\right\mright |
| 424 |
%\end{verbatim} |
| 425 |
% \end{quote} |
| 426 |
% \begin{macro}{\mleftright@OrgLeft} |
| 427 |
% \begin{macrocode} |
| 428 |
\let\mleftright@OrgLeft\left |
| 429 |
% \end{macrocode} |
| 430 |
% \end{macro} |
| 431 |
% \begin{macro}{\mleftright@OrgRight} |
| 432 |
% \begin{macrocode} |
| 433 |
\let\mleftright@OrgRight\right |
| 434 |
% \end{macrocode} |
| 435 |
% \end{macro} |
| 436 |
% |
| 437 |
% \begin{macro}{\mleftright@Def} |
| 438 |
% Macro \cs{mleftright@Def} defines a macro as robust macro |
| 439 |
% if \eTeX\ or \LaTeX\ is available. |
| 440 |
% \begin{macrocode} |
| 441 |
\ltx@IfUndefined{protected}{% |
| 442 |
\ltx@IfUndefined{DeclareRobustCommand}{% |
| 443 |
\def\mleftright@Def{\def}% |
| 444 |
}{% |
| 445 |
\def\mleftright@Def{\DeclareRobustCommand*}% |
| 446 |
}% |
| 447 |
}{% |
| 448 |
\def\mleftright@Def{\protected\def}% |
| 449 |
} |
| 450 |
\edef\mleftright@Def#1{% |
| 451 |
\noexpand\ltx@IfUndefined{% |
| 452 |
\noexpand\expandafter\noexpand\ltx@gobble\noexpand\string#1% |
| 453 |
}{% |
| 454 |
\expandafter\noexpand\mleftright@Def#1% |
| 455 |
}{% |
| 456 |
\noexpand\@PackageError{mleftright}{% |
| 457 |
Command \noexpand\string#1 already defined% |
| 458 |
}\noexpand\@ehd |
| 459 |
\noexpand\ltx@gobble |
| 460 |
}% |
| 461 |
} |
| 462 |
% \end{macrocode} |
| 463 |
% \end{macro} |
| 464 |
% |
| 465 |
% In case of \eTeX\ the group status after the left symbol |
| 466 |
% is saved and later checked at the beginning of \cs{mright}. |
| 467 |
% \begin{macrocode} |
| 468 |
\ltx@IfUndefined{currentgrouplevel}{% |
| 469 |
\catcode38=14 % & = comment |
| 470 |
}{% |
| 471 |
\catcode38=9 % & = ignore |
| 472 |
} |
| 473 |
% \end{macrocode} |
| 474 |
% |
| 475 |
% \begin{macro}{\mleftright@GroupLevel} |
| 476 |
% \begin{macrocode} |
| 477 |
& \def\mleftright@GroupLevel{-1}% |
| 478 |
% \end{macrocode} |
| 479 |
% \end{macro} |
| 480 |
% |
| 481 |
% \begin{macro}{\mleftright@WrongGroup} |
| 482 |
% \begin{macrocode} |
| 483 |
& \def\mleftright@WrongGroup#1(#2){% |
| 484 |
& \ifnum\mleftright@GroupLevel<\ltx@zero |
| 485 |
& \@PackageError{mleftright}{% |
| 486 |
& Missing previous \string\mleft |
| 487 |
& }\@ehc |
| 488 |
& \else |
| 489 |
& \@PackageError{mleftright}{% |
| 490 |
& Unexpected group status for \string\mright% |
| 491 |
& \ifnum\mleftright@GroupLevel=#1 % |
| 492 |
& \else |
| 493 |
& .\MessageBreak |
| 494 |
& Group level is #1, % |
| 495 |
& expected is \mleftright@GroupLevel |
| 496 |
& \fi |
| 497 |
& \ifnum16=#2 % |
| 498 |
& \else |
| 499 |
& .\MessageBreak |
| 500 |
& Group type is #2 (% |
| 501 |
& \ifcase#2 % |
| 502 |
& bottom level% |
| 503 |
& \expandafter\expandafter\expandafter\ltx@gobblefour |
| 504 |
& \expandafter\ltx@gobbletwo |
| 505 |
& \or simple% |
| 506 |
& \or hbox% |
| 507 |
& \or adjusted hbox% |
| 508 |
& \or vbox% |
| 509 |
& \or vtop% |
| 510 |
& \or align% |
| 511 |
& \or no align% |
| 512 |
& \or output% |
| 513 |
& \or math% |
| 514 |
& \or disc% |
| 515 |
& \or insert% |
| 516 |
& \or vcenter% |
| 517 |
& \or math choice% |
| 518 |
& \or semi simple% |
| 519 |
& \or math shift% |
| 520 |
& \or math left% |
| 521 |
& \else |
| 522 |
& unknown% |
| 523 |
& \fi |
| 524 |
& \space group),\MessageBreak |
| 525 |
& expected is 16 (math left group)% |
| 526 |
& \fi |
| 527 |
& }\@ehd |
| 528 |
& \fi |
| 529 |
& }% |
| 530 |
% \end{macrocode} |
| 531 |
% \end{macro} |
| 532 |
% |
| 533 |
% \begin{macro}{\mleft} |
| 534 |
% \begin{macrocode} |
| 535 |
\mleftright@Def\mleft{% |
| 536 |
\mathopen{}\mathclose\bgroup |
| 537 |
& \edef\mleftright@GroupLevel{\the\numexpr\the\currentgrouplevel+1}% |
| 538 |
\mleftright@OrgLeft |
| 539 |
} |
| 540 |
% \end{macrocode} |
| 541 |
% \end{macro} |
| 542 |
% \begin{macro}{\mright} |
| 543 |
% \begin{macrocode} |
| 544 |
\mleftright@Def\mright{% |
| 545 |
& \ifnum\mleftright@GroupLevel=\currentgrouplevel |
| 546 |
& \ifnum16=\currentgrouptype |
| 547 |
\aftergroup\egroup |
| 548 |
& \else |
| 549 |
& \expandafter\mleftright@WrongGroup |
| 550 |
& \the\expandafter\currentgrouplevel |
| 551 |
& \expandafter(\the\currentgrouptype)% |
| 552 |
& \fi |
| 553 |
& \else |
| 554 |
& \expandafter\mleftright@WrongGroup |
| 555 |
& \the\expandafter\currentgrouplevel |
| 556 |
& \expandafter(\the\currentgrouptype)% |
| 557 |
& \fi |
| 558 |
\mleftright@OrgRight |
| 559 |
} |
| 560 |
% \end{macrocode} |
| 561 |
% \end{macro} |
| 562 |
% |
| 563 |
% \begin{macro}{\mleftright} |
| 564 |
% \begin{macrocode} |
| 565 |
\mleftright@Def\mleftright{% |
| 566 |
\let\left\mleft |
| 567 |
\let\right\mright |
| 568 |
} |
| 569 |
% \end{macrocode} |
| 570 |
% \end{macro} |
| 571 |
% |
| 572 |
% \begin{macro}{\mleftrightrestore} |
| 573 |
% \begin{macrocode} |
| 574 |
\mleftright@Def\mleftrightrestore{% |
| 575 |
\ifx\left\mleft |
| 576 |
\let\left\mleftright@OrgLeft |
| 577 |
\fi |
| 578 |
\ifx\right\mright |
| 579 |
\let\right\mleftright@OrgRight |
| 580 |
\fi |
| 581 |
} |
| 582 |
% \end{macrocode} |
| 583 |
% \end{macro} |
| 584 |
% |
| 585 |
% \begin{macrocode} |
| 586 |
\mleftright@AtEnd% |
| 587 |
%</package> |
| 588 |
% \end{macrocode} |
| 589 |
%% \section{Installation} |
| 590 |
% |
| 591 |
% \subsection{Download} |
| 592 |
% |
| 593 |
% \paragraph{Package.} This package is available on |
| 594 |
% CTAN\footnote{\CTANpkg{mleftright}}: |
| 595 |
% \begin{description} |
| 596 |
% \item[\CTAN{macros/latex/contrib/mleftright/mleftright.dtx}] The source file. |
| 597 |
% \item[\CTAN{macros/latex/contrib/mleftright/mleftright.pdf}] Documentation. |
| 598 |
% \end{description} |
| 599 |
% |
| 600 |
% |
| 601 |
% \paragraph{Bundle.} All the packages of the bundle `mleftright' |
| 602 |
% are also available in a TDS compliant ZIP archive. There |
| 603 |
% the packages are already unpacked and the documentation files |
| 604 |
% are generated. The files and directories obey the TDS standard. |
| 605 |
% \begin{description} |
| 606 |
% \item[\CTANinstall{install/macros/latex/contrib/mleftright.tds.zip}] |
| 607 |
% \end{description} |
| 608 |
% \emph{TDS} refers to the standard ``A Directory Structure |
| 609 |
% for \TeX\ Files'' (\CTANpkg{tds}). Directories |
| 610 |
% with \xfile{texmf} in their name are usually organized this way. |
| 611 |
% |
| 612 |
% \subsection{Bundle installation} |
| 613 |
% |
| 614 |
% \paragraph{Unpacking.} Unpack the \xfile{mleftright.tds.zip} in the |
| 615 |
% TDS tree (also known as \xfile{texmf} tree) of your choice. |
| 616 |
% Example (linux): |
| 617 |
% \begin{quote} |
| 618 |
% |unzip mleftright.tds.zip -d ~/texmf| |
| 619 |
% \end{quote} |
| 620 |
% |
| 621 |
% \subsection{Package installation} |
| 622 |
% |
| 623 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 624 |
% \docstrip\ archive. The files are extracted by running the |
| 625 |
% \xfile{.dtx} through \plainTeX: |
| 626 |
% \begin{quote} |
| 627 |
% \verb|tex mleftright.dtx| |
| 628 |
% \end{quote} |
| 629 |
% |
| 630 |
% \paragraph{TDS.} Now the different files must be moved into |
| 631 |
% the different directories in your installation TDS tree |
| 632 |
% (also known as \xfile{texmf} tree): |
| 633 |
% \begin{quote} |
| 634 |
% \def\t{^^A |
| 635 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 636 |
% mleftright.sty & tex/generic/mleftright/mleftright.sty\\ |
| 637 |
% mleftright.pdf & doc/latex/mleftright/mleftright.pdf\\ |
| 638 |
% mleftright.dtx & source/latex/mleftright/mleftright.dtx\\ |
| 639 |
% \end{tabular}^^A |
| 640 |
% }^^A |
| 641 |
% \sbox0{\t}^^A |
| 642 |
% \ifdim\wd0>\linewidth |
| 643 |
% \begingroup |
| 644 |
% \advance\linewidth by\leftmargin |
| 645 |
% \advance\linewidth by\rightmargin |
| 646 |
% \edef\x{\endgroup |
| 647 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 648 |
% }\x |
| 649 |
% \def\lwbox{^^A |
| 650 |
% \leavevmode |
| 651 |
% \hbox to \linewidth{^^A |
| 652 |
% \kern-\leftmargin\relax |
| 653 |
% \hss |
| 654 |
% \usebox0 |
| 655 |
% \hss |
| 656 |
% \kern-\rightmargin\relax |
| 657 |
% }^^A |
| 658 |
% }^^A |
| 659 |
% \ifdim\wd0>\lw |
| 660 |
% \sbox0{\small\t}^^A |
| 661 |
% \ifdim\wd0>\linewidth |
| 662 |
% \ifdim\wd0>\lw |
| 663 |
% \sbox0{\footnotesize\t}^^A |
| 664 |
% \ifdim\wd0>\linewidth |
| 665 |
% \ifdim\wd0>\lw |
| 666 |
% \sbox0{\scriptsize\t}^^A |
| 667 |
% \ifdim\wd0>\linewidth |
| 668 |
% \ifdim\wd0>\lw |
| 669 |
% \sbox0{\tiny\t}^^A |
| 670 |
% \ifdim\wd0>\linewidth |
| 671 |
% \lwbox |
| 672 |
% \else |
| 673 |
% \usebox0 |
| 674 |
% \fi |
| 675 |
% \else |
| 676 |
% \lwbox |
| 677 |
% \fi |
| 678 |
% \else |
| 679 |
% \usebox0 |
| 680 |
% \fi |
| 681 |
% \else |
| 682 |
% \lwbox |
| 683 |
% \fi |
| 684 |
% \else |
| 685 |
% \usebox0 |
| 686 |
% \fi |
| 687 |
% \else |
| 688 |
% \lwbox |
| 689 |
% \fi |
| 690 |
% \else |
| 691 |
% \usebox0 |
| 692 |
% \fi |
| 693 |
% \else |
| 694 |
% \lwbox |
| 695 |
% \fi |
| 696 |
% \else |
| 697 |
% \usebox0 |
| 698 |
% \fi |
| 699 |
% \end{quote} |
| 700 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 701 |
% TDS installing feature, then some files can already be in the right |
| 702 |
% place, see the documentation of \docstrip. |
| 703 |
% |
| 704 |
% \subsection{Refresh file name databases} |
| 705 |
% |
| 706 |
% If your \TeX~distribution |
| 707 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 708 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 709 |
% \verb|mktexlsr|. |
| 710 |
% |
| 711 |
% \subsection{Some details for the interested} |
| 712 |
% |
| 713 |
% \paragraph{Unpacking with \LaTeX.} |
| 714 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 715 |
% \begin{description} |
| 716 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 717 |
% \item[\LaTeX:] Generate the documentation. |
| 718 |
% \end{description} |
| 719 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 720 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 721 |
% about your intention: |
| 722 |
% \begin{quote} |
| 723 |
% \verb|latex \let\install=y\input{mleftright.dtx}| |
| 724 |
% \end{quote} |
| 725 |
% Do not forget to quote the argument according to the demands |
| 726 |
% of your shell. |
| 727 |
% |
| 728 |
% \paragraph{Generating the documentation.} |
| 729 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 730 |
% the documentation. The process can be configured by the |
| 731 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 732 |
% line into this file, if you want to have A4 as paper format: |
| 733 |
% \begin{quote} |
| 734 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 735 |
% \end{quote} |
| 736 |
% An example follows how to generate the |
| 737 |
% documentation with pdf\LaTeX: |
| 738 |
% \begin{quote} |
| 739 |
%\begin{verbatim} |
| 740 |
%pdflatex mleftright.dtx |
| 741 |
%makeindex -s gind.ist mleftright.idx |
| 742 |
%pdflatex mleftright.dtx |
| 743 |
%makeindex -s gind.ist mleftright.idx |
| 744 |
%pdflatex mleftright.dtx |
| 745 |
%\end{verbatim} |
| 746 |
% \end{quote} |
| 747 |
% |
| 748 |
% \section{Acknowledgement} |
| 749 |
% |
| 750 |
% \begin{description} |
| 751 |
% \item[Donald Arsenau:] |
| 752 |
% He provided the main trick and the first macros. |
| 753 |
% \item[Philipp Stephani:] |
| 754 |
% He solved the subscript problem. |
| 755 |
% \end{description} |
| 756 |
% |
| 757 |
% \begin{thebibliography}{9} |
| 758 |
% \raggedright |
| 759 |
% \bibitem{dave} |
| 760 |
% Dave94705, |
| 761 |
% \textit{spacing after \cs{right}\texttt{)} and before \cs{left}\texttt{)}}, |
| 762 |
% newsgroup comp.text.tex, |
| 763 |
% Message-ID: \texttt{\small 5d264909-7c3d-4c9d-9b22-434178b2bf90@g21g2000prn.googlegroups.com}, |
| 764 |
% 2010-08-12. |
| 765 |
% \newblock |
| 766 |
% {\small\url{https://groups.google.com/group/comp.text.tex/msg/e5b6833da7dc29bf}} |
| 767 |
% |
| 768 |
% \bibitem{arseneau} |
| 769 |
% Donald Arseneau, |
| 770 |
% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)}, |
| 771 |
% newsgroup comp.text.tex, |
| 772 |
% Message-ID: \texttt{\small [email protected]}, |
| 773 |
% 2010-08-30. |
| 774 |
% \newblock |
| 775 |
% {\small\url{https://groups.google.com/group/comp.text.tex/msg/e0b2e4386e5d04e4}} |
| 776 |
% |
| 777 |
% \bibitem{stephani} |
| 778 |
% Philipp Stephani, |
| 779 |
% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)}, |
| 780 |
% newsgroup comp.text.tex, |
| 781 |
% Message-ID: \texttt{\small 4c8c8c1e\$0\$6981\[email protected]}, |
| 782 |
% 2010-09-12. |
| 783 |
% \newblock |
| 784 |
% {\small\url{https://groups.google.com/group/comp.text.tex/msg/87ac1f61321de3ef}} |
| 785 |
% |
| 786 |
% \bibitem{oberdiek} |
| 787 |
% Heiko Oberdiek, |
| 788 |
% \textit{Re: spacing after \cs{right}\texttt) and before \cs{left}\texttt)}, |
| 789 |
% newsgroup comp.text.tex, |
| 790 |
% Message-ID: \texttt{\small i6jcc2\$8of\[email protected]}, |
| 791 |
% 2010-09-12. |
| 792 |
% \newblock |
| 793 |
% {\small\url{https://groups.google.com/group/comp.text.tex/msg/257aa6119bef878b}} |
| 794 |
% |
| 795 |
% \end{thebibliography} |
| 796 |
% |
| 797 |
% \begin{History} |
| 798 |
% \begin{Version}{2010/09/25 v1.0} |
| 799 |
% \item |
| 800 |
% The first version. |
| 801 |
% \end{Version} |
| 802 |
% \begin{Version}{2016/05/16 v1.1} |
| 803 |
% \item |
| 804 |
% Documentation updates. |
| 805 |
% \end{Version} |
| 806 |
% \begin{Version}{2019/12/03 v1.2} |
| 807 |
% \item |
| 808 |
% Documentation updates. |
| 809 |
% \end{Version} |
| 810 |
% \end{History} |
| 811 |
% |
| 812 |
% \PrintIndex |
| 813 |
% |
| 814 |
% \Finale |
| 815 |
\endinput |