
Tengo un pequeño problema con las notas al margen que chocan con los números de línea en las páginas pares de un libro. Me gustaría ajustar los márgenes para que las notas permanezcan donde están. Creo que esto significa que necesito aumentar el margen exterior y el margen parsep en páginas pares.
A continuación se incluye un ejemplo de trabajo mínimo:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{lineno}
\usepackage{geometry}
\usepackage{marginnote}
\title{lineNumbersAndMarginNotes}
\begin{document}
\begin{linenumbers*}
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginpar{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\newpage
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginnote{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\end{linenumbers*}
\end{document}
Lo que más me interesa es cómo afectar la geometría en las páginas pares. Gracias,
Respuesta1
Hay 2 problemas aquí:
- El
marginpar
ancho es menor de lo necesario para dar cabida a las notas al margen. Esto se puede solucionar configurando el ancho usandogeometry
. - Los números de línea y las notas compiten por el mismo territorio.
Hay 2 soluciones obvias. Una es voltear los números de página para que queden opuestos a las notas al margen:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[switch*]{lineno}
\usepackage[marginparwidth=12.5ex]{geometry}
\usepackage{marginnote}
\title{lineNumbersAndMarginNotes}
\begin{document}
\begin{linenumbers*}
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginpar{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\vfill
\newpage
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginnote{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\end{linenumbers*}
\end{document}
Esto tiene la ventaja de la simetría.
Alternativamente, puede alterar la alineación de las notas al margen, aumentando aún más el tamaño para marginpar
acomodar los números de línea y las notas cuando sea necesario:
\usepackage{lineno}
\usepackage[marginparwidth=15ex]{geometry}
\usepackage{marginnote}
\renewcommand*{\raggedleftmarginnote}{\raggedright}
\renewcommand*{\raggedrightmarginnote}{\raggedleft}
También recomendaría no justificar el texto dentro de las notas, ya que esto no funcionará bien con un ancho tan reducido. Usar ragged2e
también podría ayudar.
Respuesta2
Puede aumentar el marginparsep
uso geometry
del paquete:
\usepackage[marginparsep=7mm]{geometry} %% adjust 7mm at will
Código:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{lineno}
\usepackage[marginparsep=7mm]{geometry}
\usepackage{marginnote}
\title{lineNumbersAndMarginNotes}
\begin{document}
\begin{linenumbers*}
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginpar{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\newpage
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginnote{\fbox{\parbox{10ex}{Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\end{linenumbers*}
\end{document}
Es posible que desee colocarlo \raggedright
dentro \parbox
y ajustarlo marginparwidth
también para su conveniencia.
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{lineno}
\usepackage[marginparwidth=12ex,marginparsep=7mm]{geometry}
\usepackage{marginnote}
\title{lineNumbersAndMarginNotes}
\begin{document}
\begin{linenumbers*}
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginpar{\fbox{\parbox{10ex}{\raggedright Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\newpage
Here is some text that has line numbers, the text is not important, but it needs to have a few lines otherwise it won't demonstrate the issue I would like to figure out. I don't just want a plug in solution\marginnote{\fbox{\parbox{10ex}{\raggedright Here is a margin note, I think}}}, I'd really like to understand how to get the \texttt{geometry} package to act differently on odd and even pages.
\end{linenumbers*}
\end{document}