0

I want to produce margin notes like this

enter image description here

enter image description here

But they should behave like \marginnote command. The reason I want this is the flexibility of tikz package when I want to modify how the content should appear (e.g., boxes, backgrounds, alignment, transparency, anchors, etc)

MWE

\documentclass{book}

\usepackage[a4paper]{geometry} % BEGIN_FOLD

\geometry{twoside=true, showframe=true} \geometry{inner=5mm, outer=5mm, includemp=true, marginparsep=3.5mm, marginparwidth=61mm}

% END_FOLD

\usepackage{blindtext}

\usepackage{bigstrut}

\usepackage{tikz,tikzpagenodes}

\usepackage{marginnote}

\begin{document}

\noindent% \begin{tikzpicture}[baseline, remember picture, overlay]

\node[text width=61mm, align=flush left, inner xsep=0pt, inner ysep=1pt, outer xsep=0pt, outer ysep=0pt, anchor=north east] at (current page marginpar area.north east) {\bigstrut \blindtext};

\end{tikzpicture}% % \smash{\rlap{\rule{\dimexpr \linewidth + \marginparsep + \marginparwidth \relax}{0.1pt}}}% \blindtext

\newpage

\noindent% \begin{tikzpicture}[baseline, remember picture, overlay]

\node[text width=61mm, align=flush left, inner xsep=0pt, inner ysep=1pt, outer xsep=0pt, outer ysep=0pt, anchor=north east] at (current page marginpar area.north east) {\bigstrut \blindtext};

\end{tikzpicture}% % \smash{\rlap{\hspace*{\dimexpr - \marginparsep - \marginparwidth \relax}\rule{\dimexpr \linewidth + \marginparsep + \marginparwidth \relax}{0.1pt}}}% \blindtext

\newpage

\marginnote{\blindtext}% \blindtext

\end{document}

  • 2
    Have you checked the todonotes package? If I remember correctly, it is built upon tikz and it allows a lot of customization. – Jes Jun 27 '23 at 23:58
  • Maybe https://tex.stackexchange.com/questions/295903/refer-to-a-node-in-tikz-that-will-be-defined-in-the-future-two-passes can suggest a possible starting point – Rmano Jun 28 '23 at 07:35

0 Answers0