
Estou tendo um problema com notas de margem colidindo com números de linha nas páginas pares de um livro. Gostaria de ajustar as margens para que as notas fiquem onde estão. Acho que isso significa que preciso aumentar a margem externa e o marginparsep nas páginas pares.
Um exemplo mínimo de trabalho está incluído abaixo:
\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}
Estou mais interessado em como afetar a geometria nas páginas pares. Obrigado,
Responder1
Existem 2 problemas aqui:
- A
marginpar
largura é menor do que o necessário para acomodar as notas de margem. Isso pode ser corrigido definindo a largura usandogeometry
. - Os números das linhas e as notas competem pelo mesmo território.
Existem 2 soluções óbvias. Uma é virar os números das páginas para que fiquem opostos às notas de margem:
\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}
Isso tem a vantagem da simetria.
Alternativamente, você pode alterar o alinhamento das notas de margem, aumentando ainda mais o tamanho marginpar
para acomodar os números das linhas e as notas quando necessário:
\usepackage{lineno}
\usepackage[marginparwidth=15ex]{geometry}
\usepackage{marginnote}
\renewcommand*{\raggedleftmarginnote}{\raggedright}
\renewcommand*{\raggedrightmarginnote}{\raggedleft}
Eu também recomendaria não justificar o texto dentro das notas, pois isso não funcionará bem com uma largura tão estreita. Usar ragged2e
também pode ajudar.
Responder2
Você pode aumentar o pacote marginparsep
usando geometry
:
\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}
Você pode colocar \raggedright
dentro \parbox
e ajustar marginparwidth
também para sua conveniência.
\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}