Formatting a question consistently












0















I'm trying to format my assignment in a question and answer format.



newcommand{question}[2]{textbf{Question #1}\#2\}


This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as



newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}


This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.



enter image description here










share|improve this question







New contributor




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
















  • 3





    Why wouldn't you use the enumerate environment?

    – David Purton
    7 hours ago











  • Don't use \ for that purpose!

    – JouleV
    7 hours ago













  • @DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

    – Michael
    7 hours ago











  • @Michael It will definitely work with a long document.

    – JouleV
    7 hours ago











  • I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

    – David Purton
    7 hours ago
















0















I'm trying to format my assignment in a question and answer format.



newcommand{question}[2]{textbf{Question #1}\#2\}


This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as



newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}


This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.



enter image description here










share|improve this question







New contributor




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
















  • 3





    Why wouldn't you use the enumerate environment?

    – David Purton
    7 hours ago











  • Don't use \ for that purpose!

    – JouleV
    7 hours ago













  • @DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

    – Michael
    7 hours ago











  • @Michael It will definitely work with a long document.

    – JouleV
    7 hours ago











  • I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

    – David Purton
    7 hours ago














0












0








0








I'm trying to format my assignment in a question and answer format.



newcommand{question}[2]{textbf{Question #1}\#2\}


This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as



newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}


This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.



enter image description here










share|improve this question







New contributor




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












I'm trying to format my assignment in a question and answer format.



newcommand{question}[2]{textbf{Question #1}\#2\}


This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as



newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}


This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.



enter image description here







formatting






share|improve this question







New contributor




Michael 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




Michael 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






New contributor




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









asked 7 hours ago









MichaelMichael

1




1




New contributor




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





New contributor





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






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








  • 3





    Why wouldn't you use the enumerate environment?

    – David Purton
    7 hours ago











  • Don't use \ for that purpose!

    – JouleV
    7 hours ago













  • @DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

    – Michael
    7 hours ago











  • @Michael It will definitely work with a long document.

    – JouleV
    7 hours ago











  • I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

    – David Purton
    7 hours ago














  • 3





    Why wouldn't you use the enumerate environment?

    – David Purton
    7 hours ago











  • Don't use \ for that purpose!

    – JouleV
    7 hours ago













  • @DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

    – Michael
    7 hours ago











  • @Michael It will definitely work with a long document.

    – JouleV
    7 hours ago











  • I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

    – David Purton
    7 hours ago








3




3





Why wouldn't you use the enumerate environment?

– David Purton
7 hours ago





Why wouldn't you use the enumerate environment?

– David Purton
7 hours ago













Don't use \ for that purpose!

– JouleV
7 hours ago







Don't use \ for that purpose!

– JouleV
7 hours ago















@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

– Michael
7 hours ago





@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?

– Michael
7 hours ago













@Michael It will definitely work with a long document.

– JouleV
7 hours ago





@Michael It will definitely work with a long document.

– JouleV
7 hours ago













I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

– David Purton
7 hours ago





I wouldn't worry about big enumerate environments. You can customise things with enumitem and it will work fine.

– David Purton
7 hours ago










1 Answer
1






active

oldest

votes


















2














David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.



documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}

question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}


enter image description here



Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.






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


    }
    });






    Michael 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%2f483901%2fformatting-a-question-consistently%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.



    documentclass{article}
    usepackage[shortlabels]{enumitem}
    setlength{parindent}{0pt}
    newcounter{question}
    newcommandquestion[1]{%
    stepcounter{question}
    textbf{large Question arabic{question}}par#1par}
    setlist[enumerate,1]{{bfseries a)}}
    usepackage{lipsum}
    begin{document}
    question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
    begin{enumerate}
    item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
    item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
    end{enumerate}

    question{Calculate the value of $1+1$?}
    begin{enumerate}
    item Hence, calculate the value of $1+2$.
    item Is $2$ the only sum of $1$ and $1$? Give an explanation.
    end{enumerate}
    end{document}


    enter image description here



    Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.






    share|improve this answer




























      2














      David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.



      documentclass{article}
      usepackage[shortlabels]{enumitem}
      setlength{parindent}{0pt}
      newcounter{question}
      newcommandquestion[1]{%
      stepcounter{question}
      textbf{large Question arabic{question}}par#1par}
      setlist[enumerate,1]{{bfseries a)}}
      usepackage{lipsum}
      begin{document}
      question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
      begin{enumerate}
      item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
      item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
      end{enumerate}

      question{Calculate the value of $1+1$?}
      begin{enumerate}
      item Hence, calculate the value of $1+2$.
      item Is $2$ the only sum of $1$ and $1$? Give an explanation.
      end{enumerate}
      end{document}


      enter image description here



      Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.






      share|improve this answer


























        2












        2








        2







        David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.



        documentclass{article}
        usepackage[shortlabels]{enumitem}
        setlength{parindent}{0pt}
        newcounter{question}
        newcommandquestion[1]{%
        stepcounter{question}
        textbf{large Question arabic{question}}par#1par}
        setlist[enumerate,1]{{bfseries a)}}
        usepackage{lipsum}
        begin{document}
        question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
        begin{enumerate}
        item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
        item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
        end{enumerate}

        question{Calculate the value of $1+1$?}
        begin{enumerate}
        item Hence, calculate the value of $1+2$.
        item Is $2$ the only sum of $1$ and $1$? Give an explanation.
        end{enumerate}
        end{document}


        enter image description here



        Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.






        share|improve this answer













        David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.



        documentclass{article}
        usepackage[shortlabels]{enumitem}
        setlength{parindent}{0pt}
        newcounter{question}
        newcommandquestion[1]{%
        stepcounter{question}
        textbf{large Question arabic{question}}par#1par}
        setlist[enumerate,1]{{bfseries a)}}
        usepackage{lipsum}
        begin{document}
        question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
        begin{enumerate}
        item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
        item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
        end{enumerate}

        question{Calculate the value of $1+1$?}
        begin{enumerate}
        item Hence, calculate the value of $1+2$.
        item Is $2$ the only sum of $1$ and $1$? Give an explanation.
        end{enumerate}
        end{document}


        enter image description here



        Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 7 hours ago









        JouleVJouleV

        11.9k22561




        11.9k22561






















            Michael is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Michael is a new contributor. Be nice, and check out our Code of Conduct.













            Michael is a new contributor. Be nice, and check out our Code of Conduct.












            Michael 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%2f483901%2fformatting-a-question-consistently%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

            Lallio

            Unable to find Lightning Node

            Futebolista