书中偶数页的行号与边注相冲突

书中偶数页的行号与边注相冲突

我遇到了一个问题,书的偶数页边距注释与行号冲突。我想调整页边距,以便注释可以保留在原处。我想这意味着我需要增加偶数页的外边距和 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. 行号和注释正在争夺同一块地盘。

有两个明显的解决方案。一是翻转页码,使其与边注相反:

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

在此处输入图片描述

相关内容