
我遇到了一個問題,即頁邊註釋與書的偶數頁上的行號發生衝突。我想調整頁邊距,以便筆記可以保留在原來的位置。我認為這意味著我需要增加偶數頁上的外邊距和 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
這裡有兩個問題:
- 寬度
marginpar
小於容納頁邊註記所需的寬度。這可以透過使用設定寬度來解決geometry
。 - 行號和音符正在爭奪同一領域。
有兩個明顯的解決方案。一種是翻轉頁碼,使其與頁邊註解相反:
\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}