Номера строк конфликтуют с заметками на полях на четных страницах книги

Номера строк конфликтуют с заметками на полях на четных страницах книги

У меня небольшая проблема с заметками на полях, которые накладываются на номера строк на четных страницах книги. Я хотел бы настроить поля так, чтобы заметки оставались там, где они есть. Я думаю, это означает, что мне нужно увеличить внешние поля и marginparsep на четных страницах.

Ниже приведен минимальный рабочий пример:

\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}

Меня больше всего интересует, как повлиять на геометрию на четных страницах. Спасибо,

решение1

Здесь есть 2 проблемы:

  1. Ширина marginparменьше, чем нужно для размещения заметок на полях. Это можно исправить, задав ширину с помощью geometry.
  2. Номера строк и ноты конкурируют за одну и ту же территорию.

Есть 2 очевидных решения. Одно из них — перевернуть номера страниц так, чтобы они были противоположны заметкам на полях:

\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}

перевернутые числа

Преимущество этого решения заключается в симметрии.

В качестве альтернативы вы можете изменить выравнивание заметок на полях, увеличив их размер, marginparчтобы разместить номера строк и примечания при необходимости:

\usepackage{lineno}
\usepackage[marginparwidth=15ex]{geometry}
\usepackage{marginnote}
\renewcommand*{\raggedleftmarginnote}{\raggedright}
\renewcommand*{\raggedrightmarginnote}{\raggedleft}

заново выровненные заметки на полях

Я бы также рекомендовал не выравнивать текст внутри заметок, так как это не будет работать хорошо при такой узкой ширине. Использование ragged2eтакже может помочь.

решение2

Вы можете увеличить marginparsepиспользуемый geometryпакет:

\usepackage[marginparsep=7mm]{geometry}   %% adjust 7mm at will

Код:

\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}

введите описание изображения здесь

Вы можете также поместить \raggedrightвнутрь \parboxи отрегулировать marginparwidthдля вашего удобства.

\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}

введите описание изображения здесь

Связанный контент