xstring fails to compare text containing \choose from a list with xstringxstring macros inside foreachxstring substitution with font commands fails in errorincludegraphics and xstring packageUsing xstring with translatorXstring Problem with ŞLaTeX xstring StrCut with macrosCompare etocname with stringspecial charactor handling in xstringProblem with xstring: IfEqCase case falls thru
Can non-English-speaking characters use wordplay specific to English?
Do firearms count as ranged weapons?
How feasible is the Delta-Glider?
Yandex Programming Contest: Alarms
Modern approach to radio buttons
What is the most important source of natural gas? coal, oil or other?
A Mathematical Discussion: Fill in the Blank
What caused the tendency for conservatives to not support climate change reform?
How to capture more stars?
Why do Russians call their women expensive ("дорогая")?
Is there an explanation for Austria's Freedom Party virtually retaining its vote share despite recent scandal?
How were these pictures of spacecraft wind tunnel testing taken?
How do I subvert the tropes of a train heist?
Crossword gone overboard
Smart people send dumb people to a new planet on a space craft that crashes into a body of water
What F1 in name of seeds/varieties means?
How current works
Is this story about US tax office reasonable?
Terminology about G- simplicial complexes
How can I prevent interns from being expendable?
What does it mean when you think without speaking?
What is the best linguistic term for describing the kw > p / gw > b change, and its usual companion s > h
Is it possible to change original filename of an exe?
Leading and Suffering Numbers
xstring fails to compare text containing \
choose from a list with xstringxstring macros inside foreachxstring substitution with font commands fails in errorincludegraphics and xstring packageUsing xstring with translatorXstring Problem with ŞLaTeX xstring StrCut with macrosCompare etocname with stringspecial charactor handling in xstringProblem with xstring: IfEqCase case falls thru
Using xstring in order to compare text containing \
produces a compilation error. Here is my MWE:
documentclassreport
usepackagexstring
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
IfStrEqprintExample
void
printExample
endtitlepage
begindocument
enddocument
The first error message is:
! Undefined control sequence.
->let reserved@e
relax let reserved@f relax @ifstar {let reserv...
l.15 begindocument
The Example
command defined here should accept \
. How can I get this working? The solution should take into account that the (La)TeX distribution version used here is the one included in Linux Mint 18.3, i.e. TeX Live 2017/Debian, which cannot be changed.
xstring
add a comment |
Using xstring in order to compare text containing \
produces a compilation error. Here is my MWE:
documentclassreport
usepackagexstring
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
IfStrEqprintExample
void
printExample
endtitlepage
begindocument
enddocument
The first error message is:
! Undefined control sequence.
->let reserved@e
relax let reserved@f relax @ifstar {let reserv...
l.15 begindocument
The Example
command defined here should accept \
. How can I get this working? The solution should take into account that the (La)TeX distribution version used here is the one included in Linux Mint 18.3, i.e. TeX Live 2017/Debian, which cannot be changed.
xstring
What is the expected output. You could try usingnoexpandarg
, but I am not sure what the code is supposed to do.
– Peter Grill
May 22 at 9:23
If you are just testing whether a macro is empty or not, then the void tests frometoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.
– daleif
May 22 at 9:52
1
It works withxifthen
using this test:ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
Various tests frometoolbox
(ifdefvoid
,ifstrempty
orifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Commandifthenelse
fromxifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why\
breaksIfStrEq
and if there is a way (or not) to use it?
– Jérôme Champavère
May 22 at 19:52
I addedcentering
in environmenttitlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) whenifthenelse
test is used. An other error is raised withcenter
environment (! Use of @item doesn't match its definition.). In both cases, one needs to useprotect\
in order to get it working as expected.
– Jérôme Champavère
May 22 at 20:32
add a comment |
Using xstring in order to compare text containing \
produces a compilation error. Here is my MWE:
documentclassreport
usepackagexstring
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
IfStrEqprintExample
void
printExample
endtitlepage
begindocument
enddocument
The first error message is:
! Undefined control sequence.
->let reserved@e
relax let reserved@f relax @ifstar {let reserv...
l.15 begindocument
The Example
command defined here should accept \
. How can I get this working? The solution should take into account that the (La)TeX distribution version used here is the one included in Linux Mint 18.3, i.e. TeX Live 2017/Debian, which cannot be changed.
xstring
Using xstring in order to compare text containing \
produces a compilation error. Here is my MWE:
documentclassreport
usepackagexstring
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
IfStrEqprintExample
void
printExample
endtitlepage
begindocument
enddocument
The first error message is:
! Undefined control sequence.
->let reserved@e
relax let reserved@f relax @ifstar {let reserv...
l.15 begindocument
The Example
command defined here should accept \
. How can I get this working? The solution should take into account that the (La)TeX distribution version used here is the one included in Linux Mint 18.3, i.e. TeX Live 2017/Debian, which cannot be changed.
xstring
xstring
edited May 22 at 20:22
Jérôme Champavère
asked May 22 at 9:16
Jérôme ChampavèreJérôme Champavère
535
535
What is the expected output. You could try usingnoexpandarg
, but I am not sure what the code is supposed to do.
– Peter Grill
May 22 at 9:23
If you are just testing whether a macro is empty or not, then the void tests frometoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.
– daleif
May 22 at 9:52
1
It works withxifthen
using this test:ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
Various tests frometoolbox
(ifdefvoid
,ifstrempty
orifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Commandifthenelse
fromxifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why\
breaksIfStrEq
and if there is a way (or not) to use it?
– Jérôme Champavère
May 22 at 19:52
I addedcentering
in environmenttitlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) whenifthenelse
test is used. An other error is raised withcenter
environment (! Use of @item doesn't match its definition.). In both cases, one needs to useprotect\
in order to get it working as expected.
– Jérôme Champavère
May 22 at 20:32
add a comment |
What is the expected output. You could try usingnoexpandarg
, but I am not sure what the code is supposed to do.
– Peter Grill
May 22 at 9:23
If you are just testing whether a macro is empty or not, then the void tests frometoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.
– daleif
May 22 at 9:52
1
It works withxifthen
using this test:ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
Various tests frometoolbox
(ifdefvoid
,ifstrempty
orifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Commandifthenelse
fromxifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why\
breaksIfStrEq
and if there is a way (or not) to use it?
– Jérôme Champavère
May 22 at 19:52
I addedcentering
in environmenttitlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) whenifthenelse
test is used. An other error is raised withcenter
environment (! Use of @item doesn't match its definition.). In both cases, one needs to useprotect\
in order to get it working as expected.
– Jérôme Champavère
May 22 at 20:32
What is the expected output. You could try using
noexpandarg
, but I am not sure what the code is supposed to do.– Peter Grill
May 22 at 9:23
What is the expected output. You could try using
noexpandarg
, but I am not sure what the code is supposed to do.– Peter Grill
May 22 at 9:23
If you are just testing whether a macro is empty or not, then the void tests from
etoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.– daleif
May 22 at 9:52
If you are just testing whether a macro is empty or not, then the void tests from
etoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.– daleif
May 22 at 9:52
1
1
It works with
xifthen
using this test: ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
It works with
xifthen
using this test: ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
Various tests from
etoolbox
(ifdefvoid
, ifstrempty
or ifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Command ifthenelse
from xifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why \
breaks IfStrEq
and if there is a way (or not) to use it?– Jérôme Champavère
May 22 at 19:52
Various tests from
etoolbox
(ifdefvoid
, ifstrempty
or ifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Command ifthenelse
from xifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why \
breaks IfStrEq
and if there is a way (or not) to use it?– Jérôme Champavère
May 22 at 19:52
I added
centering
in environment titlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) when ifthenelse
test is used. An other error is raised with center
environment (! Use of @item doesn't match its definition.). In both cases, one needs to use protect\
in order to get it working as expected.– Jérôme Champavère
May 22 at 20:32
I added
centering
in environment titlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) when ifthenelse
test is used. An other error is raised with center
environment (! Use of @item doesn't match its definition.). In both cases, one needs to use protect\
in order to get it working as expected.– Jérôme Champavère
May 22 at 20:32
add a comment |
2 Answers
2
active
oldest
votes
If you need only a test for an empty argument you can use ifx
:
documentclassreport
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Example
AtBeginDocument%
begintitlepage
expandafterifxprintExampleempty
voidelseprintExamplefi
endtitlepage
begindocument
Examplenot \ void
expandafterifxprintExampleempty
voidelseprintExamplefi
enddocument
This might be an option. Is it possible to write a 3-parameter command, e.g.ifstringempty
, from theexpandafter
tofi
code, where #1 would be the tested string command (hereprintExample
), #2 for true (here "void"), and #3 for false (here the secondprintExample
), in order to simplify the code? I triednewcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.
– Jérôme Champavère
May 22 at 21:01
add a comment |
I guess you have other macros such as Example
and printExample
.
You can define a macro that does the work getting as input the desired storage bin.
documentclassreport
makeatletter
newcommandvoid@or@print[1]%
ifrelaxdetokenizeexpandafter#1relax
void%
else
#1%
fi
defprintExamplevoid@or@print@Example
defExample#1def@Example#1
Example % initialize
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
printExample
endtitlepage
begindocument
enddocument
A more general implementation:
makeatletter
newcommandprint@conditionally[3]%
ifrelaxdetokenizeexpandafter#1relax
expandafter@firstoftwo
else
expandafter@secondoftwo
fi
#2#3%
defprintExampleprint@conditionally@Examplevoid@Example
defExample#1def@Example#1
Example % initialize
makeatother
Yes, there are few other macros asExample
, that should be filled by the template's user (whileprintExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.
– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
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
);
);
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%2f492069%2fxstring-fails-to-compare-text-containing%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
If you need only a test for an empty argument you can use ifx
:
documentclassreport
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Example
AtBeginDocument%
begintitlepage
expandafterifxprintExampleempty
voidelseprintExamplefi
endtitlepage
begindocument
Examplenot \ void
expandafterifxprintExampleempty
voidelseprintExamplefi
enddocument
This might be an option. Is it possible to write a 3-parameter command, e.g.ifstringempty
, from theexpandafter
tofi
code, where #1 would be the tested string command (hereprintExample
), #2 for true (here "void"), and #3 for false (here the secondprintExample
), in order to simplify the code? I triednewcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.
– Jérôme Champavère
May 22 at 21:01
add a comment |
If you need only a test for an empty argument you can use ifx
:
documentclassreport
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Example
AtBeginDocument%
begintitlepage
expandafterifxprintExampleempty
voidelseprintExamplefi
endtitlepage
begindocument
Examplenot \ void
expandafterifxprintExampleempty
voidelseprintExamplefi
enddocument
This might be an option. Is it possible to write a 3-parameter command, e.g.ifstringempty
, from theexpandafter
tofi
code, where #1 would be the tested string command (hereprintExample
), #2 for true (here "void"), and #3 for false (here the secondprintExample
), in order to simplify the code? I triednewcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.
– Jérôme Champavère
May 22 at 21:01
add a comment |
If you need only a test for an empty argument you can use ifx
:
documentclassreport
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Example
AtBeginDocument%
begintitlepage
expandafterifxprintExampleempty
voidelseprintExamplefi
endtitlepage
begindocument
Examplenot \ void
expandafterifxprintExampleempty
voidelseprintExamplefi
enddocument
If you need only a test for an empty argument you can use ifx
:
documentclassreport
makeatletter
defExample#1def@Example#1
defprintExample@Example
makeatother
Example
AtBeginDocument%
begintitlepage
expandafterifxprintExampleempty
voidelseprintExamplefi
endtitlepage
begindocument
Examplenot \ void
expandafterifxprintExampleempty
voidelseprintExamplefi
enddocument
answered May 22 at 9:58
Red-CloudRed-Cloud
2,973114
2,973114
This might be an option. Is it possible to write a 3-parameter command, e.g.ifstringempty
, from theexpandafter
tofi
code, where #1 would be the tested string command (hereprintExample
), #2 for true (here "void"), and #3 for false (here the secondprintExample
), in order to simplify the code? I triednewcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.
– Jérôme Champavère
May 22 at 21:01
add a comment |
This might be an option. Is it possible to write a 3-parameter command, e.g.ifstringempty
, from theexpandafter
tofi
code, where #1 would be the tested string command (hereprintExample
), #2 for true (here "void"), and #3 for false (here the secondprintExample
), in order to simplify the code? I triednewcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.
– Jérôme Champavère
May 22 at 21:01
This might be an option. Is it possible to write a 3-parameter command, e.g.
ifstringempty
, from the expandafter
to fi
code, where #1 would be the tested string command (here printExample
), #2 for true (here "void"), and #3 for false (here the second printExample
), in order to simplify the code? I tried newcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.– Jérôme Champavère
May 22 at 21:01
This might be an option. Is it possible to write a 3-parameter command, e.g.
ifstringempty
, from the expandafter
to fi
code, where #1 would be the tested string command (here printExample
), #2 for true (here "void"), and #3 for false (here the second printExample
), in order to simplify the code? I tried newcommandifstringempty[3]expandafterifx#1empty #2else#3fi
, without success.– Jérôme Champavère
May 22 at 21:01
add a comment |
I guess you have other macros such as Example
and printExample
.
You can define a macro that does the work getting as input the desired storage bin.
documentclassreport
makeatletter
newcommandvoid@or@print[1]%
ifrelaxdetokenizeexpandafter#1relax
void%
else
#1%
fi
defprintExamplevoid@or@print@Example
defExample#1def@Example#1
Example % initialize
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
printExample
endtitlepage
begindocument
enddocument
A more general implementation:
makeatletter
newcommandprint@conditionally[3]%
ifrelaxdetokenizeexpandafter#1relax
expandafter@firstoftwo
else
expandafter@secondoftwo
fi
#2#3%
defprintExampleprint@conditionally@Examplevoid@Example
defExample#1def@Example#1
Example % initialize
makeatother
Yes, there are few other macros asExample
, that should be filled by the template's user (whileprintExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.
– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
add a comment |
I guess you have other macros such as Example
and printExample
.
You can define a macro that does the work getting as input the desired storage bin.
documentclassreport
makeatletter
newcommandvoid@or@print[1]%
ifrelaxdetokenizeexpandafter#1relax
void%
else
#1%
fi
defprintExamplevoid@or@print@Example
defExample#1def@Example#1
Example % initialize
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
printExample
endtitlepage
begindocument
enddocument
A more general implementation:
makeatletter
newcommandprint@conditionally[3]%
ifrelaxdetokenizeexpandafter#1relax
expandafter@firstoftwo
else
expandafter@secondoftwo
fi
#2#3%
defprintExampleprint@conditionally@Examplevoid@Example
defExample#1def@Example#1
Example % initialize
makeatother
Yes, there are few other macros asExample
, that should be filled by the template's user (whileprintExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.
– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
add a comment |
I guess you have other macros such as Example
and printExample
.
You can define a macro that does the work getting as input the desired storage bin.
documentclassreport
makeatletter
newcommandvoid@or@print[1]%
ifrelaxdetokenizeexpandafter#1relax
void%
else
#1%
fi
defprintExamplevoid@or@print@Example
defExample#1def@Example#1
Example % initialize
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
printExample
endtitlepage
begindocument
enddocument
A more general implementation:
makeatletter
newcommandprint@conditionally[3]%
ifrelaxdetokenizeexpandafter#1relax
expandafter@firstoftwo
else
expandafter@secondoftwo
fi
#2#3%
defprintExampleprint@conditionally@Examplevoid@Example
defExample#1def@Example#1
Example % initialize
makeatother
I guess you have other macros such as Example
and printExample
.
You can define a macro that does the work getting as input the desired storage bin.
documentclassreport
makeatletter
newcommandvoid@or@print[1]%
ifrelaxdetokenizeexpandafter#1relax
void%
else
#1%
fi
defprintExamplevoid@or@print@Example
defExample#1def@Example#1
Example % initialize
makeatother
Examplenot \ void
AtBeginDocument
begintitlepage
centering
printExample
endtitlepage
begindocument
enddocument
A more general implementation:
makeatletter
newcommandprint@conditionally[3]%
ifrelaxdetokenizeexpandafter#1relax
expandafter@firstoftwo
else
expandafter@secondoftwo
fi
#2#3%
defprintExampleprint@conditionally@Examplevoid@Example
defExample#1def@Example#1
Example % initialize
makeatother
edited May 23 at 10:57
answered May 22 at 21:14
egregegreg
744k8919493287
744k8919493287
Yes, there are few other macros asExample
, that should be filled by the template's user (whileprintExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.
– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
add a comment |
Yes, there are few other macros asExample
, that should be filled by the template's user (whileprintExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.
– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
Yes, there are few other macros as
Example
, that should be filled by the template's user (while printExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.– Jérôme Champavère
May 23 at 10:10
Yes, there are few other macros as
Example
, that should be filled by the template's user (while printExample
's are in some way hidden). But the true/false outputs depend on the macro, i.e., some show a "should-be-filled-message" in the PDF documents if empty, other are optional, and when correctly filled their formattings mostly differ. This is why I need a real if-then-else statement.– Jérôme Champavère
May 23 at 10:10
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
@JérômeChampavère I added a more general implementation
– egreg
May 23 at 10:57
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.
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%2f492069%2fxstring-fails-to-compare-text-containing%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
What is the expected output. You could try using
noexpandarg
, but I am not sure what the code is supposed to do.– Peter Grill
May 22 at 9:23
If you are just testing whether a macro is empty or not, then the void tests from
etoolbox
might be better, that is what I normally use. But as Peter mentions, it is not quite clear what you are trying to do.– daleif
May 22 at 9:52
1
It works with
xifthen
using this test:ifthenelseequalprintExamplevoidprintExample
– frougon
May 22 at 9:57
Various tests from
etoolbox
(ifdefvoid
,ifstrempty
orifblank
) do not work with TeX Live 2017/Debian (but they work for current TeX Live). Commandifthenelse
fromxifthen
works well, indeed (even if, from a "logical" perspective, I would expect a command whose argument is directly a string, not a boolean). Can someone explain why\
breaksIfStrEq
and if there is a way (or not) to use it?– Jérôme Champavère
May 22 at 19:52
I added
centering
in environmenttitlepage
because it causes an error (! Incomplete iffalse; all text was ignored after line …) whenifthenelse
test is used. An other error is raised withcenter
environment (! Use of @item doesn't match its definition.). In both cases, one needs to useprotect\
in order to get it working as expected.– Jérôme Champavère
May 22 at 20:32