Cyrilic characters in label and ref in pdflatex
up vote
6
down vote
favorite
I want to write label
and ref
with Cyrillic(Russian) characters in pdflatex. usepackage[russian]{babel}
in preamble.
I tried label{detokenize{}}
, but it doesn't work.
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{Ссылка_на_раздел}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
pdftex labels ref russian
add a comment |
up vote
6
down vote
favorite
I want to write label
and ref
with Cyrillic(Russian) characters in pdflatex. usepackage[russian]{babel}
in preamble.
I tried label{detokenize{}}
, but it doesn't work.
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{Ссылка_на_раздел}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
pdftex labels ref russian
1
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
2
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.section{Ä}label{ä}ref{ä}
works for me, butsection{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.
– moewe
Dec 7 at 7:35
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I want to write label
and ref
with Cyrillic(Russian) characters in pdflatex. usepackage[russian]{babel}
in preamble.
I tried label{detokenize{}}
, but it doesn't work.
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{Ссылка_на_раздел}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
pdftex labels ref russian
I want to write label
and ref
with Cyrillic(Russian) characters in pdflatex. usepackage[russian]{babel}
in preamble.
I tried label{detokenize{}}
, but it doesn't work.
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{Ссылка_на_раздел}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
pdftex labels ref russian
pdftex labels ref russian
edited Dec 7 at 10:37
pluton
7,949960131
7,949960131
asked Dec 7 at 6:56
Shalom Alecheim
405
405
1
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
2
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.section{Ä}label{ä}ref{ä}
works for me, butsection{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.
– moewe
Dec 7 at 7:35
add a comment |
1
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
2
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.section{Ä}label{ä}ref{ä}
works for me, butsection{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.
– moewe
Dec 7 at 7:35
1
1
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
2
2
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.
section{Ä}label{ä}ref{ä}
works for me, but section{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.– moewe
Dec 7 at 7:35
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.
section{Ä}label{ä}ref{ä}
works for me, but section{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.– moewe
Dec 7 at 7:35
add a comment |
1 Answer
1
active
oldest
votes
up vote
6
down vote
accepted
It sort of works if you do a “double detokenization”:
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{detokenize{Ссылка_на_раздел}}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
What's the problem? With a single detokenize
, the label is written as is in the .aux
file, but when the .aux
file is read in, the Cyrillic characters are no longer “detokenized” and it's impossible to form control sequence names with them.
You see you can, is it worth the pain? I don't think so. On the other hand, Unicode TeX engines such as XeLaTeX and LuaLaTeX have no problem with those characters in labels.
It works as I expected, unlesshyperref
package destroys all success even it placed before or after redefinedlabel
andref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheimhyperref
does further massaging, so it's kind of expected that it doesn't work.
– egreg
Dec 7 at 12:45
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463639%2fcyrilic-characters-in-label-and-ref-in-pdflatex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
accepted
It sort of works if you do a “double detokenization”:
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{detokenize{Ссылка_на_раздел}}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
What's the problem? With a single detokenize
, the label is written as is in the .aux
file, but when the .aux
file is read in, the Cyrillic characters are no longer “detokenized” and it's impossible to form control sequence names with them.
You see you can, is it worth the pain? I don't think so. On the other hand, Unicode TeX engines such as XeLaTeX and LuaLaTeX have no problem with those characters in labels.
It works as I expected, unlesshyperref
package destroys all success even it placed before or after redefinedlabel
andref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheimhyperref
does further massaging, so it's kind of expected that it doesn't work.
– egreg
Dec 7 at 12:45
add a comment |
up vote
6
down vote
accepted
It sort of works if you do a “double detokenization”:
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{detokenize{Ссылка_на_раздел}}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
What's the problem? With a single detokenize
, the label is written as is in the .aux
file, but when the .aux
file is read in, the Cyrillic characters are no longer “detokenized” and it's impossible to form control sequence names with them.
You see you can, is it worth the pain? I don't think so. On the other hand, Unicode TeX engines such as XeLaTeX and LuaLaTeX have no problem with those characters in labels.
It works as I expected, unlesshyperref
package destroys all success even it placed before or after redefinedlabel
andref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheimhyperref
does further massaging, so it's kind of expected that it doesn't work.
– egreg
Dec 7 at 12:45
add a comment |
up vote
6
down vote
accepted
up vote
6
down vote
accepted
It sort of works if you do a “double detokenization”:
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{detokenize{Ссылка_на_раздел}}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
What's the problem? With a single detokenize
, the label is written as is in the .aux
file, but when the .aux
file is read in, the Cyrillic characters are no longer “detokenized” and it's impossible to form control sequence names with them.
You see you can, is it worth the pain? I don't think so. On the other hand, Unicode TeX engines such as XeLaTeX and LuaLaTeX have no problem with those characters in labels.
It sort of works if you do a “double detokenization”:
documentclass[a4paper,12pt]{article}
usepackage[utf8]{inputenc}
usepackage[russian]{babel}
begin{document}
section{Раздел}
label{detokenize{detokenize{Ссылка_на_раздел}}}
Русский текст ref{detokenize{Ссылка_на_раздел}}
end{document}
What's the problem? With a single detokenize
, the label is written as is in the .aux
file, but when the .aux
file is read in, the Cyrillic characters are no longer “detokenized” and it's impossible to form control sequence names with them.
You see you can, is it worth the pain? I don't think so. On the other hand, Unicode TeX engines such as XeLaTeX and LuaLaTeX have no problem with those characters in labels.
answered Dec 7 at 8:35
egreg
704k8618763155
704k8618763155
It works as I expected, unlesshyperref
package destroys all success even it placed before or after redefinedlabel
andref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheimhyperref
does further massaging, so it's kind of expected that it doesn't work.
– egreg
Dec 7 at 12:45
add a comment |
It works as I expected, unlesshyperref
package destroys all success even it placed before or after redefinedlabel
andref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheimhyperref
does further massaging, so it's kind of expected that it doesn't work.
– egreg
Dec 7 at 12:45
It works as I expected, unless
hyperref
package destroys all success even it placed before or after redefined label
and ref
– Shalom Alecheim
Dec 7 at 10:45
It works as I expected, unless
hyperref
package destroys all success even it placed before or after redefined label
and ref
– Shalom Alecheim
Dec 7 at 10:45
@ShalomAlecheim
hyperref
does further massaging, so it's kind of expected that it doesn't work.– egreg
Dec 7 at 12:45
@ShalomAlecheim
hyperref
does further massaging, so it's kind of expected that it doesn't work.– egreg
Dec 7 at 12:45
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463639%2fcyrilic-characters-in-label-and-ref-in-pdflatex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Welcome to TeX.SX! Could you please add a complete but minimal example document with your attempts?
– siracusa
Dec 7 at 7:04
2
With pdfLaTeX I would only use safe ASCII characters in labels. Sometimes certain non-ASCII characters may work by accident, but that is not at all guaranteed (e.g.
section{Ä}label{ä}ref{ä}
works for me, butsection{ß}label{ß}ref{ß}
fails spectacularly). If you want non-ASCII labels you need to use a full Unicode engine such as XeLaTeX or LuaLaTeX.– moewe
Dec 7 at 7:35