Head of a custom section












4















I am creating a new section called tsubsection taking over code practically 1:1 from subsection with the intention to introduce some modifications.



In this example



documentclass{report}
makeatletter
newcounter{tsubsection}
%renewcommand{thetsubsection}{@Romanc@tsubsection}
newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
{-3.25ex@plus -1ex @minus -.2ex}%
{1.5ex @plus .2ex}%
{normalfontlargebfseries}}
%newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
makeatother
begin{document}
tsubsection{Methods}
Some text
end{document}


the output is



enter image description here



Where does the extra "Methods" in the head of tsubsection come from?










share|improve this question



























    4















    I am creating a new section called tsubsection taking over code practically 1:1 from subsection with the intention to introduce some modifications.



    In this example



    documentclass{report}
    makeatletter
    newcounter{tsubsection}
    %renewcommand{thetsubsection}{@Romanc@tsubsection}
    newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
    {-3.25ex@plus -1ex @minus -.2ex}%
    {1.5ex @plus .2ex}%
    {normalfontlargebfseries}}
    %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
    makeatother
    begin{document}
    tsubsection{Methods}
    Some text
    end{document}


    the output is



    enter image description here



    Where does the extra "Methods" in the head of tsubsection come from?










    share|improve this question

























      4












      4








      4








      I am creating a new section called tsubsection taking over code practically 1:1 from subsection with the intention to introduce some modifications.



      In this example



      documentclass{report}
      makeatletter
      newcounter{tsubsection}
      %renewcommand{thetsubsection}{@Romanc@tsubsection}
      newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
      {-3.25ex@plus -1ex @minus -.2ex}%
      {1.5ex @plus .2ex}%
      {normalfontlargebfseries}}
      %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
      makeatother
      begin{document}
      tsubsection{Methods}
      Some text
      end{document}


      the output is



      enter image description here



      Where does the extra "Methods" in the head of tsubsection come from?










      share|improve this question














      I am creating a new section called tsubsection taking over code practically 1:1 from subsection with the intention to introduce some modifications.



      In this example



      documentclass{report}
      makeatletter
      newcounter{tsubsection}
      %renewcommand{thetsubsection}{@Romanc@tsubsection}
      newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
      {-3.25ex@plus -1ex @minus -.2ex}%
      {1.5ex @plus .2ex}%
      {normalfontlargebfseries}}
      %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
      makeatother
      begin{document}
      tsubsection{Methods}
      Some text
      end{document}


      the output is



      enter image description here



      Where does the extra "Methods" in the head of tsubsection come from?







      sectioning report






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 12:47









      ViestursViesturs

      1,85041126




      1,85041126






















          1 Answer
          1






          active

          oldest

          votes


















          4














          The extra Methods shows up because you didn't define tsubsectionmark, then the command:



          csname tsubsectionmarkendcsname{Methods}


          (which shows up somewhere deep in the definition of @startsection) becomes:



          relax{Methods}


          which writes Methods to the PDF.



          You have to define the tsubsectionmark to add some page marking (with markright or markboth) or to simply consume the argument:



          newcommandtsubsectionmark[1]{}



          enter image description here




          Working code:



          documentclass{report}
          usepackage{trace}
          makeatletter
          newcounter{tsubsection}
          %renewcommand{thetsubsection}{@Romanc@tsubsection}
          newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
          {-3.25ex@plus -1ex @minus -.2ex}%
          {1.5ex @plus .2ex}%
          {normalfontlargebfseries}}
          newcommandtsubsectionmark[1]{}
          %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
          makeatother
          begin{document}
          tsubsection{Methods}
          Some text
          end{document}





          share|improve this answer
























          • Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

            – Viesturs
            Mar 8 at 17:35






          • 1





            @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

            – Phelype Oleinik
            Mar 8 at 17:40











          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%2f478411%2fhead-of-a-custom-section%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









          4














          The extra Methods shows up because you didn't define tsubsectionmark, then the command:



          csname tsubsectionmarkendcsname{Methods}


          (which shows up somewhere deep in the definition of @startsection) becomes:



          relax{Methods}


          which writes Methods to the PDF.



          You have to define the tsubsectionmark to add some page marking (with markright or markboth) or to simply consume the argument:



          newcommandtsubsectionmark[1]{}



          enter image description here




          Working code:



          documentclass{report}
          usepackage{trace}
          makeatletter
          newcounter{tsubsection}
          %renewcommand{thetsubsection}{@Romanc@tsubsection}
          newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
          {-3.25ex@plus -1ex @minus -.2ex}%
          {1.5ex @plus .2ex}%
          {normalfontlargebfseries}}
          newcommandtsubsectionmark[1]{}
          %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
          makeatother
          begin{document}
          tsubsection{Methods}
          Some text
          end{document}





          share|improve this answer
























          • Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

            – Viesturs
            Mar 8 at 17:35






          • 1





            @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

            – Phelype Oleinik
            Mar 8 at 17:40
















          4














          The extra Methods shows up because you didn't define tsubsectionmark, then the command:



          csname tsubsectionmarkendcsname{Methods}


          (which shows up somewhere deep in the definition of @startsection) becomes:



          relax{Methods}


          which writes Methods to the PDF.



          You have to define the tsubsectionmark to add some page marking (with markright or markboth) or to simply consume the argument:



          newcommandtsubsectionmark[1]{}



          enter image description here




          Working code:



          documentclass{report}
          usepackage{trace}
          makeatletter
          newcounter{tsubsection}
          %renewcommand{thetsubsection}{@Romanc@tsubsection}
          newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
          {-3.25ex@plus -1ex @minus -.2ex}%
          {1.5ex @plus .2ex}%
          {normalfontlargebfseries}}
          newcommandtsubsectionmark[1]{}
          %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
          makeatother
          begin{document}
          tsubsection{Methods}
          Some text
          end{document}





          share|improve this answer
























          • Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

            – Viesturs
            Mar 8 at 17:35






          • 1





            @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

            – Phelype Oleinik
            Mar 8 at 17:40














          4












          4








          4







          The extra Methods shows up because you didn't define tsubsectionmark, then the command:



          csname tsubsectionmarkendcsname{Methods}


          (which shows up somewhere deep in the definition of @startsection) becomes:



          relax{Methods}


          which writes Methods to the PDF.



          You have to define the tsubsectionmark to add some page marking (with markright or markboth) or to simply consume the argument:



          newcommandtsubsectionmark[1]{}



          enter image description here




          Working code:



          documentclass{report}
          usepackage{trace}
          makeatletter
          newcounter{tsubsection}
          %renewcommand{thetsubsection}{@Romanc@tsubsection}
          newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
          {-3.25ex@plus -1ex @minus -.2ex}%
          {1.5ex @plus .2ex}%
          {normalfontlargebfseries}}
          newcommandtsubsectionmark[1]{}
          %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
          makeatother
          begin{document}
          tsubsection{Methods}
          Some text
          end{document}





          share|improve this answer













          The extra Methods shows up because you didn't define tsubsectionmark, then the command:



          csname tsubsectionmarkendcsname{Methods}


          (which shows up somewhere deep in the definition of @startsection) becomes:



          relax{Methods}


          which writes Methods to the PDF.



          You have to define the tsubsectionmark to add some page marking (with markright or markboth) or to simply consume the argument:



          newcommandtsubsectionmark[1]{}



          enter image description here




          Working code:



          documentclass{report}
          usepackage{trace}
          makeatletter
          newcounter{tsubsection}
          %renewcommand{thetsubsection}{@Romanc@tsubsection}
          newcommandtsubsection{@startsection{tsubsection}{2}{z@}%
          {-3.25ex@plus -1ex @minus -.2ex}%
          {1.5ex @plus .2ex}%
          {normalfontlargebfseries}}
          newcommandtsubsectionmark[1]{}
          %newcommand*l@tsubsection{@dottedtocline{2}{3.8em}{3.2em}}
          makeatother
          begin{document}
          tsubsection{Methods}
          Some text
          end{document}






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 13:07









          Phelype OleinikPhelype Oleinik

          24.2k54688




          24.2k54688













          • Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

            – Viesturs
            Mar 8 at 17:35






          • 1





            @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

            – Phelype Oleinik
            Mar 8 at 17:40



















          • Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

            – Viesturs
            Mar 8 at 17:35






          • 1





            @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

            – Phelype Oleinik
            Mar 8 at 17:40

















          Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

          – Viesturs
          Mar 8 at 17:35





          Where is @startsection defined? I don't see its definition in report.cls. Why don't I see the definition of subsectionmark in report.cls?

          – Viesturs
          Mar 8 at 17:35




          1




          1





          @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

          – Phelype Oleinik
          Mar 8 at 17:40





          @startsection is defined in latex.ltx (but actually the csname tsubsectionmarkendcsname thingy appears in @sect, also defined in latex.ltx, which is called by @startsection). subsectionmark (and for other sectioning levels) are also in latex.ltx: letsubsectionmark@gobble.

          – Phelype Oleinik
          Mar 8 at 17:40


















          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%2f478411%2fhead-of-a-custom-section%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

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?