[OS X TeX] Baffled

Ross Moore ross.moore at mq.edu.au
Thu Jan 30 23:02:49 EST 2020


Hello Juan,

On 31 Jan 2020, at 2:53 pm, juan tolosa via MacOSX-TeX <macosx-tex at email.esm.psu.edu<mailto:macosx-tex at email.esm.psu.edu>> wrote:

I wanted to create a “double arrow overline” in plain TeX; I created the macro \overleftrightarrow by imitating what is done in the TeXbook in creating “overleftarrow” and “overrightarrow” After some tweaking, I got it to work. But here is the strange thing: by coincidence, I had the command “\input\miniltx.tex” at the beginning of the file, which I use to be able to draw pictures using the “graphicx” package. The problem is, if I remove this command, then the definition doesn’t work, the typesetter complains about the command “\m at th”
I was blindly following the definitions in the TeXbook, my knowledge of the fine points in TeX is very (very!) limited. Still, I am baffled, since Knuth’s book deals with plain TeX, not with LaTeX.

Can anyone illuminate me and let me know why is “miniltx” required for this definition to work?

It isn’t.

You just need to change the \catcode of @ while definitions using it are being made:


Thanks
Juan

Below is a sample file

%
\input miniltx.tex
% \RequirePackage{graphicx}

%
%%%%%%%%%%%%%%%%%%
%
% DEFINE "over left right arrow". INSPIRATION:
%. TeX book, definition of \overleftarrow on p. 359
%. plus definitions of \leftarrowfill and \rightarrowfill on p. 357
% First need "left right arrow fill” defined

\catcode`\@ 11  %%% <<<<   make @ into a letter

\def\leftrightarrowfill{$\m at th \mathord\leftarrow \mkern-6mu
\cleaders\hbox{$\mkern-2mu \mathord- \mkern-2mu$}\hfill
\mkern -6mu \mathord \rightarrow$}
%

\catcode`\@ 12  %%% <<<<  revert @ to being a punctuation character


\def\overleftrightarrow#1{\vbox{\ialign{##\crcr
\leftrightarrowfill\crcr\noalign{\kern-1pt\nointerlineskip}
$\hfil\displaystyle{#1}\hfil$\crcr}}}
%
%________________________________________________________________

Any two distinct points $A$ and $B$ determine a unique line $\overleftrightarrow{AB}$.

\bye



Hope this helps.

Ross


Dr Ross Moore
Department of Mathematics and Statistics
12 Wally’s Walk, Level 7, Room 734
Macquarie University, NSW 2109, Australia
T: +61 2 9850 8955  |  F: +61 2 9850 8114
M:+61 407 288 255  |  E: ross.moore at mq.edu.au<mailto:ross.moore at mq.edu.au>
http://www.maths.mq.edu.au
[cid:image001.png at 01D030BE.D37A46F0]
CRICOS Provider Number 00002J. Think before you print.
Please consider the environment before printing this email.

This message is intended for the addressee named and may
contain confidential information. If you are not the intended
recipient, please delete it and notify the sender. Views expressed
in this message are those of the individual sender, and are not
necessarily the views of Macquarie University. <http://mq.edu.au/>
<http://mq.edu.au/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200131/a044256b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4605 bytes
Desc: image001.png
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20200131/a044256b/attachment.png>


More information about the MacOSX-TeX mailing list