Indent of book TOC entries












1














I have tried several of the examples of TOC formatting that I found in this forum, using the titlesec package and titlecontents{chapter} but I cannot get my book TOC chapter entries to indent correctly as in
enter image description here



An excerpt of the code I am using is



documentclass{book} 
% It MUST be compiled with LuaLaTex
%PAGES
usepackage[
vcentering,
hcentering,
inner=16mm,
outer=16mm,
top=22.0mm,
bottom=15.0mm,
headsep=9.3mm,
headheight=5mm,
% showframe
]
{geometry} % Extended page layout customization

geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
%usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
usepackage{multicol}% handling of multicolumn in documents
usepackage[toc]{multitoc}%enables table of contents with multiple columns
renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
usepackage{emptypage} % suppresses page numbers and headings on empty pages
usepackage{xcolor}[2007/01/21] % Driver-independent color extensions

%FONTS
usepackage{fontspec}%LuaLaTex fonts
setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
usepackage{titletoc,xpatch}%
usepackage[explicit]{titlesec}% An in­ter­face to sec­tion­ing com­mands for se­lec­tion from var­i­ous ti­tle styles.

%Font families
newfontfamilyAvenir{Avenir}
newfontfamilyAvenirLight{Avenir Light}
newfontfamilyAvenirHeavy{Avenir Heavy}


%Chapters in TOC
newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}

titlecontents{chapter}% section-type
[0em]% left
{vspace*{0.6cm}}% above code
{chaptertocfontthecontentslabelquad}% numbered-entry format
{}% numberless-entry format
{hfillchaptertocpagefontcontentspage}% filler-page format

begin{document}

tableofcontents

chapter{Energy Conversion Systems}

chapter{Thermodynamic Properties of Multicomponent Fluids}

end{document}


What am I doing wrong?










share|improve this question



























    1














    I have tried several of the examples of TOC formatting that I found in this forum, using the titlesec package and titlecontents{chapter} but I cannot get my book TOC chapter entries to indent correctly as in
    enter image description here



    An excerpt of the code I am using is



    documentclass{book} 
    % It MUST be compiled with LuaLaTex
    %PAGES
    usepackage[
    vcentering,
    hcentering,
    inner=16mm,
    outer=16mm,
    top=22.0mm,
    bottom=15.0mm,
    headsep=9.3mm,
    headheight=5mm,
    % showframe
    ]
    {geometry} % Extended page layout customization

    geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
    %usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
    usepackage{multicol}% handling of multicolumn in documents
    usepackage[toc]{multitoc}%enables table of contents with multiple columns
    renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
    usepackage{emptypage} % suppresses page numbers and headings on empty pages
    usepackage{xcolor}[2007/01/21] % Driver-independent color extensions

    %FONTS
    usepackage{fontspec}%LuaLaTex fonts
    setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
    usepackage{titletoc,xpatch}%
    usepackage[explicit]{titlesec}% An in­ter­face to sec­tion­ing com­mands for se­lec­tion from var­i­ous ti­tle styles.

    %Font families
    newfontfamilyAvenir{Avenir}
    newfontfamilyAvenirLight{Avenir Light}
    newfontfamilyAvenirHeavy{Avenir Heavy}


    %Chapters in TOC
    newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
    newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}

    titlecontents{chapter}% section-type
    [0em]% left
    {vspace*{0.6cm}}% above code
    {chaptertocfontthecontentslabelquad}% numbered-entry format
    {}% numberless-entry format
    {hfillchaptertocpagefontcontentspage}% filler-page format

    begin{document}

    tableofcontents

    chapter{Energy Conversion Systems}

    chapter{Thermodynamic Properties of Multicomponent Fluids}

    end{document}


    What am I doing wrong?










    share|improve this question

























      1












      1








      1







      I have tried several of the examples of TOC formatting that I found in this forum, using the titlesec package and titlecontents{chapter} but I cannot get my book TOC chapter entries to indent correctly as in
      enter image description here



      An excerpt of the code I am using is



      documentclass{book} 
      % It MUST be compiled with LuaLaTex
      %PAGES
      usepackage[
      vcentering,
      hcentering,
      inner=16mm,
      outer=16mm,
      top=22.0mm,
      bottom=15.0mm,
      headsep=9.3mm,
      headheight=5mm,
      % showframe
      ]
      {geometry} % Extended page layout customization

      geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
      %usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
      usepackage{multicol}% handling of multicolumn in documents
      usepackage[toc]{multitoc}%enables table of contents with multiple columns
      renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
      usepackage{emptypage} % suppresses page numbers and headings on empty pages
      usepackage{xcolor}[2007/01/21] % Driver-independent color extensions

      %FONTS
      usepackage{fontspec}%LuaLaTex fonts
      setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
      usepackage{titletoc,xpatch}%
      usepackage[explicit]{titlesec}% An in­ter­face to sec­tion­ing com­mands for se­lec­tion from var­i­ous ti­tle styles.

      %Font families
      newfontfamilyAvenir{Avenir}
      newfontfamilyAvenirLight{Avenir Light}
      newfontfamilyAvenirHeavy{Avenir Heavy}


      %Chapters in TOC
      newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
      newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}

      titlecontents{chapter}% section-type
      [0em]% left
      {vspace*{0.6cm}}% above code
      {chaptertocfontthecontentslabelquad}% numbered-entry format
      {}% numberless-entry format
      {hfillchaptertocpagefontcontentspage}% filler-page format

      begin{document}

      tableofcontents

      chapter{Energy Conversion Systems}

      chapter{Thermodynamic Properties of Multicomponent Fluids}

      end{document}


      What am I doing wrong?










      share|improve this question













      I have tried several of the examples of TOC formatting that I found in this forum, using the titlesec package and titlecontents{chapter} but I cannot get my book TOC chapter entries to indent correctly as in
      enter image description here



      An excerpt of the code I am using is



      documentclass{book} 
      % It MUST be compiled with LuaLaTex
      %PAGES
      usepackage[
      vcentering,
      hcentering,
      inner=16mm,
      outer=16mm,
      top=22.0mm,
      bottom=15.0mm,
      headsep=9.3mm,
      headheight=5mm,
      % showframe
      ]
      {geometry} % Extended page layout customization

      geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages
      %usepackage[cross,a4,center]{crop} %Package to print on A4 with crop signs.
      usepackage{multicol}% handling of multicolumn in documents
      usepackage[toc]{multitoc}%enables table of contents with multiple columns
      renewcommand*{multicolumntoc}{2}% Set two columns for the table of contents
      usepackage{emptypage} % suppresses page numbers and headings on empty pages
      usepackage{xcolor}[2007/01/21] % Driver-independent color extensions

      %FONTS
      usepackage{fontspec}%LuaLaTex fonts
      setmainfont[Ligatures=TeX,ItalicFont={Apollo MT Std Italic}]{Apollo MT}
      usepackage{titletoc,xpatch}%
      usepackage[explicit]{titlesec}% An in­ter­face to sec­tion­ing com­mands for se­lec­tion from var­i­ous ti­tle styles.

      %Font families
      newfontfamilyAvenir{Avenir}
      newfontfamilyAvenirLight{Avenir Light}
      newfontfamilyAvenirHeavy{Avenir Heavy}


      %Chapters in TOC
      newcommand{chaptertocfont} {fontsize{10}{12}color{red}AvenirHeavy}
      newcommand{chaptertocpagefont} {fontsize{10}{12}color{red}AvenirHeavy}

      titlecontents{chapter}% section-type
      [0em]% left
      {vspace*{0.6cm}}% above code
      {chaptertocfontthecontentslabelquad}% numbered-entry format
      {}% numberless-entry format
      {hfillchaptertocpagefontcontentspage}% filler-page format

      begin{document}

      tableofcontents

      chapter{Energy Conversion Systems}

      chapter{Thermodynamic Properties of Multicomponent Fluids}

      end{document}


      What am I doing wrong?







      table-of-contents indentation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 9 at 14:01









      pierocol

      547




      547






















          1 Answer
          1






          active

          oldest

          votes


















          1














          I do not have your fonts. But maybe you want



          titlecontents{chapter}% section-type
          [1.5em]% <- changed
          {vspace*{0.6cm}}
          {chaptertocfontcontentslabel{1.5em}}% <- changed
          {hspace*{-1.5em}}% <- changed
          {hfillchaptertocpagefontcontentspage}




          Here is another suggestion using package tocbasic instead titletoc. Then you can remove package multitoc and it is possible to avoid the hyphenation of the long chapter title in TOC:



          documentclass{book} 
          usepackage{lipsum}

          usepackage[
          vcentering,
          hcentering,
          inner=16mm,
          outer=16mm,
          top=22.0mm,
          bottom=15.0mm,
          headsep=9.3mm,
          headheight=5mm,
          % showframe
          ]{geometry} % Extended page layout customization
          geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages

          usepackage{fontspec}

          usepackage{multicol}% handling of multicolumn in documents

          usepackage{tikz} % loads also xcolor, graphicx, ...
          definecolor{BlueGreen}{RGB}{7,116,159}
          definecolor{LightBlue}{RGB}{185,229,251}
          definecolor{LightGreen}{RGB}{203,231,211}

          usepackage{emptypage}

          usepackage{tocbasic}
          addtotoclist[jobname]{toc}
          renewcommand*tableofcontents{listoftoc[contentsname]{toc}}
          BeforeStartingTOC[toc]{begin{multicols}{2}}
          AfterStartingTOC[toc]{end{multicols}}

          DeclareTOCStyleEntry[
          beforeskip=.6cm plus 1pt,
          entryformat=chaptertocfont,
          pagenumberformat=chaptertocpagefont,
          raggedentrytext=true
          ]{tocline}{chapter}
          newcommand*{chaptertocfont}[1]{normalsizebfseriestextcolor{red}{#1}}
          newcommand*{chaptertocpagefont}[1]{chaptertocfont{#1}}

          begin{document}
          tableofcontents
          chapter{Energy Conversion Systems}
          lipsum
          chapter{Thermodynamic Properties of Multicomponent Fluids}
          lipsum
          end{document}


          Result:



          enter image description here






          share|improve this answer























          • Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
            – pierocol
            Dec 9 at 19:34











          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%2f463942%2findent-of-book-toc-entries%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









          1














          I do not have your fonts. But maybe you want



          titlecontents{chapter}% section-type
          [1.5em]% <- changed
          {vspace*{0.6cm}}
          {chaptertocfontcontentslabel{1.5em}}% <- changed
          {hspace*{-1.5em}}% <- changed
          {hfillchaptertocpagefontcontentspage}




          Here is another suggestion using package tocbasic instead titletoc. Then you can remove package multitoc and it is possible to avoid the hyphenation of the long chapter title in TOC:



          documentclass{book} 
          usepackage{lipsum}

          usepackage[
          vcentering,
          hcentering,
          inner=16mm,
          outer=16mm,
          top=22.0mm,
          bottom=15.0mm,
          headsep=9.3mm,
          headheight=5mm,
          % showframe
          ]{geometry} % Extended page layout customization
          geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages

          usepackage{fontspec}

          usepackage{multicol}% handling of multicolumn in documents

          usepackage{tikz} % loads also xcolor, graphicx, ...
          definecolor{BlueGreen}{RGB}{7,116,159}
          definecolor{LightBlue}{RGB}{185,229,251}
          definecolor{LightGreen}{RGB}{203,231,211}

          usepackage{emptypage}

          usepackage{tocbasic}
          addtotoclist[jobname]{toc}
          renewcommand*tableofcontents{listoftoc[contentsname]{toc}}
          BeforeStartingTOC[toc]{begin{multicols}{2}}
          AfterStartingTOC[toc]{end{multicols}}

          DeclareTOCStyleEntry[
          beforeskip=.6cm plus 1pt,
          entryformat=chaptertocfont,
          pagenumberformat=chaptertocpagefont,
          raggedentrytext=true
          ]{tocline}{chapter}
          newcommand*{chaptertocfont}[1]{normalsizebfseriestextcolor{red}{#1}}
          newcommand*{chaptertocpagefont}[1]{chaptertocfont{#1}}

          begin{document}
          tableofcontents
          chapter{Energy Conversion Systems}
          lipsum
          chapter{Thermodynamic Properties of Multicomponent Fluids}
          lipsum
          end{document}


          Result:



          enter image description here






          share|improve this answer























          • Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
            – pierocol
            Dec 9 at 19:34
















          1














          I do not have your fonts. But maybe you want



          titlecontents{chapter}% section-type
          [1.5em]% <- changed
          {vspace*{0.6cm}}
          {chaptertocfontcontentslabel{1.5em}}% <- changed
          {hspace*{-1.5em}}% <- changed
          {hfillchaptertocpagefontcontentspage}




          Here is another suggestion using package tocbasic instead titletoc. Then you can remove package multitoc and it is possible to avoid the hyphenation of the long chapter title in TOC:



          documentclass{book} 
          usepackage{lipsum}

          usepackage[
          vcentering,
          hcentering,
          inner=16mm,
          outer=16mm,
          top=22.0mm,
          bottom=15.0mm,
          headsep=9.3mm,
          headheight=5mm,
          % showframe
          ]{geometry} % Extended page layout customization
          geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages

          usepackage{fontspec}

          usepackage{multicol}% handling of multicolumn in documents

          usepackage{tikz} % loads also xcolor, graphicx, ...
          definecolor{BlueGreen}{RGB}{7,116,159}
          definecolor{LightBlue}{RGB}{185,229,251}
          definecolor{LightGreen}{RGB}{203,231,211}

          usepackage{emptypage}

          usepackage{tocbasic}
          addtotoclist[jobname]{toc}
          renewcommand*tableofcontents{listoftoc[contentsname]{toc}}
          BeforeStartingTOC[toc]{begin{multicols}{2}}
          AfterStartingTOC[toc]{end{multicols}}

          DeclareTOCStyleEntry[
          beforeskip=.6cm plus 1pt,
          entryformat=chaptertocfont,
          pagenumberformat=chaptertocpagefont,
          raggedentrytext=true
          ]{tocline}{chapter}
          newcommand*{chaptertocfont}[1]{normalsizebfseriestextcolor{red}{#1}}
          newcommand*{chaptertocpagefont}[1]{chaptertocfont{#1}}

          begin{document}
          tableofcontents
          chapter{Energy Conversion Systems}
          lipsum
          chapter{Thermodynamic Properties of Multicomponent Fluids}
          lipsum
          end{document}


          Result:



          enter image description here






          share|improve this answer























          • Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
            – pierocol
            Dec 9 at 19:34














          1












          1








          1






          I do not have your fonts. But maybe you want



          titlecontents{chapter}% section-type
          [1.5em]% <- changed
          {vspace*{0.6cm}}
          {chaptertocfontcontentslabel{1.5em}}% <- changed
          {hspace*{-1.5em}}% <- changed
          {hfillchaptertocpagefontcontentspage}




          Here is another suggestion using package tocbasic instead titletoc. Then you can remove package multitoc and it is possible to avoid the hyphenation of the long chapter title in TOC:



          documentclass{book} 
          usepackage{lipsum}

          usepackage[
          vcentering,
          hcentering,
          inner=16mm,
          outer=16mm,
          top=22.0mm,
          bottom=15.0mm,
          headsep=9.3mm,
          headheight=5mm,
          % showframe
          ]{geometry} % Extended page layout customization
          geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages

          usepackage{fontspec}

          usepackage{multicol}% handling of multicolumn in documents

          usepackage{tikz} % loads also xcolor, graphicx, ...
          definecolor{BlueGreen}{RGB}{7,116,159}
          definecolor{LightBlue}{RGB}{185,229,251}
          definecolor{LightGreen}{RGB}{203,231,211}

          usepackage{emptypage}

          usepackage{tocbasic}
          addtotoclist[jobname]{toc}
          renewcommand*tableofcontents{listoftoc[contentsname]{toc}}
          BeforeStartingTOC[toc]{begin{multicols}{2}}
          AfterStartingTOC[toc]{end{multicols}}

          DeclareTOCStyleEntry[
          beforeskip=.6cm plus 1pt,
          entryformat=chaptertocfont,
          pagenumberformat=chaptertocpagefont,
          raggedentrytext=true
          ]{tocline}{chapter}
          newcommand*{chaptertocfont}[1]{normalsizebfseriestextcolor{red}{#1}}
          newcommand*{chaptertocpagefont}[1]{chaptertocfont{#1}}

          begin{document}
          tableofcontents
          chapter{Energy Conversion Systems}
          lipsum
          chapter{Thermodynamic Properties of Multicomponent Fluids}
          lipsum
          end{document}


          Result:



          enter image description here






          share|improve this answer














          I do not have your fonts. But maybe you want



          titlecontents{chapter}% section-type
          [1.5em]% <- changed
          {vspace*{0.6cm}}
          {chaptertocfontcontentslabel{1.5em}}% <- changed
          {hspace*{-1.5em}}% <- changed
          {hfillchaptertocpagefontcontentspage}




          Here is another suggestion using package tocbasic instead titletoc. Then you can remove package multitoc and it is possible to avoid the hyphenation of the long chapter title in TOC:



          documentclass{book} 
          usepackage{lipsum}

          usepackage[
          vcentering,
          hcentering,
          inner=16mm,
          outer=16mm,
          top=22.0mm,
          bottom=15.0mm,
          headsep=9.3mm,
          headheight=5mm,
          % showframe
          ]{geometry} % Extended page layout customization
          geometry{papersize={189mm,246mm}} % Possible dimensions of textbook pages

          usepackage{fontspec}

          usepackage{multicol}% handling of multicolumn in documents

          usepackage{tikz} % loads also xcolor, graphicx, ...
          definecolor{BlueGreen}{RGB}{7,116,159}
          definecolor{LightBlue}{RGB}{185,229,251}
          definecolor{LightGreen}{RGB}{203,231,211}

          usepackage{emptypage}

          usepackage{tocbasic}
          addtotoclist[jobname]{toc}
          renewcommand*tableofcontents{listoftoc[contentsname]{toc}}
          BeforeStartingTOC[toc]{begin{multicols}{2}}
          AfterStartingTOC[toc]{end{multicols}}

          DeclareTOCStyleEntry[
          beforeskip=.6cm plus 1pt,
          entryformat=chaptertocfont,
          pagenumberformat=chaptertocpagefont,
          raggedentrytext=true
          ]{tocline}{chapter}
          newcommand*{chaptertocfont}[1]{normalsizebfseriestextcolor{red}{#1}}
          newcommand*{chaptertocpagefont}[1]{chaptertocfont{#1}}

          begin{document}
          tableofcontents
          chapter{Energy Conversion Systems}
          lipsum
          chapter{Thermodynamic Properties of Multicomponent Fluids}
          lipsum
          end{document}


          Result:



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 13 at 14:49

























          answered Dec 9 at 19:06









          esdd

          58.4k34586




          58.4k34586












          • Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
            – pierocol
            Dec 9 at 19:34


















          • Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
            – pierocol
            Dec 9 at 19:34
















          Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
          – pierocol
          Dec 9 at 19:34




          Do you also know how I can avoid that the long chapter name is hyphened in the TOC?
          – pierocol
          Dec 9 at 19:34


















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f463942%2findent-of-book-toc-entries%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 send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?