correct way to set indent to zero in newcommand

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I define a new command that to number the problems in a chapter:



newcounterproblemNo %problem counter
setcounterproblemNo1 %start at one
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


This code has some indentation problems:



f



I also tried to use setlengthparindent0cm but with no luck:



newcommandproblem[1]textbfProblem thechapter.arabicproblemNo 
#1 parsmallskipstepcounterproblemNosetlengthparindent0cm


ff



In fact, now the indent is zero everywhere.



Which is the right way for removing the indentation only after the problem command?




Complete code:



documentclass[12pt,twoside]book

newcounterproblemNo
setcounterproblemNo1
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


begindocument

chapterProblems

problemSolve this problem:
Problem statement.\

problemSolve this problem too:
Problem statement.\


enddocument









share|improve this question





















  • Why don't use newtheoremproblemProblem[chapter]? Load amsthm
    – Sigur
    4 hours ago















up vote
1
down vote

favorite












I define a new command that to number the problems in a chapter:



newcounterproblemNo %problem counter
setcounterproblemNo1 %start at one
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


This code has some indentation problems:



f



I also tried to use setlengthparindent0cm but with no luck:



newcommandproblem[1]textbfProblem thechapter.arabicproblemNo 
#1 parsmallskipstepcounterproblemNosetlengthparindent0cm


ff



In fact, now the indent is zero everywhere.



Which is the right way for removing the indentation only after the problem command?




Complete code:



documentclass[12pt,twoside]book

newcounterproblemNo
setcounterproblemNo1
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


begindocument

chapterProblems

problemSolve this problem:
Problem statement.\

problemSolve this problem too:
Problem statement.\


enddocument









share|improve this question





















  • Why don't use newtheoremproblemProblem[chapter]? Load amsthm
    – Sigur
    4 hours ago













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I define a new command that to number the problems in a chapter:



newcounterproblemNo %problem counter
setcounterproblemNo1 %start at one
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


This code has some indentation problems:



f



I also tried to use setlengthparindent0cm but with no luck:



newcommandproblem[1]textbfProblem thechapter.arabicproblemNo 
#1 parsmallskipstepcounterproblemNosetlengthparindent0cm


ff



In fact, now the indent is zero everywhere.



Which is the right way for removing the indentation only after the problem command?




Complete code:



documentclass[12pt,twoside]book

newcounterproblemNo
setcounterproblemNo1
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


begindocument

chapterProblems

problemSolve this problem:
Problem statement.\

problemSolve this problem too:
Problem statement.\


enddocument









share|improve this question













I define a new command that to number the problems in a chapter:



newcounterproblemNo %problem counter
setcounterproblemNo1 %start at one
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


This code has some indentation problems:



f



I also tried to use setlengthparindent0cm but with no luck:



newcommandproblem[1]textbfProblem thechapter.arabicproblemNo 
#1 parsmallskipstepcounterproblemNosetlengthparindent0cm


ff



In fact, now the indent is zero everywhere.



Which is the right way for removing the indentation only after the problem command?




Complete code:



documentclass[12pt,twoside]book

newcounterproblemNo
setcounterproblemNo1
newcommandproblem[1]textbfProblem thechapter.
arabicproblemNo #1 parsmallskipstepcounterproblemNonoindent


begindocument

chapterProblems

problemSolve this problem:
Problem statement.\

problemSolve this problem too:
Problem statement.\


enddocument






spacing macros






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 5 hours ago









shamalaia

19510




19510











  • Why don't use newtheoremproblemProblem[chapter]? Load amsthm
    – Sigur
    4 hours ago

















  • Why don't use newtheoremproblemProblem[chapter]? Load amsthm
    – Sigur
    4 hours ago
















Why don't use newtheoremproblemProblem[chapter]? Load amsthm
– Sigur
4 hours ago





Why don't use newtheoremproblemProblem[chapter]? Load amsthm
– Sigur
4 hours ago











2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Here is an option:



enter image description here



documentclassbook

newcounterproblemNo[chapter]
renewcommandtheproblemNothechapter.arabicproblemNo
newcommandproblem[1]%
par
addvspacebigskipamount
refstepcounterproblemNo%
noindenttextbfProblem theproblemNo
#1
parnobreak
smallskip
noindentignorespaces



begindocument

chapterProblems

problemSolve this problem:
Problem statement.

problemSolve this problem too:
Problem statement.

enddocument


What changed:



  • Proper definition of problemNo counter to reset with every [chapter] and have a representation that includes the chapter number representation (thechapter).


  • A problem starts by adding some space up to bigskipamount.


  • The problemNo counter is stepped just before setting Problem X.Y; this allows for proper referencing if you use label-ref.


  • After setting the problem statement, a paragraph break is initiated without a possibility for a page break (thanks to nobreak). This avoids having Problem X.Y at the bottom of the page and the problem statement at the top of the following page.


Subsequent paragraphs of a problem statement will have a regular parindent. If you want to avoid this altogether, add setlengthparindent0pt to your preamble.




A completely different approach would be to define your problem as an environment similar to that of a theorem. However, this would require a change in your input.






share|improve this answer



























    up vote
    4
    down vote













    What about this one?



    enter image description here



    documentclass[12pt,twoside]book
    usepackageamsthm
    theoremstyledefinition
    newtheoremproblemProblem[chapter]

    begindocument

    chapterProblems

    beginproblem
    Solve this problem:\ Problem statement.
    endproblem

    Text in middle.

    beginproblem
    Solve this problem:\ Problem statement.
    endproblem

    beginproblem
    Solve this problem:\ Problem statement.
    endproblem

    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',
      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%2f457963%2fcorrect-way-to-set-indent-to-zero-in-newcommand%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote



      accepted










      Here is an option:



      enter image description here



      documentclassbook

      newcounterproblemNo[chapter]
      renewcommandtheproblemNothechapter.arabicproblemNo
      newcommandproblem[1]%
      par
      addvspacebigskipamount
      refstepcounterproblemNo%
      noindenttextbfProblem theproblemNo
      #1
      parnobreak
      smallskip
      noindentignorespaces



      begindocument

      chapterProblems

      problemSolve this problem:
      Problem statement.

      problemSolve this problem too:
      Problem statement.

      enddocument


      What changed:



      • Proper definition of problemNo counter to reset with every [chapter] and have a representation that includes the chapter number representation (thechapter).


      • A problem starts by adding some space up to bigskipamount.


      • The problemNo counter is stepped just before setting Problem X.Y; this allows for proper referencing if you use label-ref.


      • After setting the problem statement, a paragraph break is initiated without a possibility for a page break (thanks to nobreak). This avoids having Problem X.Y at the bottom of the page and the problem statement at the top of the following page.


      Subsequent paragraphs of a problem statement will have a regular parindent. If you want to avoid this altogether, add setlengthparindent0pt to your preamble.




      A completely different approach would be to define your problem as an environment similar to that of a theorem. However, this would require a change in your input.






      share|improve this answer
























        up vote
        1
        down vote



        accepted










        Here is an option:



        enter image description here



        documentclassbook

        newcounterproblemNo[chapter]
        renewcommandtheproblemNothechapter.arabicproblemNo
        newcommandproblem[1]%
        par
        addvspacebigskipamount
        refstepcounterproblemNo%
        noindenttextbfProblem theproblemNo
        #1
        parnobreak
        smallskip
        noindentignorespaces



        begindocument

        chapterProblems

        problemSolve this problem:
        Problem statement.

        problemSolve this problem too:
        Problem statement.

        enddocument


        What changed:



        • Proper definition of problemNo counter to reset with every [chapter] and have a representation that includes the chapter number representation (thechapter).


        • A problem starts by adding some space up to bigskipamount.


        • The problemNo counter is stepped just before setting Problem X.Y; this allows for proper referencing if you use label-ref.


        • After setting the problem statement, a paragraph break is initiated without a possibility for a page break (thanks to nobreak). This avoids having Problem X.Y at the bottom of the page and the problem statement at the top of the following page.


        Subsequent paragraphs of a problem statement will have a regular parindent. If you want to avoid this altogether, add setlengthparindent0pt to your preamble.




        A completely different approach would be to define your problem as an environment similar to that of a theorem. However, this would require a change in your input.






        share|improve this answer






















          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          Here is an option:



          enter image description here



          documentclassbook

          newcounterproblemNo[chapter]
          renewcommandtheproblemNothechapter.arabicproblemNo
          newcommandproblem[1]%
          par
          addvspacebigskipamount
          refstepcounterproblemNo%
          noindenttextbfProblem theproblemNo
          #1
          parnobreak
          smallskip
          noindentignorespaces



          begindocument

          chapterProblems

          problemSolve this problem:
          Problem statement.

          problemSolve this problem too:
          Problem statement.

          enddocument


          What changed:



          • Proper definition of problemNo counter to reset with every [chapter] and have a representation that includes the chapter number representation (thechapter).


          • A problem starts by adding some space up to bigskipamount.


          • The problemNo counter is stepped just before setting Problem X.Y; this allows for proper referencing if you use label-ref.


          • After setting the problem statement, a paragraph break is initiated without a possibility for a page break (thanks to nobreak). This avoids having Problem X.Y at the bottom of the page and the problem statement at the top of the following page.


          Subsequent paragraphs of a problem statement will have a regular parindent. If you want to avoid this altogether, add setlengthparindent0pt to your preamble.




          A completely different approach would be to define your problem as an environment similar to that of a theorem. However, this would require a change in your input.






          share|improve this answer












          Here is an option:



          enter image description here



          documentclassbook

          newcounterproblemNo[chapter]
          renewcommandtheproblemNothechapter.arabicproblemNo
          newcommandproblem[1]%
          par
          addvspacebigskipamount
          refstepcounterproblemNo%
          noindenttextbfProblem theproblemNo
          #1
          parnobreak
          smallskip
          noindentignorespaces



          begindocument

          chapterProblems

          problemSolve this problem:
          Problem statement.

          problemSolve this problem too:
          Problem statement.

          enddocument


          What changed:



          • Proper definition of problemNo counter to reset with every [chapter] and have a representation that includes the chapter number representation (thechapter).


          • A problem starts by adding some space up to bigskipamount.


          • The problemNo counter is stepped just before setting Problem X.Y; this allows for proper referencing if you use label-ref.


          • After setting the problem statement, a paragraph break is initiated without a possibility for a page break (thanks to nobreak). This avoids having Problem X.Y at the bottom of the page and the problem statement at the top of the following page.


          Subsequent paragraphs of a problem statement will have a regular parindent. If you want to avoid this altogether, add setlengthparindent0pt to your preamble.




          A completely different approach would be to define your problem as an environment similar to that of a theorem. However, this would require a change in your input.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 4 hours ago









          Werner

          427k589371611




          427k589371611




















              up vote
              4
              down vote













              What about this one?



              enter image description here



              documentclass[12pt,twoside]book
              usepackageamsthm
              theoremstyledefinition
              newtheoremproblemProblem[chapter]

              begindocument

              chapterProblems

              beginproblem
              Solve this problem:\ Problem statement.
              endproblem

              Text in middle.

              beginproblem
              Solve this problem:\ Problem statement.
              endproblem

              beginproblem
              Solve this problem:\ Problem statement.
              endproblem

              enddocument





              share|improve this answer
























                up vote
                4
                down vote













                What about this one?



                enter image description here



                documentclass[12pt,twoside]book
                usepackageamsthm
                theoremstyledefinition
                newtheoremproblemProblem[chapter]

                begindocument

                chapterProblems

                beginproblem
                Solve this problem:\ Problem statement.
                endproblem

                Text in middle.

                beginproblem
                Solve this problem:\ Problem statement.
                endproblem

                beginproblem
                Solve this problem:\ Problem statement.
                endproblem

                enddocument





                share|improve this answer






















                  up vote
                  4
                  down vote










                  up vote
                  4
                  down vote









                  What about this one?



                  enter image description here



                  documentclass[12pt,twoside]book
                  usepackageamsthm
                  theoremstyledefinition
                  newtheoremproblemProblem[chapter]

                  begindocument

                  chapterProblems

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  Text in middle.

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  enddocument





                  share|improve this answer












                  What about this one?



                  enter image description here



                  documentclass[12pt,twoside]book
                  usepackageamsthm
                  theoremstyledefinition
                  newtheoremproblemProblem[chapter]

                  begindocument

                  chapterProblems

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  Text in middle.

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  beginproblem
                  Solve this problem:\ Problem statement.
                  endproblem

                  enddocument






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  Sigur

                  22.5k352132




                  22.5k352132



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f457963%2fcorrect-way-to-set-indent-to-zero-in-newcommand%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?