In the following code, the use of the package titlesec modifies dramatically the formatting based on the package marginnote. The package titlesec is needed so as to use this.

Is there one possibility to repair that ?

    %\usepackage{titlesec} % << Uncomment to see the changes... >>

    \reversemarginpar % To put the margin pars on the left



            show background rectangle,
            inner frame sep=0pt,
            text width=1cm,
            \node [fill=colorDateGene]  at (0,0)                                (dayofweek)  {\footnotesize{#1}};
            \node [fill=colorDateToday] at ($(dayofweek)  +(0,-\baselineskip)$) (dayofmonth) {#2};
            \node [fill=colorDateToday] at ($(dayofmonth) +(0,-\baselineskip)$) (month)      {#3};
            \node [fill=colorDateGene]  at ($(month)      +(0,-\baselineskip)$) (dayofmonth) {\footnotesize{#4}};



\addcontentsline{toc}{section}{Mon. 28 Nov.}
\section*{One day \marginnote{\Date{Mon}{28}{NOV}{2011}}}


\addcontentsline{toc}{section}{Wed. 30 Nov.}
\section*{One day \marginnote{\Date{Wed}{30}{NOV}{2011}}}


\addcontentsline{toc}{section}{Fri. 2nd Dec.}
\section*{One day \marginnote{\Date{Fri}{2nd}{DEC}{2011}}}


\addcontentsline{toc}{section}{Mon. 5 Dec.}
\section*{One day \marginnote{\Date{Fri}{5}{DEC}{2011}}}



As I said in my revised answer to your former question: Instead of putting \marginnote inside \section*, change the vertical positioning of the \marginnote using its second optimal argument.

\section*{One day} \marginnote{\Date{Mon}{28}{NOV}{2011}}[-32pt]
  • To obtain the same formatting as the \section header, use \marginnote{\bfseries...}. Why 32pt? – Werner Dec 1 '11 at 0:22
  • @Werner: The OP seems to want a marginnote in \normalfont that is nevertheless vertically aligned witth the sectioning title -- 32pt is a crude aligning attempt, considering the marginnote's box. – lockstep Dec 1 '11 at 0:26
  • Okay - \normalfont in the text has a \baselineskip of 14.5pt, while that of the section heading is 22pt, so I had thought 36.5pt. But your visual attempt is definitely sufficient. – Werner Dec 1 '11 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.