expand `ifthenelse` immediatelyDuplicate and modify section hierarchyProblem with ifthenelseifthenelse in Latexifthenelse no else with string comparison`enumdepth` and `ifthenelse`Using @currenvir in ifthenelseifthenelse + equal behaves weirdlyUsing ifthenelse inside an optionifthenelse as an argument to equalhelp with nomenclature groups and ifthenelse
What would happen to a modern skyscraper if it rains micro blackholes?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Modeling an IP Address
How much of data wrangling is a data scientist's job?
Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?
Alternative to sending password over mail?
Important Resources for Dark Age Civilizations?
How can bays and straits be determined in a procedurally generated map?
What doth I be?
What defenses are there against being summoned by the Gate spell?
Is it possible to run Internet Explorer on OS X El Capitan?
How do I deal with an unproductive colleague in a small company?
Why can't I see bouncing of switch on oscilloscope screen?
Watching something be written to a file live with tail
Why doesn't H₄O²⁺ exist?
Do infinite dimensional systems make sense?
Why are electrically insulating heatsinks so rare? Is it just cost?
Filter any system log file by date or date range
Java Casting: Java 11 throws LambdaConversionException while 1.8 does not
Does detail obscure or enhance action?
Revoked SSL certificate
Why is consensus so controversial in Britain?
DC-DC converter from low voltage at high current, to high voltage at low current
What's that red-plus icon near a text?
expand `ifthenelse` immediately
Duplicate and modify section hierarchyProblem with ifthenelseifthenelse in Latexifthenelse no else with string comparison`enumdepth` and `ifthenelse`Using @currenvir in ifthenelseifthenelse + equal behaves weirdlyUsing ifthenelse inside an optionifthenelse as an argument to equalhelp with nomenclature groups and ifthenelse
Consider this script:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
setcounterpage
%3
ifthenelse
equalthesissizeSHORT
32
hey
enddocument
Compiling this script gives the error:
! Missing number, treated as zero.
I suspect that this is due to ifthenelse
not being evaluated at the time of executing setcounter
. How to solve?
macros ifthenelse
add a comment |
Consider this script:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
setcounterpage
%3
ifthenelse
equalthesissizeSHORT
32
hey
enddocument
Compiling this script gives the error:
! Missing number, treated as zero.
I suspect that this is due to ifthenelse
not being evaluated at the time of executing setcounter
. How to solve?
macros ifthenelse
add a comment |
Consider this script:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
setcounterpage
%3
ifthenelse
equalthesissizeSHORT
32
hey
enddocument
Compiling this script gives the error:
! Missing number, treated as zero.
I suspect that this is due to ifthenelse
not being evaluated at the time of executing setcounter
. How to solve?
macros ifthenelse
Consider this script:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
setcounterpage
%3
ifthenelse
equalthesissizeSHORT
32
hey
enddocument
Compiling this script gives the error:
! Missing number, treated as zero.
I suspect that this is due to ifthenelse
not being evaluated at the time of executing setcounter
. How to solve?
macros ifthenelse
macros ifthenelse
asked 10 hours ago
ViestursViesturs
1,92641127
1,92641127
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
you can't use ifthenelse
inside setcounter
. Change the order:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
ifthenelseequalthesissizeSHORT
setcounterpage3setcounterpage2
hey
enddocument
Expandable tests are possible with expl3
and etoolbox
. For both you should store the reference text in a command:
documentclassreport
usepackageexpl3,etoolbox
newcommandthesissizeSHORT
newcommandshortsizeSHORT
begindocument
ExplSyntaxOn
setcounterpagetl_if_eq:NNTFthesissizeshortsize32
ExplSyntaxOff
setcounterpageifdefequalthesissizeshortsize32
hey
enddocument
What is the reason?
– Viesturs
10 hours ago
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
I added two more versions.
– Ulrike Fischer
10 hours ago
add a comment |
Another version of a string comparison using the pdfTeX macro pdfstrcmp
. The following uses the pdftexcmds
package to make it available to all engines under the same name:
documentclass[]article
usepackagepdftexcmds
makeatletter
newcommandifstreq[2]
%
ifnumpdf@strcmp#1#2=0
makeatother
newcommandthesissizeSHORT
begindocument
setcounterpageifstreqthesissizeSHORT3else2fi
hey
enddocument
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%2f483347%2fexpand-ifthenelse-immediately%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
you can't use ifthenelse
inside setcounter
. Change the order:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
ifthenelseequalthesissizeSHORT
setcounterpage3setcounterpage2
hey
enddocument
Expandable tests are possible with expl3
and etoolbox
. For both you should store the reference text in a command:
documentclassreport
usepackageexpl3,etoolbox
newcommandthesissizeSHORT
newcommandshortsizeSHORT
begindocument
ExplSyntaxOn
setcounterpagetl_if_eq:NNTFthesissizeshortsize32
ExplSyntaxOff
setcounterpageifdefequalthesissizeshortsize32
hey
enddocument
What is the reason?
– Viesturs
10 hours ago
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
I added two more versions.
– Ulrike Fischer
10 hours ago
add a comment |
you can't use ifthenelse
inside setcounter
. Change the order:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
ifthenelseequalthesissizeSHORT
setcounterpage3setcounterpage2
hey
enddocument
Expandable tests are possible with expl3
and etoolbox
. For both you should store the reference text in a command:
documentclassreport
usepackageexpl3,etoolbox
newcommandthesissizeSHORT
newcommandshortsizeSHORT
begindocument
ExplSyntaxOn
setcounterpagetl_if_eq:NNTFthesissizeshortsize32
ExplSyntaxOff
setcounterpageifdefequalthesissizeshortsize32
hey
enddocument
What is the reason?
– Viesturs
10 hours ago
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
I added two more versions.
– Ulrike Fischer
10 hours ago
add a comment |
you can't use ifthenelse
inside setcounter
. Change the order:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
ifthenelseequalthesissizeSHORT
setcounterpage3setcounterpage2
hey
enddocument
Expandable tests are possible with expl3
and etoolbox
. For both you should store the reference text in a command:
documentclassreport
usepackageexpl3,etoolbox
newcommandthesissizeSHORT
newcommandshortsizeSHORT
begindocument
ExplSyntaxOn
setcounterpagetl_if_eq:NNTFthesissizeshortsize32
ExplSyntaxOff
setcounterpageifdefequalthesissizeshortsize32
hey
enddocument
you can't use ifthenelse
inside setcounter
. Change the order:
documentclassreport
usepackageifthen
newcommandthesissizeSHORT
begindocument
ifthenelseequalthesissizeSHORT
setcounterpage3setcounterpage2
hey
enddocument
Expandable tests are possible with expl3
and etoolbox
. For both you should store the reference text in a command:
documentclassreport
usepackageexpl3,etoolbox
newcommandthesissizeSHORT
newcommandshortsizeSHORT
begindocument
ExplSyntaxOn
setcounterpagetl_if_eq:NNTFthesissizeshortsize32
ExplSyntaxOff
setcounterpageifdefequalthesissizeshortsize32
hey
enddocument
edited 9 hours ago
Andrew Swann
78k9132332
78k9132332
answered 10 hours ago
Ulrike FischerUlrike Fischer
198k9305692
198k9305692
What is the reason?
– Viesturs
10 hours ago
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
I added two more versions.
– Ulrike Fischer
10 hours ago
add a comment |
What is the reason?
– Viesturs
10 hours ago
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
I added two more versions.
– Ulrike Fischer
10 hours ago
What is the reason?
– Viesturs
10 hours ago
What is the reason?
– Viesturs
10 hours ago
5
5
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
ifthenelse is not expandable.
– Ulrike Fischer
10 hours ago
1
1
I added two more versions.
– Ulrike Fischer
10 hours ago
I added two more versions.
– Ulrike Fischer
10 hours ago
add a comment |
Another version of a string comparison using the pdfTeX macro pdfstrcmp
. The following uses the pdftexcmds
package to make it available to all engines under the same name:
documentclass[]article
usepackagepdftexcmds
makeatletter
newcommandifstreq[2]
%
ifnumpdf@strcmp#1#2=0
makeatother
newcommandthesissizeSHORT
begindocument
setcounterpageifstreqthesissizeSHORT3else2fi
hey
enddocument
add a comment |
Another version of a string comparison using the pdfTeX macro pdfstrcmp
. The following uses the pdftexcmds
package to make it available to all engines under the same name:
documentclass[]article
usepackagepdftexcmds
makeatletter
newcommandifstreq[2]
%
ifnumpdf@strcmp#1#2=0
makeatother
newcommandthesissizeSHORT
begindocument
setcounterpageifstreqthesissizeSHORT3else2fi
hey
enddocument
add a comment |
Another version of a string comparison using the pdfTeX macro pdfstrcmp
. The following uses the pdftexcmds
package to make it available to all engines under the same name:
documentclass[]article
usepackagepdftexcmds
makeatletter
newcommandifstreq[2]
%
ifnumpdf@strcmp#1#2=0
makeatother
newcommandthesissizeSHORT
begindocument
setcounterpageifstreqthesissizeSHORT3else2fi
hey
enddocument
Another version of a string comparison using the pdfTeX macro pdfstrcmp
. The following uses the pdftexcmds
package to make it available to all engines under the same name:
documentclass[]article
usepackagepdftexcmds
makeatletter
newcommandifstreq[2]
%
ifnumpdf@strcmp#1#2=0
makeatother
newcommandthesissizeSHORT
begindocument
setcounterpageifstreqthesissizeSHORT3else2fi
hey
enddocument
answered 5 hours ago
SkillmonSkillmon
24.2k12250
24.2k12250
add a comment |
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%2f483347%2fexpand-ifthenelse-immediately%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