How do I make conditions based on list options?Enumerate and itemize undefined + captions not workingaligning a multiline formula with the bullet of itemizehow to add conditions inside itemize list?How do I declare and pass conditions to commands?Line break after description labelInterrupted list formatting optionsHow can I make condition inside the geometry options?Print newpage under certain conditionsHow to make the fontsize of list of table smaller?How do conveniently control where description text starts?

Rear derailleur got caught in the spokes, what could be a root cause

Word ending in "-ine" for rat-like

What verb for taking advantage fits in "I don't want to ________ on the friendship"?

A* pathfinding algorithm too slow

German idiomatic equivalents of 能骗就骗 (if you can cheat, then cheat)

Is it possible to alias a column based on the result of a select+where?

How does the 'five minute adventuring day' affect class balance?

How would one prevent political gerrymandering?

Position representation of spin states and spin operators

Subset of knight's move in chess.

How to count the number of bytes in a file, grouping the same bytes?

Checkmate in 1 on a Tangled Board

How soon after takeoff can you recline your airplane seat?

How do I keep a running total of data in a column in Excel?

Do electrons really perform instantaneous quantum leaps?

Where can I find my serialized Sitecore items?

Why wasn't ASCII designed with a contiguous alphanumeric character order?

Does friction always oppose motion?

Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?

What was the point of separating stdout and stderr?

Tricolour nonogram

Why do some PCBs have exposed plated perimeters?

Dynamic Sql Query - how to add an int to the code?

Should Catholics in a state of grace call themselves sinners?



How do I make conditions based on list options?


Enumerate and itemize undefined + captions not workingaligning a multiline formula with the bullet of itemizehow to add conditions inside itemize list?How do I declare and pass conditions to commands?Line break after description labelInterrupted list formatting optionsHow can I make condition inside the geometry options?Print newpage under certain conditionsHow to make the fontsize of list of table smaller?How do conveniently control where description text starts?













1















Specifically, I need to write a command which changes its behavior if the option wide is turned on... So I need some kind of condition



if wide is on then do this, else do that. 


Can somebody point out how to do such condition in TeX ?



Pseudocode:



documentclassarticle
usepackageenumitem

begindocument
beginitemize[wide]
item
if@wide do "printthis list is wide and change rightmargin to 3cm"
else do "printthis list is not wide and change rightmargin to 2cm"
fi
enditemize
enddocument









share|improve this question
























  • The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik I need to change some lengths and variables based on if this option is on.

    – Lust_For_Love
    8 hours ago















1















Specifically, I need to write a command which changes its behavior if the option wide is turned on... So I need some kind of condition



if wide is on then do this, else do that. 


Can somebody point out how to do such condition in TeX ?



Pseudocode:



documentclassarticle
usepackageenumitem

begindocument
beginitemize[wide]
item
if@wide do "printthis list is wide and change rightmargin to 3cm"
else do "printthis list is not wide and change rightmargin to 2cm"
fi
enditemize
enddocument









share|improve this question
























  • The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik I need to change some lengths and variables based on if this option is on.

    – Lust_For_Love
    8 hours ago













1












1








1








Specifically, I need to write a command which changes its behavior if the option wide is turned on... So I need some kind of condition



if wide is on then do this, else do that. 


Can somebody point out how to do such condition in TeX ?



Pseudocode:



documentclassarticle
usepackageenumitem

begindocument
beginitemize[wide]
item
if@wide do "printthis list is wide and change rightmargin to 3cm"
else do "printthis list is not wide and change rightmargin to 2cm"
fi
enditemize
enddocument









share|improve this question
















Specifically, I need to write a command which changes its behavior if the option wide is turned on... So I need some kind of condition



if wide is on then do this, else do that. 


Can somebody point out how to do such condition in TeX ?



Pseudocode:



documentclassarticle
usepackageenumitem

begindocument
beginitemize[wide]
item
if@wide do "printthis list is wide and change rightmargin to 3cm"
else do "printthis list is not wide and change rightmargin to 2cm"
fi
enditemize
enddocument






lists conditionals






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 hours ago







Lust_For_Love

















asked 8 hours ago









Lust_For_LoveLust_For_Love

5342 silver badges19 bronze badges




5342 silver badges19 bronze badges












  • The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik I need to change some lengths and variables based on if this option is on.

    – Lust_For_Love
    8 hours ago

















  • The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik I need to change some lengths and variables based on if this option is on.

    – Lust_For_Love
    8 hours ago
















The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

– Phelype Oleinik
8 hours ago





The wide option doesn't activate a different branch of code, it just changes some internal parameters of enumitem. It's easy to make the code detect if the option was used, but I think you won't get anything useful here. What exactly do you want to achieve with that?

– Phelype Oleinik
8 hours ago













@PhelypeOleinik I need to change some lengths and variables based on if this option is on.

– Lust_For_Love
8 hours ago





@PhelypeOleinik I need to change some lengths and variables based on if this option is on.

– Lust_For_Love
8 hours ago










2 Answers
2






active

oldest

votes


















2














You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment.



Note also that the wide option takes an argument. If you pass none, then parindent is used (i.e., beginitemize[wide] is the same as beginitemize[wide=parindent]).



However you should not try to change enumitem's internal parameters (they are internal for a reason) in the document. You should stick to the key-value interface it provides.



Anyhow, here it is:




enter image description here




documentclassarticle
usepackageenumitem
usepackageetoolbox

makeatletter
newififwide
patchcmdenitkv@enumitem@wide
enit@align@left% <- Search
widetrueenit@align@left% <- Replace
FailedToPatch
makeatother

begindocument
beginitemize[wide]
item
ifwide textttwide was used
else textttwide was NOT used
fi
enditemize
beginitemize
item
ifwide textttwide was used
else textttwide was NOT used
fi
enditemize
enddocument





share|improve this answer






























    1














    Here is a way you could use list styles, contained in macro settings.



    documentclassarticle
    usepackageenumitem,lipsum

    newenvironmentstyledlist[1][]
    expandafteritemizeexpandafter[#1]enditemize

    defwidelistwide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm
    defnarrowlistitemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm

    begindocument
    beginstyledlist[widelist]
    item lipsum[4]
    endstyledlist

    beginstyledlist[narrowlist]
    item lipsum[4]
    endstyledlist
    enddocument


    enter image description here






    share|improve this answer

























    • No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

      – Lust_For_Love
      8 hours ago












    • @Lust_For_Love See my edit, if that helps.

      – Steven B. Segletes
      8 hours ago













    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%2f497853%2fhow-do-i-make-conditions-based-on-list-options%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









    2














    You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment.



    Note also that the wide option takes an argument. If you pass none, then parindent is used (i.e., beginitemize[wide] is the same as beginitemize[wide=parindent]).



    However you should not try to change enumitem's internal parameters (they are internal for a reason) in the document. You should stick to the key-value interface it provides.



    Anyhow, here it is:




    enter image description here




    documentclassarticle
    usepackageenumitem
    usepackageetoolbox

    makeatletter
    newififwide
    patchcmdenitkv@enumitem@wide
    enit@align@left% <- Search
    widetrueenit@align@left% <- Replace
    FailedToPatch
    makeatother

    begindocument
    beginitemize[wide]
    item
    ifwide textttwide was used
    else textttwide was NOT used
    fi
    enditemize
    beginitemize
    item
    ifwide textttwide was used
    else textttwide was NOT used
    fi
    enditemize
    enddocument





    share|improve this answer



























      2














      You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment.



      Note also that the wide option takes an argument. If you pass none, then parindent is used (i.e., beginitemize[wide] is the same as beginitemize[wide=parindent]).



      However you should not try to change enumitem's internal parameters (they are internal for a reason) in the document. You should stick to the key-value interface it provides.



      Anyhow, here it is:




      enter image description here




      documentclassarticle
      usepackageenumitem
      usepackageetoolbox

      makeatletter
      newififwide
      patchcmdenitkv@enumitem@wide
      enit@align@left% <- Search
      widetrueenit@align@left% <- Replace
      FailedToPatch
      makeatother

      begindocument
      beginitemize[wide]
      item
      ifwide textttwide was used
      else textttwide was NOT used
      fi
      enditemize
      beginitemize
      item
      ifwide textttwide was used
      else textttwide was NOT used
      fi
      enditemize
      enddocument





      share|improve this answer

























        2












        2








        2







        You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment.



        Note also that the wide option takes an argument. If you pass none, then parindent is used (i.e., beginitemize[wide] is the same as beginitemize[wide=parindent]).



        However you should not try to change enumitem's internal parameters (they are internal for a reason) in the document. You should stick to the key-value interface it provides.



        Anyhow, here it is:




        enter image description here




        documentclassarticle
        usepackageenumitem
        usepackageetoolbox

        makeatletter
        newififwide
        patchcmdenitkv@enumitem@wide
        enit@align@left% <- Search
        widetrueenit@align@left% <- Replace
        FailedToPatch
        makeatother

        begindocument
        beginitemize[wide]
        item
        ifwide textttwide was used
        else textttwide was NOT used
        fi
        enditemize
        beginitemize
        item
        ifwide textttwide was used
        else textttwide was NOT used
        fi
        enditemize
        enddocument





        share|improve this answer













        You can hook into the definition of the wide option and make your conditional true. The value of the conditional is reset after the environment.



        Note also that the wide option takes an argument. If you pass none, then parindent is used (i.e., beginitemize[wide] is the same as beginitemize[wide=parindent]).



        However you should not try to change enumitem's internal parameters (they are internal for a reason) in the document. You should stick to the key-value interface it provides.



        Anyhow, here it is:




        enter image description here




        documentclassarticle
        usepackageenumitem
        usepackageetoolbox

        makeatletter
        newififwide
        patchcmdenitkv@enumitem@wide
        enit@align@left% <- Search
        widetrueenit@align@left% <- Replace
        FailedToPatch
        makeatother

        begindocument
        beginitemize[wide]
        item
        ifwide textttwide was used
        else textttwide was NOT used
        fi
        enditemize
        beginitemize
        item
        ifwide textttwide was used
        else textttwide was NOT used
        fi
        enditemize
        enddocument






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 8 hours ago









        Phelype OleinikPhelype Oleinik

        30.7k7 gold badges52 silver badges105 bronze badges




        30.7k7 gold badges52 silver badges105 bronze badges





















            1














            Here is a way you could use list styles, contained in macro settings.



            documentclassarticle
            usepackageenumitem,lipsum

            newenvironmentstyledlist[1][]
            expandafteritemizeexpandafter[#1]enditemize

            defwidelistwide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm
            defnarrowlistitemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm

            begindocument
            beginstyledlist[widelist]
            item lipsum[4]
            endstyledlist

            beginstyledlist[narrowlist]
            item lipsum[4]
            endstyledlist
            enddocument


            enter image description here






            share|improve this answer

























            • No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

              – Lust_For_Love
              8 hours ago












            • @Lust_For_Love See my edit, if that helps.

              – Steven B. Segletes
              8 hours ago















            1














            Here is a way you could use list styles, contained in macro settings.



            documentclassarticle
            usepackageenumitem,lipsum

            newenvironmentstyledlist[1][]
            expandafteritemizeexpandafter[#1]enditemize

            defwidelistwide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm
            defnarrowlistitemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm

            begindocument
            beginstyledlist[widelist]
            item lipsum[4]
            endstyledlist

            beginstyledlist[narrowlist]
            item lipsum[4]
            endstyledlist
            enddocument


            enter image description here






            share|improve this answer

























            • No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

              – Lust_For_Love
              8 hours ago












            • @Lust_For_Love See my edit, if that helps.

              – Steven B. Segletes
              8 hours ago













            1












            1








            1







            Here is a way you could use list styles, contained in macro settings.



            documentclassarticle
            usepackageenumitem,lipsum

            newenvironmentstyledlist[1][]
            expandafteritemizeexpandafter[#1]enditemize

            defwidelistwide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm
            defnarrowlistitemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm

            begindocument
            beginstyledlist[widelist]
            item lipsum[4]
            endstyledlist

            beginstyledlist[narrowlist]
            item lipsum[4]
            endstyledlist
            enddocument


            enter image description here






            share|improve this answer















            Here is a way you could use list styles, contained in macro settings.



            documentclassarticle
            usepackageenumitem,lipsum

            newenvironmentstyledlist[1][]
            expandafteritemizeexpandafter[#1]enditemize

            defwidelistwide,itemindent=15pt,label=*,leftmargin=-1cm,rightmargin=-1cm
            defnarrowlistitemindent=15pt,label=++,leftmargin=1cm,rightmargin=1cm

            begindocument
            beginstyledlist[widelist]
            item lipsum[4]
            endstyledlist

            beginstyledlist[narrowlist]
            item lipsum[4]
            endstyledlist
            enddocument


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 8 hours ago

























            answered 8 hours ago









            Steven B. SegletesSteven B. Segletes

            167k9 gold badges210 silver badges429 bronze badges




            167k9 gold badges210 silver badges429 bronze badges












            • No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

              – Lust_For_Love
              8 hours ago












            • @Lust_For_Love See my edit, if that helps.

              – Steven B. Segletes
              8 hours ago

















            • No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

              – Lust_For_Love
              8 hours ago












            • @Lust_For_Love See my edit, if that helps.

              – Steven B. Segletes
              8 hours ago
















            No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

            – Lust_For_Love
            8 hours ago






            No, I meant... I need this condition for my other macro command. I don't want to complicate my question with those so I wrote it like that... I just need a switch which would have different behaviour based on if option is wide on or not. I need to change some variables and lengths specifically...

            – Lust_For_Love
            8 hours ago














            @Lust_For_Love See my edit, if that helps.

            – Steven B. Segletes
            8 hours ago





            @Lust_For_Love See my edit, if that helps.

            – Steven B. Segletes
            8 hours ago

















            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%2f497853%2fhow-do-i-make-conditions-based-on-list-options%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

            Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

            Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

            199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單