1

I have these troubles about margin notes. This is the code:

\documentclass[openany]{book}
\usepackage{color,xcolor}
\usepackage{marginnote}
\usepackage{lipsum}
\usepackage[colorlinks=true]{hyperref}

\title{Margin Notes}
\author{PUCK}
\date{May 2023}

\begin{document}

\maketitle

\section{Introduction}

\lipsum[1-1]\footnote{Bla bla bla.} \marginnote{\textcolor{blue}{1. } I'd like that this \textit{marginnote} starts at the same line of \textit{Lorem ipsum} ... and I'd like that a number \textcolor{blue}{1.} appears in same position of the footnote but with color blue.}

\lipsum[2-2]\footnote{Bla bla bla.}
\marginnote{\textcolor{blue}{2. }I dislike this right--justification, I prefer the center--justification.}

\end{document}

The output is this:

Margin Notes

I'd like that this \textit{marginnote} starts at the same line of \textit{Lorem ipsum} ... and I'd like that a number \textcolor{blue}{1.} appears in same position of the footnote but with color blue. Moreover I dislike this right--justification, I prefer the center--justification.

Thank you in advanced and I hope my question clear.

FIRST EDIT: I'd like to something like this photo

Margin Notes Hobbit

Is it possible to have this template in pdflatex? Thanks in advanced (again).

1
  • Do you intend to use both footnotes and marginnotes, or just add a \footnotemark at the end of the paragraph? Commented May 19, 2023 at 13:31

1 Answer 1

1

I wasn't sure which way you wanted the links to go, so I make them both two-way links. Note that there is not a lot you can do with hyperref link colors, unless you turn colorlinks off and color them yourself.

\documentclass[openany]{book}
\usepackage{xcolor}
\usepackage{marginnote}
\usepackage{lipsum}
\usepackage[colorlinks=true, linkcolor=blue]{hyperref}

\renewcommand*{\raggedleftmarginnote}{\centering}
\renewcommand*{\raggedrightmarginnote}{\centering}

\newcommand{\mynote}[1]{\refstepcounter{footnote}\marginnote{\raisebox{\baselineskip}[0pt]{%
  \hypertarget{mynote.\thefootnote}{}}\hyperlink{mymark.\thefootnote}{\thefootnote} {#1}}}
\newcommand{\mymark}{\raisebox{\baselineskip}[0pt]{\hypertarget{mymark.\thefootnote}{}}%
  \hyperlink{mynote.\thefootnote}{\footnotemark[\thefootnote]}}

\title{Margin Notes}
\author{PUCK}
\date{May 2023}

\begin{document}

\maketitle

\section{Introduction}

\mynote{I'd like that this \textit{marginnote} starts at the same line of \textit{Lorem ipsum} ... and I'd like that a number \textcolor{blue}{1.} appears in same position of the footnote but with color blue.}
\lipsum[1-1]\mymark

\mynote{I dislike this right--justification, I prefer the center--justification.}
\lipsum[2-2]\mymark

\end{document}
1
  • Thank you so much. How could I do for change the justification?
    – Puck
    Commented May 19, 2023 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .