[OS X TeX] separators in label names

Ross Moore ross.moore at mq.edu.au
Sun Oct 13 17:40:08 EDT 2019


Hi Murray,

On 14 Oct 2019, at 7:50 am, Murray Eisenberg <murrayeisenberg at gmail.com<mailto:murrayeisenberg at gmail.com>> wrote:

I need crossreftools in order to pull apart cross-references to theorem-like constructs (with thmtools) that produce environments with outputs beginning

Theorem (an important result of Newton}

or

Fundamental Theorem of Calculus

so as to create macros that give the parenthesized name in the first type, preserving the upper-case letters of marked names (via \NoCaseChange from textcase), and the name in the second type but with initial letters lower-cased (again, with the exception of marked names; and so that the entries from all such environments in the \listoftheorems will keep that lower-casing except for the very first letter.

So, for example, in the first example, if it has label, say \label{thm:important}, then my macro \thmnameref* has output

an important result of Newton

from \thmnameref*{thm:important}; and if the second example has label \label{thm:FTC}, then my macro \thmref* gives output

fundamental theorem of calculus

from \thmref*{thm:FTC}. And in the list of theorems created by \listoftheorems, those two theorem-like environments will produce entries:

An important result of Newton
Fundamental theorem of calculus

This is all, among other reasons, due to customary Amer Math Soc and Math Assoc America math book (and journal) styles that prefer, or insist upon, lower-casing such theorem names, at least when referred to in the body of the text.

This all sounds really good, to be able to construct extra meaningful text,
by taking hints from the \label  strings.
I’m sure this will be extremely useful for accessibility; e.g.,
even if the theorem displays on-screen as:   Theorem (Newton)
there can be alternative text that can be passed to a screen-reader to say:
   “an important theorem of Newton” .

And of course if the visual text says ‘FTC’ there can be an internal expansion of the acronym
to pass the full phrase ‘Fundamental Theorem of Calculus’ (with or without capitalisation)
to the screen reader or Braille-based assistive technology.

These extra non-displayed strings need to be created using (La)TeX macros,
and stored in the appropriate places within the PDF being constructed.
It is then up to PDF reader software to detect their presence and access them when appropriate,
perhaps according to personalised preferences or key-strokes, provided by the (visually impaired) human reader.

This is a direction in which mathematical publishing really does need to go,
to properly support Accessibility in highly technical documents.


So when you think you are close to having a well-worked and robust set of macros,
I’d be very interested in using your package, and creating the extra coding needed
to build a fully-tagged accessible PDF from some real-world example documents.



On 13 Oct2019, at 3:44 PM, jfbu <jfbu at free.fr<mailto:jfbu at free.fr>> wrote:

Hi Piet,


I wonder why Murray needs this package, but my hint at \if at safe@actives babel toggle was under such circumstances misleading as it can't be applied without breaking expandability.

I of course did that without having read the numerous exchanges on tex.sx, and here, and belatedly understood crossreftools is a package providing expandable macros.

Seems Murray got it solved by David, anyway,

Best,

Jean-François


However, I found that I had made an error in my code. There was a r@{#1} that should be r@#1.

Yep. That’s a mistake that’s really easy to make.
There are contexts where {#1} and #1 do exactly the same thing; but not here.  :-)


So the code should be:
\renewcommand{\@@crtextr at ct@ref}[2]{%
  \expandafter\@@@crtextr at ct@ref\expandafter{\detokenize{#2}}{#1}%
}
\newcommand{\@@@crtextr at ct@ref}[2]{%
  \expandafter\ifx\csname r@#1\endcsname\relax
  \crt at refundefined%
  \else
  \expandafter\expandafter\csname crt at ref@splitter@#2\endcsname\csname r@#1\endcsname%
  \fi
}



---
Murray Eisenberg murrayeisenberg at gmail.com<mailto:murrayeisenberg at gmail.com>
503 King Farm Blvd #101 Home (240)-246-7240
Rockville, MD 20850-6667 Mobile (413)-427-5334



All the best.

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/20191013/5a001206/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/20191013/5a001206/attachment.png>


More information about the MacOSX-TeX mailing list