Marginnote Large Fonts are Misaligned from Text











up vote
0
down vote

favorite












I am still in the process of making a similar style kind of book to https://fac.ksu.edu.sa/sites/default/files/numerical_analysis_9th.pdf. This mostly includes having section numbers as well as theorems and figure labels in the left margin.



Currently I am using the marginnote package to try and accomplish this however, when the font is large, say using the huge command or fontsize the margin notes are misaligned vertically from the text. I was wondering if someone could help me with this, or if I should even be using marginnotes to do this (maybe there is a different better way).



Anywho, here is my MWE class file and corresponding tex file. Thanks.



notes.cls



% notes.cls
NeedsTeXFormat{LaTeX2e}
ProvidesClass{notes}
LoadClass{article}

usepackage{geometry}
usepackage{marginnote}
usepackage{xcolor}
usepackage{layout}
usepackage{anyfontsize}
usepackage{mdframed}
usepackage{mathptmx}

geometry{
letterpaper,
left=2in,
right=1in,
marginparwidth=1.5in,
marginparsep=.25in
}
setlengthparindent{0pt}

reversemarginpar

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% setup counters for custom sections
newcounter{ChpCounter}
newcounter{SecCounter}[ChpCounter]
newcounter{SubCounter}[SecCounter]
newcounter{SubSubCounter}[SubCounter]

% Setup counters for side margins
newcounter{TheoremCounter}[SecCounter]
newcounter{DefinitionCounter}[SecCounter]
newcounter{ExampleCounter}[SecCounter]
newcounter{FigureCounter}[SecCounter]
newcounter{TableCounter}[SecCounter]

% Insert side margin notes
% Use side{param}
% param:
% Theorem
% Definition
% Example
% Figure
% Table
newcommand{side}[1]{{marginnote{
color[HTML]{156EC7} large textbf{#1 theSecCounter.thevalue{#1Counter}}}} stepcounter{#1Counter}}

% Section bar length
newlength{mylength}
setlength{mylength}{linewidth}
addtolength{mylength}{marginparwidth}
% addtolength{mylength}{marginparsep}

newcommand{zchp}[1]{
stepcounter{ChpCounter}
marginnote{{textbf {fontsize{40}{48}selectfont theChpCounter}}}
{textbf{fontsize{40}{48}selectfont #1}}
vspace{100px}
newline
}

newcommand{zsec}[1]{
stepcounter{SecCounter}
stepcounter{TheoremCounter}
stepcounter{DefinitionCounter}
stepcounter{ExampleCounter}
stepcounter{FigureCounter}
stepcounter{TableCounter}
noindent{color[HTML]{156EC7}makebox[linewidth][r]{rule{mylength}{3pt}}}
marginnote{textbf{{fontsize{30}{34}selectfont theChpCounter.theSecCounter}}}
{fontsize{30}{34}selectfont textbf{#1}}
}

newcommand{zsub}[1]{
stepcounter{SubCounter}
marginnote{theChpCounter.theSecCounter.theSubCounter}
#1
}

newcommand{zsubsub}[1]{
stepcounter{SubSubCounter}
marginnote{theChpCounter.theSecCounter.theSubCounter.theSubSubCounter}
#1
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


notes.tex



% notes.tex
documentclass{notes}

usepackage{showframe}
usepackage{tikz}
usepackage{hyperref}
usepackage{contour}
usepackage{ifthen}
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}

begin{document}
zchp{Chapter}
zsec{Section}
end{document}








share


























    up vote
    0
    down vote

    favorite












    I am still in the process of making a similar style kind of book to https://fac.ksu.edu.sa/sites/default/files/numerical_analysis_9th.pdf. This mostly includes having section numbers as well as theorems and figure labels in the left margin.



    Currently I am using the marginnote package to try and accomplish this however, when the font is large, say using the huge command or fontsize the margin notes are misaligned vertically from the text. I was wondering if someone could help me with this, or if I should even be using marginnotes to do this (maybe there is a different better way).



    Anywho, here is my MWE class file and corresponding tex file. Thanks.



    notes.cls



    % notes.cls
    NeedsTeXFormat{LaTeX2e}
    ProvidesClass{notes}
    LoadClass{article}

    usepackage{geometry}
    usepackage{marginnote}
    usepackage{xcolor}
    usepackage{layout}
    usepackage{anyfontsize}
    usepackage{mdframed}
    usepackage{mathptmx}

    geometry{
    letterpaper,
    left=2in,
    right=1in,
    marginparwidth=1.5in,
    marginparsep=.25in
    }
    setlengthparindent{0pt}

    reversemarginpar

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % setup counters for custom sections
    newcounter{ChpCounter}
    newcounter{SecCounter}[ChpCounter]
    newcounter{SubCounter}[SecCounter]
    newcounter{SubSubCounter}[SubCounter]

    % Setup counters for side margins
    newcounter{TheoremCounter}[SecCounter]
    newcounter{DefinitionCounter}[SecCounter]
    newcounter{ExampleCounter}[SecCounter]
    newcounter{FigureCounter}[SecCounter]
    newcounter{TableCounter}[SecCounter]

    % Insert side margin notes
    % Use side{param}
    % param:
    % Theorem
    % Definition
    % Example
    % Figure
    % Table
    newcommand{side}[1]{{marginnote{
    color[HTML]{156EC7} large textbf{#1 theSecCounter.thevalue{#1Counter}}}} stepcounter{#1Counter}}

    % Section bar length
    newlength{mylength}
    setlength{mylength}{linewidth}
    addtolength{mylength}{marginparwidth}
    % addtolength{mylength}{marginparsep}

    newcommand{zchp}[1]{
    stepcounter{ChpCounter}
    marginnote{{textbf {fontsize{40}{48}selectfont theChpCounter}}}
    {textbf{fontsize{40}{48}selectfont #1}}
    vspace{100px}
    newline
    }

    newcommand{zsec}[1]{
    stepcounter{SecCounter}
    stepcounter{TheoremCounter}
    stepcounter{DefinitionCounter}
    stepcounter{ExampleCounter}
    stepcounter{FigureCounter}
    stepcounter{TableCounter}
    noindent{color[HTML]{156EC7}makebox[linewidth][r]{rule{mylength}{3pt}}}
    marginnote{textbf{{fontsize{30}{34}selectfont theChpCounter.theSecCounter}}}
    {fontsize{30}{34}selectfont textbf{#1}}
    }

    newcommand{zsub}[1]{
    stepcounter{SubCounter}
    marginnote{theChpCounter.theSecCounter.theSubCounter}
    #1
    }

    newcommand{zsubsub}[1]{
    stepcounter{SubSubCounter}
    marginnote{theChpCounter.theSecCounter.theSubCounter.theSubSubCounter}
    #1
    }
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


    notes.tex



    % notes.tex
    documentclass{notes}

    usepackage{showframe}
    usepackage{tikz}
    usepackage{hyperref}
    usepackage{contour}
    usepackage{ifthen}
    usepackage[T1]{fontenc}
    usepackage[utf8]{inputenc}

    begin{document}
    zchp{Chapter}
    zsec{Section}
    end{document}








    share
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am still in the process of making a similar style kind of book to https://fac.ksu.edu.sa/sites/default/files/numerical_analysis_9th.pdf. This mostly includes having section numbers as well as theorems and figure labels in the left margin.



      Currently I am using the marginnote package to try and accomplish this however, when the font is large, say using the huge command or fontsize the margin notes are misaligned vertically from the text. I was wondering if someone could help me with this, or if I should even be using marginnotes to do this (maybe there is a different better way).



      Anywho, here is my MWE class file and corresponding tex file. Thanks.



      notes.cls



      % notes.cls
      NeedsTeXFormat{LaTeX2e}
      ProvidesClass{notes}
      LoadClass{article}

      usepackage{geometry}
      usepackage{marginnote}
      usepackage{xcolor}
      usepackage{layout}
      usepackage{anyfontsize}
      usepackage{mdframed}
      usepackage{mathptmx}

      geometry{
      letterpaper,
      left=2in,
      right=1in,
      marginparwidth=1.5in,
      marginparsep=.25in
      }
      setlengthparindent{0pt}

      reversemarginpar

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      % setup counters for custom sections
      newcounter{ChpCounter}
      newcounter{SecCounter}[ChpCounter]
      newcounter{SubCounter}[SecCounter]
      newcounter{SubSubCounter}[SubCounter]

      % Setup counters for side margins
      newcounter{TheoremCounter}[SecCounter]
      newcounter{DefinitionCounter}[SecCounter]
      newcounter{ExampleCounter}[SecCounter]
      newcounter{FigureCounter}[SecCounter]
      newcounter{TableCounter}[SecCounter]

      % Insert side margin notes
      % Use side{param}
      % param:
      % Theorem
      % Definition
      % Example
      % Figure
      % Table
      newcommand{side}[1]{{marginnote{
      color[HTML]{156EC7} large textbf{#1 theSecCounter.thevalue{#1Counter}}}} stepcounter{#1Counter}}

      % Section bar length
      newlength{mylength}
      setlength{mylength}{linewidth}
      addtolength{mylength}{marginparwidth}
      % addtolength{mylength}{marginparsep}

      newcommand{zchp}[1]{
      stepcounter{ChpCounter}
      marginnote{{textbf {fontsize{40}{48}selectfont theChpCounter}}}
      {textbf{fontsize{40}{48}selectfont #1}}
      vspace{100px}
      newline
      }

      newcommand{zsec}[1]{
      stepcounter{SecCounter}
      stepcounter{TheoremCounter}
      stepcounter{DefinitionCounter}
      stepcounter{ExampleCounter}
      stepcounter{FigureCounter}
      stepcounter{TableCounter}
      noindent{color[HTML]{156EC7}makebox[linewidth][r]{rule{mylength}{3pt}}}
      marginnote{textbf{{fontsize{30}{34}selectfont theChpCounter.theSecCounter}}}
      {fontsize{30}{34}selectfont textbf{#1}}
      }

      newcommand{zsub}[1]{
      stepcounter{SubCounter}
      marginnote{theChpCounter.theSecCounter.theSubCounter}
      #1
      }

      newcommand{zsubsub}[1]{
      stepcounter{SubSubCounter}
      marginnote{theChpCounter.theSecCounter.theSubCounter.theSubSubCounter}
      #1
      }
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


      notes.tex



      % notes.tex
      documentclass{notes}

      usepackage{showframe}
      usepackage{tikz}
      usepackage{hyperref}
      usepackage{contour}
      usepackage{ifthen}
      usepackage[T1]{fontenc}
      usepackage[utf8]{inputenc}

      begin{document}
      zchp{Chapter}
      zsec{Section}
      end{document}








      share













      I am still in the process of making a similar style kind of book to https://fac.ksu.edu.sa/sites/default/files/numerical_analysis_9th.pdf. This mostly includes having section numbers as well as theorems and figure labels in the left margin.



      Currently I am using the marginnote package to try and accomplish this however, when the font is large, say using the huge command or fontsize the margin notes are misaligned vertically from the text. I was wondering if someone could help me with this, or if I should even be using marginnotes to do this (maybe there is a different better way).



      Anywho, here is my MWE class file and corresponding tex file. Thanks.



      notes.cls



      % notes.cls
      NeedsTeXFormat{LaTeX2e}
      ProvidesClass{notes}
      LoadClass{article}

      usepackage{geometry}
      usepackage{marginnote}
      usepackage{xcolor}
      usepackage{layout}
      usepackage{anyfontsize}
      usepackage{mdframed}
      usepackage{mathptmx}

      geometry{
      letterpaper,
      left=2in,
      right=1in,
      marginparwidth=1.5in,
      marginparsep=.25in
      }
      setlengthparindent{0pt}

      reversemarginpar

      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      % setup counters for custom sections
      newcounter{ChpCounter}
      newcounter{SecCounter}[ChpCounter]
      newcounter{SubCounter}[SecCounter]
      newcounter{SubSubCounter}[SubCounter]

      % Setup counters for side margins
      newcounter{TheoremCounter}[SecCounter]
      newcounter{DefinitionCounter}[SecCounter]
      newcounter{ExampleCounter}[SecCounter]
      newcounter{FigureCounter}[SecCounter]
      newcounter{TableCounter}[SecCounter]

      % Insert side margin notes
      % Use side{param}
      % param:
      % Theorem
      % Definition
      % Example
      % Figure
      % Table
      newcommand{side}[1]{{marginnote{
      color[HTML]{156EC7} large textbf{#1 theSecCounter.thevalue{#1Counter}}}} stepcounter{#1Counter}}

      % Section bar length
      newlength{mylength}
      setlength{mylength}{linewidth}
      addtolength{mylength}{marginparwidth}
      % addtolength{mylength}{marginparsep}

      newcommand{zchp}[1]{
      stepcounter{ChpCounter}
      marginnote{{textbf {fontsize{40}{48}selectfont theChpCounter}}}
      {textbf{fontsize{40}{48}selectfont #1}}
      vspace{100px}
      newline
      }

      newcommand{zsec}[1]{
      stepcounter{SecCounter}
      stepcounter{TheoremCounter}
      stepcounter{DefinitionCounter}
      stepcounter{ExampleCounter}
      stepcounter{FigureCounter}
      stepcounter{TableCounter}
      noindent{color[HTML]{156EC7}makebox[linewidth][r]{rule{mylength}{3pt}}}
      marginnote{textbf{{fontsize{30}{34}selectfont theChpCounter.theSecCounter}}}
      {fontsize{30}{34}selectfont textbf{#1}}
      }

      newcommand{zsub}[1]{
      stepcounter{SubCounter}
      marginnote{theChpCounter.theSecCounter.theSubCounter}
      #1
      }

      newcommand{zsubsub}[1]{
      stepcounter{SubSubCounter}
      marginnote{theChpCounter.theSecCounter.theSubCounter.theSubSubCounter}
      #1
      }
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


      notes.tex



      % notes.tex
      documentclass{notes}

      usepackage{showframe}
      usepackage{tikz}
      usepackage{hyperref}
      usepackage{contour}
      usepackage{ifthen}
      usepackage[T1]{fontenc}
      usepackage[utf8]{inputenc}

      begin{document}
      zchp{Chapter}
      zsec{Section}
      end{document}






      fonts margins geometry marginnote





      share












      share










      share



      share










      asked 9 mins ago









      Nick

      62




      62



























          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',
          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%2f464059%2fmarginnote-large-fonts-are-misaligned-from-text%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          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.





          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%2f464059%2fmarginnote-large-fonts-are-misaligned-from-text%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

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)