Independently style head in TOC and in document












0















I'm using a custom typescript (after help in this question) which includes (among other things) two additional weights, medium and semibold, and their size modifiers (like tfa, tfb and so on). Because of custom weights, I've created custom macros for semibold italics, medium italics and so on (sbi and mdi, among others), as em doesn't alternate regular/italics in custom weights.



I use then semibold in heads with size modifiers (globally configured), and those heads are independently styled in TOC (with regular weight), which works as expected. But when I use my custom macro sbi in a particular head, it's typeset in body size, not in head size (say, like sbic). And in TOC it gets semibold italics, not regular italics. Even worse, If I use semibold italics with size modifier in that particular head (say, sbic), it gets that same size in TOC.



Question: is there any way of totally independently style heads in document and in TOC? Two possibilities would work:




  • in TOC, completely remove any particular style/weight of heads (acceptable)

  • correctly alternate between regular and italics, both in document and in TOC, according to surrounding weight (in my case, semibold in text and regular in TOC)


My typescript (excerpt):



definebodyfont [default] [rm]
[tf=Serif sa 1,
bf=SerifBold sa 1,
it=SerifItalic sa 1,
% ...
mdf=SerifMedium sa 1,
mif=SerifMediumItalic sa 1,
msf=SerifMediumSlanted sa 1,
% ...
sbf=SerifSemibold sa 1,
sbi=SerifSemiboldItalic sa 1,
sbs=SerifSemiboldSlanted sa 1,
% ...
sbfb=SerifSemibold sa 1.440,
sbfc=SerifSemibold sa 1.728,
% ...
sbib=SerifSemiboldItalic sa 1.440,
sbic=SerifSemiboldItalic sa 1.728,
% ...
]


And my document (excerpt):



setupbodyfont[garamond-premier, 12pt] % my typescript

setuphead[chapter] [style={sbfc}] % heads in document: semibold
setuphead[section] [style={sbfb}]

setupcombinedlist[content][list={chapter, section}]
setuplist[chapter] [style={tf}] % heads in TOC: regular
setuplist[section] [style={tf}]

starttext
completecontent

chapter[title={A chapter with {sbic italics}}]
A text

section[title={A section with {sbib italics}}]
Another text
stoptext


Result (TOC and document, excerpt. Note incorrect weight and size in italics in TOC):



Screenshot









share



























    0















    I'm using a custom typescript (after help in this question) which includes (among other things) two additional weights, medium and semibold, and their size modifiers (like tfa, tfb and so on). Because of custom weights, I've created custom macros for semibold italics, medium italics and so on (sbi and mdi, among others), as em doesn't alternate regular/italics in custom weights.



    I use then semibold in heads with size modifiers (globally configured), and those heads are independently styled in TOC (with regular weight), which works as expected. But when I use my custom macro sbi in a particular head, it's typeset in body size, not in head size (say, like sbic). And in TOC it gets semibold italics, not regular italics. Even worse, If I use semibold italics with size modifier in that particular head (say, sbic), it gets that same size in TOC.



    Question: is there any way of totally independently style heads in document and in TOC? Two possibilities would work:




    • in TOC, completely remove any particular style/weight of heads (acceptable)

    • correctly alternate between regular and italics, both in document and in TOC, according to surrounding weight (in my case, semibold in text and regular in TOC)


    My typescript (excerpt):



    definebodyfont [default] [rm]
    [tf=Serif sa 1,
    bf=SerifBold sa 1,
    it=SerifItalic sa 1,
    % ...
    mdf=SerifMedium sa 1,
    mif=SerifMediumItalic sa 1,
    msf=SerifMediumSlanted sa 1,
    % ...
    sbf=SerifSemibold sa 1,
    sbi=SerifSemiboldItalic sa 1,
    sbs=SerifSemiboldSlanted sa 1,
    % ...
    sbfb=SerifSemibold sa 1.440,
    sbfc=SerifSemibold sa 1.728,
    % ...
    sbib=SerifSemiboldItalic sa 1.440,
    sbic=SerifSemiboldItalic sa 1.728,
    % ...
    ]


    And my document (excerpt):



    setupbodyfont[garamond-premier, 12pt] % my typescript

    setuphead[chapter] [style={sbfc}] % heads in document: semibold
    setuphead[section] [style={sbfb}]

    setupcombinedlist[content][list={chapter, section}]
    setuplist[chapter] [style={tf}] % heads in TOC: regular
    setuplist[section] [style={tf}]

    starttext
    completecontent

    chapter[title={A chapter with {sbic italics}}]
    A text

    section[title={A section with {sbib italics}}]
    Another text
    stoptext


    Result (TOC and document, excerpt. Note incorrect weight and size in italics in TOC):



    Screenshot









    share

























      0












      0








      0








      I'm using a custom typescript (after help in this question) which includes (among other things) two additional weights, medium and semibold, and their size modifiers (like tfa, tfb and so on). Because of custom weights, I've created custom macros for semibold italics, medium italics and so on (sbi and mdi, among others), as em doesn't alternate regular/italics in custom weights.



      I use then semibold in heads with size modifiers (globally configured), and those heads are independently styled in TOC (with regular weight), which works as expected. But when I use my custom macro sbi in a particular head, it's typeset in body size, not in head size (say, like sbic). And in TOC it gets semibold italics, not regular italics. Even worse, If I use semibold italics with size modifier in that particular head (say, sbic), it gets that same size in TOC.



      Question: is there any way of totally independently style heads in document and in TOC? Two possibilities would work:




      • in TOC, completely remove any particular style/weight of heads (acceptable)

      • correctly alternate between regular and italics, both in document and in TOC, according to surrounding weight (in my case, semibold in text and regular in TOC)


      My typescript (excerpt):



      definebodyfont [default] [rm]
      [tf=Serif sa 1,
      bf=SerifBold sa 1,
      it=SerifItalic sa 1,
      % ...
      mdf=SerifMedium sa 1,
      mif=SerifMediumItalic sa 1,
      msf=SerifMediumSlanted sa 1,
      % ...
      sbf=SerifSemibold sa 1,
      sbi=SerifSemiboldItalic sa 1,
      sbs=SerifSemiboldSlanted sa 1,
      % ...
      sbfb=SerifSemibold sa 1.440,
      sbfc=SerifSemibold sa 1.728,
      % ...
      sbib=SerifSemiboldItalic sa 1.440,
      sbic=SerifSemiboldItalic sa 1.728,
      % ...
      ]


      And my document (excerpt):



      setupbodyfont[garamond-premier, 12pt] % my typescript

      setuphead[chapter] [style={sbfc}] % heads in document: semibold
      setuphead[section] [style={sbfb}]

      setupcombinedlist[content][list={chapter, section}]
      setuplist[chapter] [style={tf}] % heads in TOC: regular
      setuplist[section] [style={tf}]

      starttext
      completecontent

      chapter[title={A chapter with {sbic italics}}]
      A text

      section[title={A section with {sbib italics}}]
      Another text
      stoptext


      Result (TOC and document, excerpt. Note incorrect weight and size in italics in TOC):



      Screenshot









      share














      I'm using a custom typescript (after help in this question) which includes (among other things) two additional weights, medium and semibold, and their size modifiers (like tfa, tfb and so on). Because of custom weights, I've created custom macros for semibold italics, medium italics and so on (sbi and mdi, among others), as em doesn't alternate regular/italics in custom weights.



      I use then semibold in heads with size modifiers (globally configured), and those heads are independently styled in TOC (with regular weight), which works as expected. But when I use my custom macro sbi in a particular head, it's typeset in body size, not in head size (say, like sbic). And in TOC it gets semibold italics, not regular italics. Even worse, If I use semibold italics with size modifier in that particular head (say, sbic), it gets that same size in TOC.



      Question: is there any way of totally independently style heads in document and in TOC? Two possibilities would work:




      • in TOC, completely remove any particular style/weight of heads (acceptable)

      • correctly alternate between regular and italics, both in document and in TOC, according to surrounding weight (in my case, semibold in text and regular in TOC)


      My typescript (excerpt):



      definebodyfont [default] [rm]
      [tf=Serif sa 1,
      bf=SerifBold sa 1,
      it=SerifItalic sa 1,
      % ...
      mdf=SerifMedium sa 1,
      mif=SerifMediumItalic sa 1,
      msf=SerifMediumSlanted sa 1,
      % ...
      sbf=SerifSemibold sa 1,
      sbi=SerifSemiboldItalic sa 1,
      sbs=SerifSemiboldSlanted sa 1,
      % ...
      sbfb=SerifSemibold sa 1.440,
      sbfc=SerifSemibold sa 1.728,
      % ...
      sbib=SerifSemiboldItalic sa 1.440,
      sbic=SerifSemiboldItalic sa 1.728,
      % ...
      ]


      And my document (excerpt):



      setupbodyfont[garamond-premier, 12pt] % my typescript

      setuphead[chapter] [style={sbfc}] % heads in document: semibold
      setuphead[section] [style={sbfb}]

      setupcombinedlist[content][list={chapter, section}]
      setuplist[chapter] [style={tf}] % heads in TOC: regular
      setuplist[section] [style={tf}]

      starttext
      completecontent

      chapter[title={A chapter with {sbic italics}}]
      A text

      section[title={A section with {sbib italics}}]
      Another text
      stoptext


      Result (TOC and document, excerpt. Note incorrect weight and size in italics in TOC):



      Screenshot







      table-of-contents sectioning context





      share












      share










      share



      share










      asked 3 mins ago









      José de Mattos NetoJosé de Mattos Neto

      677




      677






















          0






          active

          oldest

          votes











          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%2f469780%2findependently-style-head-in-toc-and-in-document%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          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%2f469780%2findependently-style-head-in-toc-and-in-document%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

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt