[texhax] problem with a defined command

Lars Madsen daleif at imf.au.dk
Fri Jan 17 11:21:58 CET 2014


I do not see it as santioning its use, but rather means of getting aolder docs to run withpout replacing in the body

/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: http://au.dk/daleif@imf / More information: http://au.dk/en/daleif@imf


________________________________________
From: Philip Taylor [P.Taylor at Rhul.Ac.Uk]
Sent: 17 January 2014 11:14
To: Lars Madsen; A Emery; texhax at tug.org
Subject: Re: [texhax] problem with a defined command

Lars Madsen wrote:

> With more technical details
>
> http://tex.stackexchange.com/questions/112558/some-newcommand-instructions-not-working

Interesting, but still does not document /exactly/ for what
\begin {align} is seeking as its terminating delimiter.

> And I still stand on the my comment about deferinging structures like
> \begin{eqaution} etc, the logic is no longer visible in the code and
> it becomes very hard for others to read.

"This one could run and run".  Yes, \beq/\eeq will be less familiar
to others, but in general LaTeX documents are read by a computer,
not by any human other than the author, so "very hard for others
to read" is not really a reason for eschewing custom markup unless
one is working on a collaborative project.

But to return to Mr Emery's original question :

>From a syntactic perspective, the following will work --

\documentclass {minimal}
\usepackage {amsmath}
\def \beq#1\eeq {\begin {equation}#1\end {equation}}
\begin {document}
        \beq
        x=sin(y)
        \eeq
\end {document}

However, the caveats noted at http://tinyurl.com/beqeeq, and in
particular :

> This has to do with unfortunately nontrivial technical complications:
> the given environments must read their contents as a delimited macro
> argument because they do multipass pro- cessing of the contents using
> algorithms inherited from Spivak's amstex.tex.

suggest that this approach may fail for more complex examples, although
even MJD appears to sanction its use [1]

Philip Taylor
--------
[1]
http://ctan.mirrorcatalogs.com/macros/latex/required/amslatex/math/technote.pdf




More information about the texhax mailing list