# separators in label names

19 messages
Open this post in threaded view
|

## separators in label names

 From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.:         \label{thm:law-lare-numbers}         \label{eq:prod-of-sums} For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.) I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type. The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive. Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon? I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive. (For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.) --- Murray Eisenberg [hidden email] 503 King Farm Blvd #101 Home (240)-246-7240 Rockville, MD 20850-6667 Mobile (413)-427-5334 ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 Why not an underscore? \label{thm_law-lare-numbers}But I feel the pain: Emacs + AUCTeX automatically uses a colon (by default) as a separator.—Ettore Ettore AldrovandiDepartment of Mathematics, Florida State University1017 Academic Way                *   http://www.math.fsu.edu/~ealdrovTallahassee, FL 32306-4510, USA * * aldrovandi at math dot fsu dot edu On Oct 5, 2019, at 15:24, Murray Eisenberg <[hidden email]> wrote:From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.: \label{thm:law-lare-numbers} \label{eq:prod-of-sums}For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.)I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type.The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive.Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon?I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive.(For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.)---Murray Eisenberg [hidden email]503 King Farm Blvd #101 Home (240)-246-7240Rockville, MD 20850-6667 Mobile (413)-427-5334----------- Please Consult the Following Before Posting -----------TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 In reply to this post by Murray Eisenberg Murray Eisenberg <[hidden email]> writes: > From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.: > > \label{thm:law-lare-numbers} > \label{eq:prod-of-sums} > > For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.) > > I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type. > > The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive. > > Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon? > > I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive. > > (For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.) I posted this solution on stackexchange: \edef\myoldcatcode{\the\catcode\:} \let\myoriglabel\label \def\label{\catcode\:=11 \mynewlabel} \def\mynewlabel#1{\myoriglabel{#1}\catcode\:=\myoldcatcode} -- Piet van Oostrum <[hidden email]> WWW: http://piet.vanoostrum.org/PGP key: [8DAE142BE17999C4] ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 That redefinition of \label seems not to be robust — see my comment to https://tex.stackexchange.com/a/511212/13492 .On 6 Oct2019, at 3:06 PM, Piet van Oostrum <[hidden email]> wrote:Murray Eisenberg <[hidden email]> writes:From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.: \label{thm:law-lare-numbers} \label{eq:prod-of-sums}For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.)I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type.The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive.Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon?I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive.(For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.)I posted this solution on stackexchange:\edef\myoldcatcode{\the\catcode\:}\let\myoriglabel\label\def\label{\catcode\:=11 \mynewlabel}\def\mynewlabel#1{\myoriglabel{#1}\catcode\:=\myoldcatcode}-- Piet van Oostrum <[hidden email]>WWW: http://piet.vanoostrum.org/PGP key: [8DAE142BE17999C4] ---Murray Eisenberg [hidden email]503 King Farm Blvd #101 Home (240)-246-7240Rockville, MD 20850-6667 Mobile (413)-427-5334 ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 In reply to this post by Ettore Aldrovandi Thanks for the suggestion.Alas, the underscore in labels is also not robust, causing the same error with babel-french and some macros built up from crossreftools functions.Also, even if it works, I think it would be a nightmare with TeXShop, where by default typing _ automatically inserts _{} and moves the cursor back between the pair of braces. I certainly want to preserve that behavior given my need for multi-character subscripts.On 6 Oct2019, at 1:04 PM, Ettore Aldrovandi <[hidden email]> wrote:Why not an underscore? \label{thm_law-lare-numbers}But I feel the pain: Emacs + AUCTeX automatically uses a colon (by default) as a separator.—Ettore Ettore AldrovandiDepartment of Mathematics, Florida State University1017 Academic Way                *   http://www.math.fsu.edu/~ealdrovTallahassee, FL 32306-4510, USA * * aldrovandi at math dot fsu dot edu On Oct 5, 2019, at 15:24, Murray Eisenberg <[hidden email]> wrote:From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.: \label{thm:law-lare-numbers} \label{eq:prod-of-sums}For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.)I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type.The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive.Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon?I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive.(For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.)---Murray Eisenberg [hidden email]503 King Farm Blvd #101 Home (240)-246-7240Rockville, MD 20850-6667 Mobile (413)-427-5334----------- Please Consult the Following Before Posting -----------TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex----------- Please Consult the Following Before Posting -----------TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex ---Murray Eisenberg [hidden email]503 King Farm Blvd #101 Home (240)-246-7240Rockville, MD 20850-6667 Mobile (413)-427-5334 ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 In reply to this post by Murray Eisenberg Hi again Murray, On 7 Oct 2019, at 8:27 am, Murray Eisenberg <[hidden email]> wrote: That redefinition of \label seems not to be robust — see my comment to https://tex.stackexchange.com/a/511212/13492 . I’ve read that, and see that you really don’t want to edit at 1000s of locations. In that case, you need to alter some of the macro-commands that you are using. Babel provides commands:     \bbl@deactivate   \bbl@activate to return active characters to inactive, and vice versa. So patch how you use commands like:   \MakeTextLowercase{\crtrefname{thm:main}} e.g. \makeatletter %% %%  save a pointer to the existing LaTeX command \let\LTX@MakeTextLowercase\MakeTextLowercase %% %%% IMPORTANT:  change the status of : before it is read as an argument !!! \def\myMakeTextLowercase{\bbl@deactivate:\relax \doMyMakeTextLowercase} %% %% now do the work, and set the active status back afterwards \def\doMyMakeTextLowercase #1{\LTX@MakeTextLowercase{#1}\bbl@activate:\relax} %% %% rebid the command-name to use this extra coding \let\MakeTextLowercase\myMakeTextLowercase \makeatother You can do this kind of pre-/post-processing to any command. But you’ll need to check how well it works, when the commands are hidden inside expansions of other commands. Note that the catcode change has to occur *before* the : character is read from your document source. So it may take some work to determine just which commands need to be patched. On 6 Oct2019, at 3:06 PM, Piet van Oostrum <[hidden email]> wrote: Murray Eisenberg <[hidden email]> writes: From George Grätzer’s “More Math into LaTeX” (or earlier versions of it), I adopted the convention of using as label names phrases of the form “type:description”, e.g.: \label{thm:law-lare-numbers} \label{eq:prod-of-sums} For a book, I’m using, among many other packages, babel and crossreftools. Recently I’ve discovered that the “french” option to babel gives a conflict with mnay commands from crossreftools when label names include colons. (The trouble is caused by babel-french.ldf, where the colon is made an active character along with semicolon, exclamation mark, and question mark.) I could replace those colons by hyphens, but then that destroys the visual distinction between the type of object (theorem, equation, etc.) being labeled and the description, including hyphens, of the particular object of that type. The colon was, for me, the perfect separator to use, as it nicely separates the two parts of the label names yet is not obtrusive. Do you have any recommendation for what character to use —  one that is suitable for the purposes my use of it as author yet is safe in that it is unlikely to be made active by some package and thereby cause the same clash as the colon? I considered the vertical bar “|” but am concerned that something could make it active as well as that it is somewhat obtrusive. (For reference, please see https://tex.stackexchange.com/questions/511030/another-babel-french-incompatibility-with-crossreftools and the other posts it references.) I posted this solution on stackexchange: \edef\myoldcatcode{\the\catcode\:} \let\myoriglabel\label \def\label{\catcode\:=11 \mynewlabel} \def\mynewlabel#1{\myoriglabel{#1}\catcode\:=\myoldcatcode} -- Piet van Oostrum <[hidden email]> WWW: http://piet.vanoostrum.org/ PGP key: [8DAE142BE17999C4] --- Murray Eisenberg [hidden email] 503 King Farm Blvd #101 Home (240)-246-7240 Rockville, MD 20850-6667 Mobile (413)-427-5334 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: [hidden email] http://www.maths.mq.edu.au 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. ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 In reply to this post by Murray Eisenberg Murray Eisenberg <[hidden email]> writes: > That redefinition of \label seems not to be robust — see my comment to > https://tex.stackexchange.com/a/511212/13492 . Yes, the real solution should be in crossreftools. The normal LaTeX \label command is redefined by Babel such that it works around this problem. The way that works is that in the french style colon is defined as: \active@prefix :\normal@char: \active@prefix chooses either the active definition of : or the character : depending on the value of \protect. So in some protected environments (which includes \label and \ref) : will be interpreted as just the character :. However crossreftools redefines the \label command and it seems it doesn't take these kind of precautions. So it should be amended to be compatible with Babel. -- Piet van Oostrum <[hidden email]> WWW: http://piet.vanoostrum.org/PGP key: [8DAE142BE17999C4] ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 > On Oct 7, 2019, at 10:01 AM, Piet van Oostrum <[hidden email]> wrote: > > Murray Eisenberg <[hidden email]> writes: > >> That redefinition of \label seems not to be robust — see my comment to >> https://tex.stackexchange.com/a/511212/13492 . > > Yes, the real solution should be in crossreftools. The normal LaTeX \label command is redefined by Babel such that it works around this problem. The way that works is that in the french style colon is defined as: > > \active@prefix :\normal@char: > > \active@prefix chooses either the active definition of : or the character : depending on the value of \protect. So in some protected environments (which includes \label and \ref) : will be interpreted as just the character :. > However crossreftools redefines the \label command and it seems it doesn't take these kind of precautions. So it should be amended to be compatible with Babel. > -- > Piet van Oostrum <[hidden email]> > WWW: http://piet.vanoostrum.org/> PGP key: [8DAE142BE17999C4] Howdy, How about > instead of : (at least until it gets fixed in crossreftools). Not quite as neat but it gets the meaning across. PS: sorry about this late post. I had to reset a preference on Mail to default to the account registered to the list. It appears that things I've written to the list since September 19th have been lost. Sigh... Good Luck, Herb Schulz (herbs at wideopenwest dot com) ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 In reply to this post by Murray Eisenberg There is now a solution at https://tex.stackexchange.com/a/510641/113546-- Piet van Oostrum <[hidden email]> WWW: http://piet.vanoostrum.org/PGP key: [8DAE142BE17999C4] ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 As I just commented on that tex.stackexchange answer:While that does fix the crossreftools+babel-french incompatibility for the crossreftoolscommand crtlistoflabelsthat I raised, it does not fix the incompatibility with the other commands from that package, including its redefinition of the version of \cref(from cleveref`).For example, the following generates the same error:\documentclass{article}\usepackage[french,main=english]{babel}\usepackage{amsthm}\newtheorem{thm}{Theorem}\usepackage{hyperref}\usepackage{cleveref}\usepackage{crossreftools}\begin{document}\begin{thm}\label{thm:first}A first result.\end{thm}See \cref{thm:first}.\end{document}On 11 Oct2019, at 11:11 AM, Piet van Oostrum <[hidden email]> wrote:There is now a solution at https://tex.stackexchange.com/a/510641/113546 ---Murray Eisenberg [hidden email]503 King Farm Blvd #101 Home (240)-246-7240Rockville, MD 20850-6667 Mobile (413)-427-5334 ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

 Murray Eisenberg <[hidden email]> writes: > As I just commented on that tex.stackexchange answer: > > While that does fix the crossreftools+babel-french incompatibility for the crossreftoolscommand > crtlistoflabelsthat I raised, it does not fix the incompatibility with the other commands from > that package, including its redefinition of the version of \cref(from cleveref). > > For example, the following generates the same error: [snip] Strange, I don't get an error with your example. -- Piet van Oostrum <[hidden email]> WWW: http://piet.vanoostrum.org/PGP key: [8DAE142BE17999C4] ----------- Please Consult the Following Before Posting ----------- TeX FAQ: http://www.tex.ac.uk/faqList Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/List Archives: http://dir.gmane.org/gmane.comp.tex.macosx                https://email.esm.psu.edu/pipermail/macosx-tex/TeX on Mac OS X Website: http://mactex-wiki.tug.org/List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex
Open this post in threaded view
|

## Re: separators in label names

Open this post in threaded view
|

## Re: separators in label names

Open this post in threaded view
|

## Re: separators in label names

Open this post in threaded view
|

## Re: separators in label names

Open this post in threaded view
|

## [SPAM] Re: separators in label names

Open this post in threaded view
|

## Re: separators in label names
