1

I have a big problem to insert a Image in a Margin note. Here is the problem: The Image overlap with other non-images notes, how avoid it?enter image description here

\documentclass[14pt]{article}
\usepackage[a4paper, nofoot,includeall,left=0.5cm, right=0cm, top=0cm,bottom=0.5cm,marginparsep=0pt,headsep=0pt,marginparwidth=170pt,headheight=20pt,]{geometry}

\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\pagestyle{fancy}% Change page style to fancy
\fancyhf{}% Clear header/footer
\lhead{\thepage}
\rhead{\leftmark}
\chead{Title Book}
\usepackage{lipsum}

 \usepackage[right]{lineno}
 \usepackage{blindtext}



%\fancyhead[C]{Header}

\usepackage{marginnote}
 \usepackage[right]{lineno}


\newcounter{mynote}% a new counter for use in margin notes

\newcommand{\mynote}[2][0]{% a simple margin note
    \refstepcounter{mynote}% step counter
    \mbox{\textsuperscript{\themynote}}% the number (superscript) in text
    \marginnote{\setlength\leftskip{1cm}\mbox{\textsuperscript{\themynote}}#2}[#1\baselineskip]% the note
}
\makeatletter

\usepackage{fontspec}
%\defaultfontfeatures{Ligatures=TeX}
%\usepackage{showframe}
%\usepackage{hyperref}
%\usepackage{longtable}
\usepackage{textcomp}
%\usepackage{etoolbox}
%\patchcmd{\@startsection}{\@ifstar}{\nolinenumbers\@ifstar}{}{}
%\patchcmd{\@xsect}{\ignorespaces}{\linenumbers\ignorespaces}{}{}
%\makeatother
\usepackage{titlesec}

\usepackage{graphicx}

 \titleformat{\section}[block]{\normalsize\filcenter\nolinenumbers}{}{1em}{}


\setmainfont{KadmosU}

\edef\marginnotetextwidth{\the\textwidth}

\begin{document}



\linenumbers

\section{Aqui II}

 Lorem ipsum dolor sit amet\mynote{here one note}, consectetur adipiscing elit. Nulla a felis a nulla aliquet varius. Fusce eget pretium lacus. Nulla\mynote{here another} leo massa, efficitur cursus dictum a, rutrum non ipsum. Proin condimentum, odio et dictum varius, ante sem mattis est, vitae congue odio metus nec nibh. Integer euismod viverra condimentum.\mynote{\includegraphics[width=30mm ,scale=0.1]{Alexander}}Aliquam erat volutpat. Donec ut sapien fringilla, convallis sem quis, malesuada metus. Quisque mollis iaculis erat a egestas\mynote{other}. Nullam lacinia tortor ac vehicula pellentesque. Aliquam sollicitudin viverra ultricies. Sed tincidunt ex dolor, ac malesuada metus commodo id. Cras porttitor in dolor a dapibus. Proin sagittis velit in ligula consequat, at interdum erat rhoncus.

\section{Aqui I} 

Suspendisse ac viverra augue. Quisque posuere vehicula elementum. Suspendisse potenti. Etiam ac posuere arcu. Nulla convallis magna vel massa fringilla, ut rutrum orci lobortis. Pellentesque mi nibh, rutrum at pulvinar a, scelerisque sed velit. In hac habitasse platea dictumst. Etiam rhoncus dolor lacus. Nam ac lacus id mauris vehicula lobortis quis vel arcu. Nulla vestibulum, turpis quis posuere mattis, diam arcu dictum magna, non laoreet mauris purus non purus. Aliquam eu lacus sit amet velit auctor vulputate. Nulla non sapien blandit, mattis metus in, congue ante. Nam interdum, nunc dignissim fringilla dictum, libero tortor feugiat leo, nec elementum purus arcu sit amet justo. 

\newpage

Lorem ipsum dolor sit amet\mynote{here one note}, consectetur adipiscing elit. Nulla a felis a nulla aliquet varius. Fusce eget pretium lacus. Nulla\mynote{here another} leo massa, efficitur cursus dictum a, rutrum non ipsum. Proin condimentum, odio et dictum varius, ante sem mattis est, vitae congue odio metus nec nibh. Integer euismod viverra condimentum. Aliquam erat\mynote{other} volutpat. Donec ut sapien fringilla, convallis sem quis, malesuada metus. Quisque mollis iaculis erat a egestas. Nullam lacinia tortor ac vehicula pellentesque. Aliquam sollicitudin viverra ultricies. Sed tincidunt ex dolor, ac malesuada metus commodo id. Cras porttitor in dolor a dapibus. Proin sagittis velit in ligula consequat, at interdum erat rhoncus.

Suspendisse ac viverra augue. Quisque posuere vehicula elementum. Suspendisse potenti. Etiam ac posuere arcu. Nulla convallis magna vel massa fringilla, ut rutrum orci lobortis. Pellentesque mi nibh, rutrum at pulvinar a, scelerisque sed velit. In hac habitasse platea dictumst. Etiam rhoncus dolor lacus. Nam ac lacus id mauris vehicula lobortis quis vel arcu. Nulla vestibulum, turpis quis posuere mattis, diam arcu dictum magna, non laoreet mauris purus non purus. Aliquam eu lacus sit amet velit auctor vulputate. Nulla non sapien blandit, mattis metus in, congue ante. Nam interdum, nunc dignissim fringilla dictum, libero tortor feugiat leo, nec elementum purus arcu sit amet justo. 
\end{document}
  • 1
    Overlap is a problem inherent in \marginnotes. \marginpar does not have that problem, but has other restrictions. See also tex.stackexchange.com/questions/215322/… – John Kormylo Apr 26 '18 at 3:23
  • That is really terrible, I changed to sidenotes package. Work better for me. – Gergian May 4 '18 at 13:21

Your Answer

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

Browse other questions tagged or ask your own question.