Runaway-argument error message when line break occurs inside argument of a macroHow does italic correction...
Algorithm that spans orthogonal vectors: Python
How to deal with my team leader who keeps calling me about project updates even though I am on leave for personal reasons?
Did HaShem ever command a Navi (Prophet) to break a law?
Hilbert's hotel, why can't I repeat it infinitely many times?
Figuring out the frequency components using FFT
What did the controller say during my approach to land (audio clip)?
Nanomachines exist that enable Axolotl-levels of regeneration - So how can crippling injuries exist as well?
Leaving a job that I just took based on false promise of a raise. What do I tell future interviewers?
Do the villains know Batman has no superpowers?
Is there any actual security benefit to restricting foreign IPs?
How to reference parameters outside of Apex Class that can be configured by Administrator
How do rulers get rich from war?
GitHub repo with Apache License version 2 in package.json, but no full license copy nor comment headers
Wired to Wireless Doorbell
I reverse the source code, you negate the input!
How does one calculate the distribution of the Matt Colville way of rolling stats?
What is the fastest way to do Array Table Lookup with an Integer Index?
Can Bless or Bardic Inspiration help a creature from rolling a 1 on a death save?
Do liquid propellant rocket engines experience thrust oscillation?
Why there so many pitch control surfaces on the Piaggio P180 Avanti?
What can a pilot do if an air traffic controller is incapacitated?
In a jam session, when asked which key my non-transposing instrument (like a violin) is in, what do I answer?
Can someone explain to me the parameters of a lognormal distribution?
How is the problem, {⟨G⟩|G has no triangle} in Logspace?
Runaway-argument error message when line break occurs inside argument of a macro
How does italic correction work?Use column-separator & (ampersand) inside newenvironmentPassing arguments to def inside newcommand (TikZ/PGF)Runaway argument error when creating a macro for code that works outside a macroCompiler Error when Creating a Macro/EnvironmentWhat's wrong with my newcommand?Detect duplicates csnames defined via csdefRunaway argument? with defMacro that takes any latex code as an argument
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I'm having trouble with my newcommand when I have a linebreak inside the argument, it is defined as:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
end{document}
The first call is OK, the second call gives me the Runaway argument error and the result is the following:
bbbb}{xxxx}
% ^^ up here "Runaway argument"
When I espected some thing like
macros arguments
New contributor
|
show 4 more comments
I'm having trouble with my newcommand when I have a linebreak inside the argument, it is defined as:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
end{document}
The first call is OK, the second call gives me the Runaway argument error and the result is the following:
bbbb}{xxxx}
% ^^ up here "Runaway argument"
When I espected some thing like
macros arguments
New contributor
1
textbf
forwards its argument totext@command
, which is declared as a short macro, so it can't contain apar
in its argument. You can circumvent this by usingendgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.
– Skillmon
19 hours ago
1
And welcome to TeX.SX!
– Skillmon
19 hours ago
1
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
1
@LucasT important to note is that there is a slight difference in{<fontswitch> #1}
to<textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue fortextbf
, it could fortextit
).
– Skillmon
19 hours ago
1
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text/
should be correct (it's dependent on the current font and the last symbol in#1
and might be dependent on the next symbol in the following text).
– Skillmon
18 hours ago
|
show 4 more comments
I'm having trouble with my newcommand when I have a linebreak inside the argument, it is defined as:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
end{document}
The first call is OK, the second call gives me the Runaway argument error and the result is the following:
bbbb}{xxxx}
% ^^ up here "Runaway argument"
When I espected some thing like
macros arguments
New contributor
I'm having trouble with my newcommand when I have a linebreak inside the argument, it is defined as:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
end{document}
The first call is OK, the second call gives me the Runaway argument error and the result is the following:
bbbb}{xxxx}
% ^^ up here "Runaway argument"
When I espected some thing like
macros arguments
macros arguments
New contributor
New contributor
edited 19 hours ago
Mico
305k33 gold badges421 silver badges830 bronze badges
305k33 gold badges421 silver badges830 bronze badges
New contributor
asked 19 hours ago
LucasTLucasT
312 bronze badges
312 bronze badges
New contributor
New contributor
1
textbf
forwards its argument totext@command
, which is declared as a short macro, so it can't contain apar
in its argument. You can circumvent this by usingendgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.
– Skillmon
19 hours ago
1
And welcome to TeX.SX!
– Skillmon
19 hours ago
1
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
1
@LucasT important to note is that there is a slight difference in{<fontswitch> #1}
to<textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue fortextbf
, it could fortextit
).
– Skillmon
19 hours ago
1
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text/
should be correct (it's dependent on the current font and the last symbol in#1
and might be dependent on the next symbol in the following text).
– Skillmon
18 hours ago
|
show 4 more comments
1
textbf
forwards its argument totext@command
, which is declared as a short macro, so it can't contain apar
in its argument. You can circumvent this by usingendgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.
– Skillmon
19 hours ago
1
And welcome to TeX.SX!
– Skillmon
19 hours ago
1
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
1
@LucasT important to note is that there is a slight difference in{<fontswitch> #1}
to<textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue fortextbf
, it could fortextit
).
– Skillmon
19 hours ago
1
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text/
should be correct (it's dependent on the current font and the last symbol in#1
and might be dependent on the next symbol in the following text).
– Skillmon
18 hours ago
1
1
textbf
forwards its argument to text@command
, which is declared as a short macro, so it can't contain a par
in its argument. You can circumvent this by using endgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.– Skillmon
19 hours ago
textbf
forwards its argument to text@command
, which is declared as a short macro, so it can't contain a par
in its argument. You can circumvent this by using endgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.– Skillmon
19 hours ago
1
1
And welcome to TeX.SX!
– Skillmon
19 hours ago
And welcome to TeX.SX!
– Skillmon
19 hours ago
1
1
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
1
1
@LucasT important to note is that there is a slight difference in
{<fontswitch> #1}
to <textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue for textbf
, it could for textit
).– Skillmon
19 hours ago
@LucasT important to note is that there is a slight difference in
{<fontswitch> #1}
to <textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue for textbf
, it could for textit
).– Skillmon
19 hours ago
1
1
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text
/
should be correct (it's dependent on the current font and the last symbol in #1
and might be dependent on the next symbol in the following text).– Skillmon
18 hours ago
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text
/
should be correct (it's dependent on the current font and the last symbol in #1
and might be dependent on the next symbol in the following text).– Skillmon
18 hours ago
|
show 4 more comments
2 Answers
2
active
oldest
votes
As suggested in comments, textbf
is designed for short things --- not paragraphs. You can just change to a font-selection command:
documentclass{report}
newcommand{noblablabla}[2]{{bfseries #1/}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
% no more "Runaway argument"
end{document}
...look carefully at the {
placement ;-).
The /
will perform italic correction if necessary (shouldn't be necessary with a bold typeface, but it is font-dependent); thanks to @Skillmon for pointing it out.
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
add a comment
|
When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter endlinechar
, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token par
which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
par
is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives likedef
oredef
orgdef
orxdef
, you need to add the prefixlong
to the definition-primitive in use. - Macros where the token
par
is not allowed in the arguments. Many people call them "short macros" because when defining them you omit thelong
-prefix. When an argument of a short macro contains the tokenpar
, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
textbf
is defined to call such a such a "short" macro whose name is text@command
, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token par
within the argument and instead having, e.g., the token sequence csname parendcsname
in the argument, or the token myparcopy
after letmyparcopy=par
:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaacsname parendcsname bbbb}{xxxx}
end{document}
documentclass{report}
newcommandmyparcopy{}letmyparcopy=par
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaamyparcopy bbbb}{xxxx}
end{document}
LaTeX and Plain already have amyparcopy
under the nameendgraf
– Phelype Oleinik
3 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/4.0/"u003ecc by-sa 4.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
});
}
});
LucasT 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%2f508773%2frunaway-argument-error-message-when-line-break-occurs-inside-argument-of-a-macro%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
As suggested in comments, textbf
is designed for short things --- not paragraphs. You can just change to a font-selection command:
documentclass{report}
newcommand{noblablabla}[2]{{bfseries #1/}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
% no more "Runaway argument"
end{document}
...look carefully at the {
placement ;-).
The /
will perform italic correction if necessary (shouldn't be necessary with a bold typeface, but it is font-dependent); thanks to @Skillmon for pointing it out.
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
add a comment
|
As suggested in comments, textbf
is designed for short things --- not paragraphs. You can just change to a font-selection command:
documentclass{report}
newcommand{noblablabla}[2]{{bfseries #1/}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
% no more "Runaway argument"
end{document}
...look carefully at the {
placement ;-).
The /
will perform italic correction if necessary (shouldn't be necessary with a bold typeface, but it is font-dependent); thanks to @Skillmon for pointing it out.
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
add a comment
|
As suggested in comments, textbf
is designed for short things --- not paragraphs. You can just change to a font-selection command:
documentclass{report}
newcommand{noblablabla}[2]{{bfseries #1/}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
% no more "Runaway argument"
end{document}
...look carefully at the {
placement ;-).
The /
will perform italic correction if necessary (shouldn't be necessary with a bold typeface, but it is font-dependent); thanks to @Skillmon for pointing it out.
As suggested in comments, textbf
is designed for short things --- not paragraphs. You can just change to a font-selection command:
documentclass{report}
newcommand{noblablabla}[2]{{bfseries #1/}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaa
bbbb}{xxxx}
% no more "Runaway argument"
end{document}
...look carefully at the {
placement ;-).
The /
will perform italic correction if necessary (shouldn't be necessary with a bold typeface, but it is font-dependent); thanks to @Skillmon for pointing it out.
edited 16 hours ago
answered 19 hours ago
RmanoRmano
10.5k2 gold badges18 silver badges57 bronze badges
10.5k2 gold badges18 silver badges57 bronze badges
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
add a comment
|
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
@Mico sorry, I posted the answer before seeing your comment...
– Rmano
19 hours ago
1
1
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
No worries! Anyway, providing a standalone answer is considered better form anyway.
– Mico
19 hours ago
add a comment
|
When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter endlinechar
, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token par
which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
par
is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives likedef
oredef
orgdef
orxdef
, you need to add the prefixlong
to the definition-primitive in use. - Macros where the token
par
is not allowed in the arguments. Many people call them "short macros" because when defining them you omit thelong
-prefix. When an argument of a short macro contains the tokenpar
, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
textbf
is defined to call such a such a "short" macro whose name is text@command
, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token par
within the argument and instead having, e.g., the token sequence csname parendcsname
in the argument, or the token myparcopy
after letmyparcopy=par
:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaacsname parendcsname bbbb}{xxxx}
end{document}
documentclass{report}
newcommandmyparcopy{}letmyparcopy=par
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaamyparcopy bbbb}{xxxx}
end{document}
LaTeX and Plain already have amyparcopy
under the nameendgraf
– Phelype Oleinik
3 hours ago
add a comment
|
When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter endlinechar
, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token par
which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
par
is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives likedef
oredef
orgdef
orxdef
, you need to add the prefixlong
to the definition-primitive in use. - Macros where the token
par
is not allowed in the arguments. Many people call them "short macros" because when defining them you omit thelong
-prefix. When an argument of a short macro contains the tokenpar
, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
textbf
is defined to call such a such a "short" macro whose name is text@command
, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token par
within the argument and instead having, e.g., the token sequence csname parendcsname
in the argument, or the token myparcopy
after letmyparcopy=par
:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaacsname parendcsname bbbb}{xxxx}
end{document}
documentclass{report}
newcommandmyparcopy{}letmyparcopy=par
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaamyparcopy bbbb}{xxxx}
end{document}
LaTeX and Plain already have amyparcopy
under the nameendgraf
– Phelype Oleinik
3 hours ago
add a comment
|
When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter endlinechar
, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token par
which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
par
is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives likedef
oredef
orgdef
orxdef
, you need to add the prefixlong
to the definition-primitive in use. - Macros where the token
par
is not allowed in the arguments. Many people call them "short macros" because when defining them you omit thelong
-prefix. When an argument of a short macro contains the tokenpar
, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
textbf
is defined to call such a such a "short" macro whose name is text@command
, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token par
within the argument and instead having, e.g., the token sequence csname parendcsname
in the argument, or the token myparcopy
after letmyparcopy=par
:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaacsname parendcsname bbbb}{xxxx}
end{document}
documentclass{report}
newcommandmyparcopy{}letmyparcopy=par
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaamyparcopy bbbb}{xxxx}
end{document}
When (La)TeX reads and tokenizes input under standard catcode-régime with standard-value for the integer-parameter endlinechar
, two consecutive endline-characters—in the .tex-input file they yield an empty line—get tokenized as the token par
which usually serves for ending the current paragraph (and having (La)TeX start a new paragraph in case material which triggers switching to horizontal mode follows).
In (La)TeX macros come in two flavours:
- Macros where the token
par
is allowed in the arguments. These are so-called "long macros" because when you wish to define such a macro by means of TeX primitives likedef
oredef
orgdef
orxdef
, you need to add the prefixlong
to the definition-primitive in use. - Macros where the token
par
is not allowed in the arguments. Many people call them "short macros" because when defining them you omit thelong
-prefix. When an argument of a short macro contains the tokenpar
, then you get an error-message about "Runaway argument?... Paragraph ended before ... was complete".
textbf
is defined to call such a such a "short" macro whose name is text@command
, and to pass its argument as argument to that macro. Therefore the error message. You can easily circumvent that message by not having the token par
within the argument and instead having, e.g., the token sequence csname parendcsname
in the argument, or the token myparcopy
after letmyparcopy=par
:
documentclass{report}
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaacsname parendcsname bbbb}{xxxx}
end{document}
documentclass{report}
newcommandmyparcopy{}letmyparcopy=par
newcommand{noblablabla}[2]{textbf{#1}-#2}
begin{document}
noblablabla{aaaabbbb}{xxxx} % this is OK
noblablabla{aaaamyparcopy bbbb}{xxxx}
end{document}
edited 3 hours ago
answered 4 hours ago
Ulrich DiezUlrich Diez
7,1896 silver badges23 bronze badges
7,1896 silver badges23 bronze badges
LaTeX and Plain already have amyparcopy
under the nameendgraf
– Phelype Oleinik
3 hours ago
add a comment
|
LaTeX and Plain already have amyparcopy
under the nameendgraf
– Phelype Oleinik
3 hours ago
LaTeX and Plain already have a
myparcopy
under the name endgraf
– Phelype Oleinik
3 hours ago
LaTeX and Plain already have a
myparcopy
under the name endgraf
– Phelype Oleinik
3 hours ago
add a comment
|
LucasT is a new contributor. Be nice, and check out our Code of Conduct.
LucasT is a new contributor. Be nice, and check out our Code of Conduct.
LucasT is a new contributor. Be nice, and check out our Code of Conduct.
LucasT 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%2f508773%2frunaway-argument-error-message-when-line-break-occurs-inside-argument-of-a-macro%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
textbf
forwards its argument totext@command
, which is declared as a short macro, so it can't contain apar
in its argument. You can circumvent this by usingendgraf
instead of the two consecutive newlines, but I don't think it is a good idea and you should change your macro if you want to have a newline there.– Skillmon
19 hours ago
1
And welcome to TeX.SX!
– Skillmon
19 hours ago
1
Thanks Skillmon, kind of you. I am not used to 'low level' tricks like you are commenting. How should I change my macro to get the right result? Can you gime some directions to undestand its limitations? How can I start to study it?
– LucasT
19 hours ago
1
@LucasT important to note is that there is a slight difference in
{<fontswitch> #1}
to<textcommand>{#1}
, the former doesn't apply any italic correction whereas the latter would (though this shouldn't be an issue fortextbf
, it could fortextit
).– Skillmon
19 hours ago
1
@Rmano LaTeX goes to some length to apply it correctly (and I don't know the entire code it runs to determine the italic correction), but with normal text
/
should be correct (it's dependent on the current font and the last symbol in#1
and might be dependent on the next symbol in the following text).– Skillmon
18 hours ago