review of LaTeX macros

13 views
Skip to first unread message

Sean Fitzpatrick

unread,
Jul 5, 2021, 4:38:32 PM7/5/21
to APEX/Active Calculus MBX conversion
Right now we have a fairly extensive list of macros in the docinfo.
Many date back to Greg's original tex source, where they were abbreviated macros for author convenience.
That makes a lot of sense for the LaTeX --> PDF route, since no reader will ever see your macros.

But in HTML, someone using assistive features of MathJax is going to encounter those macros.
One that jumped out recently was using `\dx` as a shortcut for `\Delta x`.
I suspect one is unlikely to parse \dx as intended.
(Also, use of this shortcut doesn't begin until around Chapter 7. In Chapter 5, \Delta x is used.)

Is it worth doing an audit of these macros? Alex can correct me on this, but it seems to me that it would be better to either:
a) replace some of these shortcut macros with the LaTeX source
or
b) replace these macros with something more semantic.

In the latter case one might then be tempted to find those places where the macro wasn't used, and introduce the semantic macro.
This can be done by find-and-replace, so we don't have to worry about these being efficient to type.

Sean Fitzpatrick

unread,
Jul 5, 2021, 4:41:04 PM7/5/21
to APEX/Active Calculus MBX conversion
PS: there are macros for Leibniz notation that I think were introduced during the original MBX conversion,
and that -- to me, at least -- are also not semantic. Maybe `\lz` gets replaced by `\leibniz`?
But then there are also \lzn, \lzo, \lzoo,...

gregory...@gmail.com

unread,
Jul 6, 2021, 4:55:15 PM7/6/21
to APEX/Active Calculus MBX conversion
What would a usable, semantic macro be? I.e., would "\Delta x" be effectively replaced by "\deltax"? 

I think removing macros of convenience is probably the way to go, if/when we have time. We should be careful, though, too, as some of these macros served as more than just convenience. The chief example of this is " f'(x)", where the Calibri/Carlito font squish the f and the ' together in an unreadable fashion. So the macro \fp added a little space between the f & the '. Replacing the macro with simply f' would be fine for MathJax, though the print version would suffer. I suppose we could do a global replace of f' with f\,' in the .tex for the pdf. 

Sean Fitzpatrick

unread,
Jul 6, 2021, 5:16:26 PM7/6/21
to APEX/Active Calculus MBX conversion
I'm hoping Alex will weigh in on this one, because he's our expert on accessibility.

Alex Jordan

unread,
Jul 6, 2021, 10:58:22 PM7/6/21
to apexactive-calcul...@googlegroups.com
Just speaking to f'(x), in LaTeX, the apostrophe character is already
a maco in math mode. Just using:
'
is already a macro that expands to (iirc):
^{\prime}

So if that's right, I think that you might redefine that macro if the
font causes trouble. I guess you have to get into catcodes to do that.

If David Farmer is following this, he may have something to say about
\Delta x. I would just recommend using "\Delta x", with no special
macro. Or are we talking about the "dx" in an integral?

Note that convenience macros (like \Dx) can be fine for an author to
use. The trick is to convert them to the more expanded version (\Delta
x) before (a) the end user encounters them and (b) a potential
collaborator encounters them.
> --
> You received this message because you are subscribed to the Google Groups "APEX/Active Calculus MBX conversion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to apexactive-calculus-mbx...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/apexactive-calculus-mbx-conversion/ff1f25fb-2cf2-481f-b7f9-f66666544bd5n%40googlegroups.com.

Sean Fitzpatrick

unread,
Jul 6, 2021, 11:06:13 PM7/6/21
to APEX/Active Calculus MBX conversion
APEX is using \dx as shorthand for \Delta x. So that at least, I think we should replace.

I can confirm the spacing issue with f'(x).
The \fp macro produces f\primeskip '
and if I remember correctly (on phone, no code at the moment) \primeskip is itself a macro. There's also \fpp for the second derivative.

David Farmer

unread,
Jul 7, 2021, 1:35:23 PM7/7/21
to apexactive-calcul...@googlegroups.com

Shortcut macros are perfectly fine for the person writing
them, while they are actively writing.

By "shortcut" I mean "to the casual observer, it is not
obvious what the macro means". The opposite of shortcut
is semantic.

\unitnormal is semantic
\abs is semantic

\px (for \partial x) is not semantic
\dx is semantic if it is meant to be used as \int x^2 \dx ,
but it is not semantic if it means \Delta x .

I support Alex's suggestion that shortcut macros be expanded
into their definitions when the writing is mostly done and you
are ready for other people to see the source and possibly
edit it.
> To view this discussion on the web visit https://groups.google.com/d/msgid/apexactive-calculus-mbx-conversion/CA%2BR-jrfX-Cxf%3D9bktozjNAUOrTr3yjsjLkLXKEu1De62MGe7dg%40mail.gmail.com.
>
Reply all
Reply to author
Forward
0 new messages