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

Why are electrically insulating heatsinks so rare? Is it just cost?

Is it legal for company to use my work email to pretend I still work there?

Why doesn't H₄O²⁺ exist?

Does detail obscure or enhance action?

Languages that we cannot (dis)prove to be Context-Free

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Alternative to sending password over mail?

Perform and show arithmetic with LuaLaTeX

Was any UN Security Council vote triple-vetoed?

Maximum likelihood parameters deviate from posterior distributions

Theorems that impeded progress

How to format long polynomial?

What would happen to a modern skyscraper if it rains micro blackholes?

Do I have a twin with permutated remainders?

Important Resources for Dark Age Civilizations?

What doth I be?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

How to determine what difficulty is right for the game?

Cross compiling for RPi - error while loading shared libraries

How can bays and straits be determined in a procedurally generated map?

dbcc cleantable batch size explanation

Revoked SSL certificate

Can I make popcorn with any corn?

Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?



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













5















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?










share|improve this question


























    5















    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?










    share|improve this question
























      5












      5








      5








      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?










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 9 hours ago









      ViestursViesturs

      1,92641127




      1,92641127




















          2 Answers
          2






          active

          oldest

          votes


















          8














          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





          share|improve this answer

























          • What is the reason?

            – Viesturs
            9 hours ago






          • 5





            ifthenelse is not expandable.

            – Ulrike Fischer
            9 hours ago






          • 1





            I added two more versions.

            – Ulrike Fischer
            8 hours ago


















          1














          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





          share|improve this answer























            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
            );



            );













            draft saved

            draft discarded


















            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









            8














            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





            share|improve this answer

























            • What is the reason?

              – Viesturs
              9 hours ago






            • 5





              ifthenelse is not expandable.

              – Ulrike Fischer
              9 hours ago






            • 1





              I added two more versions.

              – Ulrike Fischer
              8 hours ago















            8














            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





            share|improve this answer

























            • What is the reason?

              – Viesturs
              9 hours ago






            • 5





              ifthenelse is not expandable.

              – Ulrike Fischer
              9 hours ago






            • 1





              I added two more versions.

              – Ulrike Fischer
              8 hours ago













            8












            8








            8







            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





            share|improve this answer















            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






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 8 hours ago









            Andrew Swann

            78k9132332




            78k9132332










            answered 9 hours ago









            Ulrike FischerUlrike Fischer

            198k9305692




            198k9305692












            • What is the reason?

              – Viesturs
              9 hours ago






            • 5





              ifthenelse is not expandable.

              – Ulrike Fischer
              9 hours ago






            • 1





              I added two more versions.

              – Ulrike Fischer
              8 hours ago

















            • What is the reason?

              – Viesturs
              9 hours ago






            • 5





              ifthenelse is not expandable.

              – Ulrike Fischer
              9 hours ago






            • 1





              I added two more versions.

              – Ulrike Fischer
              8 hours ago
















            What is the reason?

            – Viesturs
            9 hours ago





            What is the reason?

            – Viesturs
            9 hours ago




            5




            5





            ifthenelse is not expandable.

            – Ulrike Fischer
            9 hours ago





            ifthenelse is not expandable.

            – Ulrike Fischer
            9 hours ago




            1




            1





            I added two more versions.

            – Ulrike Fischer
            8 hours ago





            I added two more versions.

            – Ulrike Fischer
            8 hours ago











            1














            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





            share|improve this answer



























              1














              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





              share|improve this answer

























                1












                1








                1







                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





                share|improve this answer













                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






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 4 hours ago









                SkillmonSkillmon

                24.2k12250




                24.2k12250



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

                    Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр

                    Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»