[OS X TeX] separators in label names

Murray Eisenberg murrayeisenberg at gmail.com
Sun Oct 13 16:50:39 EDT 2019


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.

> On 13 Oct2019, at 3:44 PM, jfbu <jfbu at free.fr> wrote:
> 
> Hi Piet,
> 
> Le 13/10/2019 à 14:21, Piet van Oostrum a écrit :
>> jfbu <jfbu at free.fr> writes:
>>> 
>>> Hi,
>>> 
>>> sorry if completely off the mark, but doesn't babel provide the
>>> 
>>> \@safe at activestrue
>>> 
>>> toggle precisely for such \csname...\endcsname expansions ?
>>> 
>>> Couldn't crossreftools in presence of babel do
>>> 
>>> \@safe at activestrue
>>> ...
>>> 
>>> \@safe at activesfalse
>>> 
>> I have tried that, but because there are all kinds of expansions going on at different times, I couldn't get it working.
> 
> It was impossible to get it working while maintaining the main aspect of crossreftools which is to provide expandable macros.
> 
> 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.
>> 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
>> }
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq <http://www.tex.ac.uk/faq>
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/ <https://sites.esm.psu.edu/~gray/tex/>
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx <http://dir.gmane.org/gmane.comp.tex.macosx>
>               https://email.esm.psu.edu/pipermail/macosx-tex/ <https://email.esm.psu.edu/pipermail/macosx-tex/>
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/ <http://mactex-wiki.tug.org/>
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex <https://email.esm.psu.edu/mailman/listinfo/macosx-tex>
---
Murray Eisenberg			murrayeisenberg at gmail.com
503 King Farm Blvd #101	Home (240)-246-7240
Rockville, MD 20850-6667	Mobile (413)-427-5334


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20191013/17f81e09/attachment.htm>


More information about the MacOSX-TeX mailing list