Writing Cyrillic text to a file
could you explain, what is going on?
I am using the latest MiKTeX 2.9.6960 64-bit version (installed just yesterday).
I am trying to write some Cyrillic text to the separate file without using inputenc package:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
But LaTeX does not tell me that there is something wrong with encoding, but instead of this it tells me that some its internal commands are undefined. Here is a part of the corresponding log-file:
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
endgroup
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
and so on.
Is it a bug or what is going on?
Thank for your answers.
errors auxiliary-files cyrillic
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
could you explain, what is going on?
I am using the latest MiKTeX 2.9.6960 64-bit version (installed just yesterday).
I am trying to write some Cyrillic text to the separate file without using inputenc package:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
But LaTeX does not tell me that there is something wrong with encoding, but instead of this it tells me that some its internal commands are undefined. Here is a part of the corresponding log-file:
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
endgroup
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
and so on.
Is it a bug or what is going on?
Thank for your answers.
errors auxiliary-files cyrillic
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like thedetokenizeapproach David just posted, thefilecontentsenvironment, or theverbwritecommand I created here.
– Phelype Oleinik
9 hours ago
add a comment |
could you explain, what is going on?
I am using the latest MiKTeX 2.9.6960 64-bit version (installed just yesterday).
I am trying to write some Cyrillic text to the separate file without using inputenc package:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
But LaTeX does not tell me that there is something wrong with encoding, but instead of this it tells me that some its internal commands are undefined. Here is a part of the corresponding log-file:
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
endgroup
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
and so on.
Is it a bug or what is going on?
Thank for your answers.
errors auxiliary-files cyrillic
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
could you explain, what is going on?
I am using the latest MiKTeX 2.9.6960 64-bit version (installed just yesterday).
I am trying to write some Cyrillic text to the separate file without using inputenc package:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
But LaTeX does not tell me that there is something wrong with encoding, but instead of this it tells me that some its internal commands are undefined. Here is a part of the corresponding log-file:
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
endgroup
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
#4 errhelp @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
let @err@ ...
l.9 immediatewritetestwrite{Ббббббббббббб}
?
! Undefined control sequence.
GenericError ...
@empty def MessageBreak...
l.9 immediatewritetestwrite{Ббббббббббббб}
and so on.
Is it a bug or what is going on?
Thank for your answers.
errors auxiliary-files cyrillic
errors auxiliary-files cyrillic
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 9 hours ago
David Carlisle
492k4111371885
492k4111371885
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 9 hours ago
Andrei MalokostovAndrei Malokostov
111
111
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Andrei Malokostov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like thedetokenizeapproach David just posted, thefilecontentsenvironment, or theverbwritecommand I created here.
– Phelype Oleinik
9 hours ago
add a comment |
1
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like thedetokenizeapproach David just posted, thefilecontentsenvironment, or theverbwritecommand I created here.
– Phelype Oleinik
9 hours ago
1
1
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like the
detokenize approach David just posted, the filecontents environment, or the verbwrite command I created here.– Phelype Oleinik
9 hours ago
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like the
detokenize approach David just posted, the filecontents environment, or the verbwrite command I created here.– Phelype Oleinik
9 hours ago
add a comment |
2 Answers
2
active
oldest
votes
The active characters are set up to expand to typesetting instructions (or to error messages saying that the character is not set up) you just want to write the text verbatim so:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{detokenize{Ббббббббббббб}}
immediatecloseouttestwrite
end{document}
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using awritecommand, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message usemakeatletter immediateprotected@write{...}.
– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
add a comment |
If you don't want to use inputenc, add UseRawInputEncoding
UseRawInputEncoding
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
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',
autoActivateHeartbeat: false,
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
});
}
});
Andrei Malokostov is a new contributor. Be nice, and check out our Code of Conduct.
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%2f477164%2fwriting-cyrillic-text-to-a-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The active characters are set up to expand to typesetting instructions (or to error messages saying that the character is not set up) you just want to write the text verbatim so:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{detokenize{Ббббббббббббб}}
immediatecloseouttestwrite
end{document}
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using awritecommand, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message usemakeatletter immediateprotected@write{...}.
– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
add a comment |
The active characters are set up to expand to typesetting instructions (or to error messages saying that the character is not set up) you just want to write the text verbatim so:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{detokenize{Ббббббббббббб}}
immediatecloseouttestwrite
end{document}
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using awritecommand, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message usemakeatletter immediateprotected@write{...}.
– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
add a comment |
The active characters are set up to expand to typesetting instructions (or to error messages saying that the character is not set up) you just want to write the text verbatim so:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{detokenize{Ббббббббббббб}}
immediatecloseouttestwrite
end{document}
The active characters are set up to expand to typesetting instructions (or to error messages saying that the character is not set up) you just want to write the text verbatim so:
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{detokenize{Ббббббббббббб}}
immediatecloseouttestwrite
end{document}
answered 9 hours ago
David CarlisleDavid Carlisle
492k4111371885
492k4111371885
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using awritecommand, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message usemakeatletter immediateprotected@write{...}.
– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
add a comment |
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using awritecommand, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message usemakeatletter immediateprotected@write{...}.
– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
Thank you so much, but as already I wrote below to Ulrike Fischer, my question was "Why LateX letts me that some its internal commands which are absolutely not related to my code are undefined". If I write Cyrillic text as a text, LaTeX tells me that Cyrillic letters have wrong Unicode codes. But if the Cyrillic text is inside write{...}, Latex tells me that GenericError command or some other comands inside it are undefined.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov you are using a
write command, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message use makeatletter immediateprotected@write{...}.– Ulrike Fischer
6 hours ago
@AndreiMalokostov you are using a
write command, which expands its argument completly without any precautions. It is easy to get such error messages with it if you put commands in its argument. If you want a better error message use makeatletter immediateprotected@write{...}.– Ulrike Fischer
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
OK, thank you so much. I thought from my 25+ year experience that TeX (and LateX also) have very good system of error messages, and these messages are quite informative. So I was very confused to get such strange (from my point of view) messages. But if you suppose that it is all OK with them, I will trust you. But in any case I would prefer to obtain from LateX something like "If all else fails, read the instructions" :-) In any case thank you so much for you answers and for your attention.
– Andrei Malokostov
6 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
@AndreiMalokostov unfortunately the error occurs while tex is writing the file and it really can't stop and make a sensible latex-specified error at that point if it fails it just fails with some more or less spurious low level error.
– David Carlisle
5 hours ago
add a comment |
If you don't want to use inputenc, add UseRawInputEncoding
UseRawInputEncoding
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
add a comment |
If you don't want to use inputenc, add UseRawInputEncoding
UseRawInputEncoding
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
add a comment |
If you don't want to use inputenc, add UseRawInputEncoding
UseRawInputEncoding
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
If you don't want to use inputenc, add UseRawInputEncoding
UseRawInputEncoding
documentclass{article}
begin{document}
newwritetestwrite
immediateopenouttestwrite=testwrite.txt
immediatewritetestwrite{Ббббббббббббб}
immediatecloseouttestwrite
end{document}
answered 9 hours ago
Ulrike FischerUlrike Fischer
193k8302687
193k8302687
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
add a comment |
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
Thank you so much, and thank you for your recommendations. But my question is NOT about "How to avoid such error messages", but "Why LaTeX responda in such a way and why it tells me that GenericError command (or some other command inside the definition of GenericError) are undefined?". I know other ways to avoid such error messages. For example I can declare newtoksBbbbtoks, assign Bbbbtoks={Ббббббб} and then use the command writetestwrite{theBbbbtoks}, this works well. But I would like to get an answer to my second question.
– Andrei Malokostov
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
If you are interested in the processing of the active chars (Б and б are now active and so commands) then I would suggest that you add tracingmacros=1 and then look in the log file. If you want to know why they are active you could read this latex news letter: latex-project.org/news/latex2e-news/ltnews28.pdf
– Ulrike Fischer
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
OK, thank you so much. I will try to use tracingmacros=1 understand, how commands like "Б" or "б" are transformed to the error messages of the type ! Undefined control sequence. GenericError ... let @err@ ...
– Andrei Malokostov
6 hours ago
add a comment |
Andrei Malokostov is a new contributor. Be nice, and check out our Code of Conduct.
Andrei Malokostov is a new contributor. Be nice, and check out our Code of Conduct.
Andrei Malokostov is a new contributor. Be nice, and check out our Code of Conduct.
Andrei Malokostov is a new contributor. Be nice, and check out our Code of Conduct.
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.
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%2f477164%2fwriting-cyrillic-text-to-a-file%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
I suppose you are using pdfTeX, in which case Cyrillic characters aren't plain characters, but active ones. TeX expands characters when writing to a file, but you haven't declared any encoding for them. You'd have to use some verbatim approach to avoid the expansion of these characters, like the
detokenizeapproach David just posted, thefilecontentsenvironment, or theverbwritecommand I created here.– Phelype Oleinik
9 hours ago