What's going on with an item that starts with an hbox?Differentiating between hbox and mboxIssue with section...

If a vampire drinks blood of a sick human, does the vampire get infected?

Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?

What does the ISO setting for mechanical 35mm film cameras actually do?

Launch capabilities of GSLV Mark III

Our group keeps dying during the Lost Mine of Phandelver campaign. What are we doing wrong?

What filaments allow air to pass but not water vapor?

What are the function of EM and EN spaces?

Can you take actions after being healed at 0hp?

Definitional equality of two propositions about propositional equality

Will a research paper be retracted if the code (which was made publically available ) is shown have a flaw in the logic?

Why should I "believe in" weak solutions to PDEs?

Getting Lost in the Caves of Chaos

If I build a custom theme, will it update?

Write The Shortest Program To Check If A Binary Tree Is Balanced

Did Captain America make out with his niece?

A Checkmate of Dubious Legality

How easy is it to get a gun illegally in the United States?

What date did Henry Morgan capture his most famous flagship, the "Satisfaction"?

Why is the Vasa Museum in Stockholm so Popular?

Which genus do I use for neutral expressions in German?

What's going on with an item that starts with an hbox?

Nested Unlocked Packages requires Installation of Base Packages?

Can a Hogwarts student refuse the Sorting Hat's decision?

List: Behavioural characteristics of key Ito processes used in finance



What's going on with an item that starts with an hbox?


Differentiating between hbox and mboxIssue with section text assuming same color as body textEnumerate and itemize undefined + captions not workingMissing item problem with enumerateEnumerating nested item with skipsItem with more than one value in enumerate environmentRefer to the item that follows a certain label/referenceNo new line for theorem in enumerateItem numbers with listingsHow to link to a Theorem that contains only an enumerated listEnumerate with no top-level itemvertically align top line of item contents with item number






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







6















I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an hbox, then the hbox is placed before the label!



documentclass[12pt]{article}

defBlank#1{relax{hbox to 1in{hrulefilltextsl{#1}hrulefill}}}

begin{document}

section{Example}

Here's a list:
begin{enumerate}
item
Blank{test}, plus stuff after.

item{}
Blank{test}, plus stuff after.

itemrelax
Blank{test}, plus stuff after.

item{ }
Blank{test}, plus stuff after.

item{ }relax
hbox to 1in{hrulefilltextsl{test}hrulefill}, plus stuff after.

item{ X }
Blank{test}, plus stuff after.

% etc.

end{enumerate}

end{document}


The result is unexpected, except for the last item.
shows text coming before labels



Blanks, relax, nothing stops the hbox being moved back except actual text.



What am I doing wrong?










share|improve this question









New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • 2





    there is a reason hbox is not a latex command, and mbox is......

    – David Carlisle
    8 hours ago






  • 9





    The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

    – David Carlisle
    8 hours ago




















6















I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an hbox, then the hbox is placed before the label!



documentclass[12pt]{article}

defBlank#1{relax{hbox to 1in{hrulefilltextsl{#1}hrulefill}}}

begin{document}

section{Example}

Here's a list:
begin{enumerate}
item
Blank{test}, plus stuff after.

item{}
Blank{test}, plus stuff after.

itemrelax
Blank{test}, plus stuff after.

item{ }
Blank{test}, plus stuff after.

item{ }relax
hbox to 1in{hrulefilltextsl{test}hrulefill}, plus stuff after.

item{ X }
Blank{test}, plus stuff after.

% etc.

end{enumerate}

end{document}


The result is unexpected, except for the last item.
shows text coming before labels



Blanks, relax, nothing stops the hbox being moved back except actual text.



What am I doing wrong?










share|improve this question









New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • 2





    there is a reason hbox is not a latex command, and mbox is......

    – David Carlisle
    8 hours ago






  • 9





    The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

    – David Carlisle
    8 hours ago
















6












6








6








I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an hbox, then the hbox is placed before the label!



documentclass[12pt]{article}

defBlank#1{relax{hbox to 1in{hrulefilltextsl{#1}hrulefill}}}

begin{document}

section{Example}

Here's a list:
begin{enumerate}
item
Blank{test}, plus stuff after.

item{}
Blank{test}, plus stuff after.

itemrelax
Blank{test}, plus stuff after.

item{ }
Blank{test}, plus stuff after.

item{ }relax
hbox to 1in{hrulefilltextsl{test}hrulefill}, plus stuff after.

item{ X }
Blank{test}, plus stuff after.

% etc.

end{enumerate}

end{document}


The result is unexpected, except for the last item.
shows text coming before labels



Blanks, relax, nothing stops the hbox being moved back except actual text.



What am I doing wrong?










share|improve this question









New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I've been using LaTeX for years and never saw this before: if an item (in enumerate) starts with an hbox, then the hbox is placed before the label!



documentclass[12pt]{article}

defBlank#1{relax{hbox to 1in{hrulefilltextsl{#1}hrulefill}}}

begin{document}

section{Example}

Here's a list:
begin{enumerate}
item
Blank{test}, plus stuff after.

item{}
Blank{test}, plus stuff after.

itemrelax
Blank{test}, plus stuff after.

item{ }
Blank{test}, plus stuff after.

item{ }relax
hbox to 1in{hrulefilltextsl{test}hrulefill}, plus stuff after.

item{ X }
Blank{test}, plus stuff after.

% etc.

end{enumerate}

end{document}


The result is unexpected, except for the last item.
shows text coming before labels



Blanks, relax, nothing stops the hbox being moved back except actual text.



What am I doing wrong?







enumerate latex-base






share|improve this question









New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited 6 hours ago









Mensch

47.1k10 gold badges53 silver badges178 bronze badges




47.1k10 gold badges53 silver badges178 bronze badges






New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked 8 hours ago









John Tang BoylandJohn Tang Boyland

1312 bronze badges




1312 bronze badges




New contributor



John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




John Tang Boyland is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • 2





    there is a reason hbox is not a latex command, and mbox is......

    – David Carlisle
    8 hours ago






  • 9





    The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

    – David Carlisle
    8 hours ago
















  • 2





    there is a reason hbox is not a latex command, and mbox is......

    – David Carlisle
    8 hours ago






  • 9





    The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

    – David Carlisle
    8 hours ago










2




2





there is a reason hbox is not a latex command, and mbox is......

– David Carlisle
8 hours ago





there is a reason hbox is not a latex command, and mbox is......

– David Carlisle
8 hours ago




9




9





The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

– David Carlisle
8 hours ago







The hbox behaviour is explained in several answers on site eg tex.stackexchange.com/questions/118164/…

– David Carlisle
8 hours ago












2 Answers
2






active

oldest

votes


















7














As explained in



Differentiating between hbox and mbox



hbox is a TeX primitve not a LaTeX command and does not react well with most LaTeX constructs, notably it is not centered by a center environment and has various perhaps unexpected behaviours at the start of a paragraph.



The specific interaction with lists is not mentioned there though so answering here rather than suggesting that is a duplicate.



LaTeX implements list item labels by typesetting the label into a box register and then inserting the label at the start of the following paragraph. hbox does not start a paragraph, this primitive box construct inserts the hbox directly into the surrounding vertical list, so the saved item label is not inserted until some following text does start the paragraph. So the lable comes after the box.



So you could fix this by using leavevmodehbox instead of simply hbox (that is the main part of the definition of mbox) or as you are using the hbox to syntax you could use the standard latex equivalent namely



makebox[1cm]{...}


which will automatically apply leavevmode as well as constructing the 1cm wide box.






share|improve this answer


























  • didn't see befor posting . Sorry ;-)

    – touhami
    5 hours ago











  • @touhami no harm done:-)

    – David Carlisle
    5 hours ago



















2














What happen is that the label is placed with everypar command.



everypar content is inserted at the beging of every paragraph,
when TeX enter to horizental mode (after indentation).



The hbox primitive doesn't start a new paragraph i.e. it's add to the vertical list, so the label will wait for additional stuff that start a new paragraph
(comma , in the OP).



See this question



ECM



documentclass{article}

defmyitem{setbox0=hbox{textbulletquad}everypar{unhbox0everypar{}}}

begin{document}
myitem foo bar.

myitem you see.

myitem mbox{OK. here} every thing is good.

myitem hbox {No!} but not here.
end{document}


ECM



documentclass{article}

begin{document}
begingroup
everypar{textbf{Foo} }
yes

mbox{yes} again

hbox{what's} now
endgroup
end{document}





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


    }
    });






    John Tang Boyland is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f503073%2fwhats-going-on-with-an-item-that-starts-with-an-hbox%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









    7














    As explained in



    Differentiating between hbox and mbox



    hbox is a TeX primitve not a LaTeX command and does not react well with most LaTeX constructs, notably it is not centered by a center environment and has various perhaps unexpected behaviours at the start of a paragraph.



    The specific interaction with lists is not mentioned there though so answering here rather than suggesting that is a duplicate.



    LaTeX implements list item labels by typesetting the label into a box register and then inserting the label at the start of the following paragraph. hbox does not start a paragraph, this primitive box construct inserts the hbox directly into the surrounding vertical list, so the saved item label is not inserted until some following text does start the paragraph. So the lable comes after the box.



    So you could fix this by using leavevmodehbox instead of simply hbox (that is the main part of the definition of mbox) or as you are using the hbox to syntax you could use the standard latex equivalent namely



    makebox[1cm]{...}


    which will automatically apply leavevmode as well as constructing the 1cm wide box.






    share|improve this answer


























    • didn't see befor posting . Sorry ;-)

      – touhami
      5 hours ago











    • @touhami no harm done:-)

      – David Carlisle
      5 hours ago
















    7














    As explained in



    Differentiating between hbox and mbox



    hbox is a TeX primitve not a LaTeX command and does not react well with most LaTeX constructs, notably it is not centered by a center environment and has various perhaps unexpected behaviours at the start of a paragraph.



    The specific interaction with lists is not mentioned there though so answering here rather than suggesting that is a duplicate.



    LaTeX implements list item labels by typesetting the label into a box register and then inserting the label at the start of the following paragraph. hbox does not start a paragraph, this primitive box construct inserts the hbox directly into the surrounding vertical list, so the saved item label is not inserted until some following text does start the paragraph. So the lable comes after the box.



    So you could fix this by using leavevmodehbox instead of simply hbox (that is the main part of the definition of mbox) or as you are using the hbox to syntax you could use the standard latex equivalent namely



    makebox[1cm]{...}


    which will automatically apply leavevmode as well as constructing the 1cm wide box.






    share|improve this answer


























    • didn't see befor posting . Sorry ;-)

      – touhami
      5 hours ago











    • @touhami no harm done:-)

      – David Carlisle
      5 hours ago














    7












    7








    7







    As explained in



    Differentiating between hbox and mbox



    hbox is a TeX primitve not a LaTeX command and does not react well with most LaTeX constructs, notably it is not centered by a center environment and has various perhaps unexpected behaviours at the start of a paragraph.



    The specific interaction with lists is not mentioned there though so answering here rather than suggesting that is a duplicate.



    LaTeX implements list item labels by typesetting the label into a box register and then inserting the label at the start of the following paragraph. hbox does not start a paragraph, this primitive box construct inserts the hbox directly into the surrounding vertical list, so the saved item label is not inserted until some following text does start the paragraph. So the lable comes after the box.



    So you could fix this by using leavevmodehbox instead of simply hbox (that is the main part of the definition of mbox) or as you are using the hbox to syntax you could use the standard latex equivalent namely



    makebox[1cm]{...}


    which will automatically apply leavevmode as well as constructing the 1cm wide box.






    share|improve this answer













    As explained in



    Differentiating between hbox and mbox



    hbox is a TeX primitve not a LaTeX command and does not react well with most LaTeX constructs, notably it is not centered by a center environment and has various perhaps unexpected behaviours at the start of a paragraph.



    The specific interaction with lists is not mentioned there though so answering here rather than suggesting that is a duplicate.



    LaTeX implements list item labels by typesetting the label into a box register and then inserting the label at the start of the following paragraph. hbox does not start a paragraph, this primitive box construct inserts the hbox directly into the surrounding vertical list, so the saved item label is not inserted until some following text does start the paragraph. So the lable comes after the box.



    So you could fix this by using leavevmodehbox instead of simply hbox (that is the main part of the definition of mbox) or as you are using the hbox to syntax you could use the standard latex equivalent namely



    makebox[1cm]{...}


    which will automatically apply leavevmode as well as constructing the 1cm wide box.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 5 hours ago









    David CarlisleDavid Carlisle

    518k44 gold badges1173 silver badges1943 bronze badges




    518k44 gold badges1173 silver badges1943 bronze badges
















    • didn't see befor posting . Sorry ;-)

      – touhami
      5 hours ago











    • @touhami no harm done:-)

      – David Carlisle
      5 hours ago



















    • didn't see befor posting . Sorry ;-)

      – touhami
      5 hours ago











    • @touhami no harm done:-)

      – David Carlisle
      5 hours ago

















    didn't see befor posting . Sorry ;-)

    – touhami
    5 hours ago





    didn't see befor posting . Sorry ;-)

    – touhami
    5 hours ago













    @touhami no harm done:-)

    – David Carlisle
    5 hours ago





    @touhami no harm done:-)

    – David Carlisle
    5 hours ago













    2














    What happen is that the label is placed with everypar command.



    everypar content is inserted at the beging of every paragraph,
    when TeX enter to horizental mode (after indentation).



    The hbox primitive doesn't start a new paragraph i.e. it's add to the vertical list, so the label will wait for additional stuff that start a new paragraph
    (comma , in the OP).



    See this question



    ECM



    documentclass{article}

    defmyitem{setbox0=hbox{textbulletquad}everypar{unhbox0everypar{}}}

    begin{document}
    myitem foo bar.

    myitem you see.

    myitem mbox{OK. here} every thing is good.

    myitem hbox {No!} but not here.
    end{document}


    ECM



    documentclass{article}

    begin{document}
    begingroup
    everypar{textbf{Foo} }
    yes

    mbox{yes} again

    hbox{what's} now
    endgroup
    end{document}





    share|improve this answer






























      2














      What happen is that the label is placed with everypar command.



      everypar content is inserted at the beging of every paragraph,
      when TeX enter to horizental mode (after indentation).



      The hbox primitive doesn't start a new paragraph i.e. it's add to the vertical list, so the label will wait for additional stuff that start a new paragraph
      (comma , in the OP).



      See this question



      ECM



      documentclass{article}

      defmyitem{setbox0=hbox{textbulletquad}everypar{unhbox0everypar{}}}

      begin{document}
      myitem foo bar.

      myitem you see.

      myitem mbox{OK. here} every thing is good.

      myitem hbox {No!} but not here.
      end{document}


      ECM



      documentclass{article}

      begin{document}
      begingroup
      everypar{textbf{Foo} }
      yes

      mbox{yes} again

      hbox{what's} now
      endgroup
      end{document}





      share|improve this answer




























        2












        2








        2







        What happen is that the label is placed with everypar command.



        everypar content is inserted at the beging of every paragraph,
        when TeX enter to horizental mode (after indentation).



        The hbox primitive doesn't start a new paragraph i.e. it's add to the vertical list, so the label will wait for additional stuff that start a new paragraph
        (comma , in the OP).



        See this question



        ECM



        documentclass{article}

        defmyitem{setbox0=hbox{textbulletquad}everypar{unhbox0everypar{}}}

        begin{document}
        myitem foo bar.

        myitem you see.

        myitem mbox{OK. here} every thing is good.

        myitem hbox {No!} but not here.
        end{document}


        ECM



        documentclass{article}

        begin{document}
        begingroup
        everypar{textbf{Foo} }
        yes

        mbox{yes} again

        hbox{what's} now
        endgroup
        end{document}





        share|improve this answer













        What happen is that the label is placed with everypar command.



        everypar content is inserted at the beging of every paragraph,
        when TeX enter to horizental mode (after indentation).



        The hbox primitive doesn't start a new paragraph i.e. it's add to the vertical list, so the label will wait for additional stuff that start a new paragraph
        (comma , in the OP).



        See this question



        ECM



        documentclass{article}

        defmyitem{setbox0=hbox{textbulletquad}everypar{unhbox0everypar{}}}

        begin{document}
        myitem foo bar.

        myitem you see.

        myitem mbox{OK. here} every thing is good.

        myitem hbox {No!} but not here.
        end{document}


        ECM



        documentclass{article}

        begin{document}
        begingroup
        everypar{textbf{Foo} }
        yes

        mbox{yes} again

        hbox{what's} now
        endgroup
        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 5 hours ago









        touhamitouhami

        17.5k2 gold badges13 silver badges46 bronze badges




        17.5k2 gold badges13 silver badges46 bronze badges

























            John Tang Boyland is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            John Tang Boyland is a new contributor. Be nice, and check out our Code of Conduct.













            John Tang Boyland is a new contributor. Be nice, and check out our Code of Conduct.












            John Tang Boyland 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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f503073%2fwhats-going-on-with-an-item-that-starts-with-an-hbox%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

            Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

            The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

            Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...