使用此代码是否可以在第二页左栏左侧以及页面大约一半的位置添加边注?我无法使用\marginpar
或marginnote
包显示它。我希望文档的其余部分看起来大致相同。我使用multicol
包是因为我不希望整个文档只有第二页有两栏。
\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{xspace}
\usepackage{marginnote}
\usepackage{lipsum}
\renewcommand{\footrulewidth}{0.4pt}
\geometry{headheight = 0.7in}
\pagestyle{fancy}{\fancyhf{}\fancyhead[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}\fancyfoot[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}}
\fancyhead[C]{\Huge{Lorem Ipsum} \\ \Large{Dolor sit amet}}
\fancyfoot[C]{loremipsum.com \\
\vspace{.1in}
[email protected] \\
\vspace{.1in}
555-555-5555}
\begin{document}
\lipsum[1]
\newpage
\begin{multicols}{2}
\begin{mdframed}[linecolor=black!30,backgroundcolor=black!5]
\begin{center}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\end{center}
\end{mdframed}
\columnbreak
\lipsum[1]
\end{multicols}
\end{document}
答案1
由于您只希望将这一部分分为两列,因此我认为最好的选择就是您做出的选择(使用multicols
)。
您必须使用\reversemarginpar
,否则边距部分将会打印在右侧。
另外,通过第二个可选参数调整垂直偏移可以\marginnote
得到正确的定位。
平均能量损失
\documentclass{article}
\usepackage[demo]{graphicx} % remove demo option in your document
\usepackage{fancyhdr}
\usepackage{geometry}
\usepackage{multicol}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{xspace}
\usepackage{marginnote}
\usepackage{lipsum}
\renewcommand{\footrulewidth}{0.4pt}
\geometry{headheight = 0.7in}
\pagestyle{fancy}{\fancyhf{}\fancyhead[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}\fancyfoot[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}}
\fancyhead[C]{\Huge{Lorem Ipsum} \\ \Large{Dolor sit amet}}
\fancyfoot[C]{loremipsum.com \\
\vspace{.1in}
[email protected] \\
\vspace{.1in}
555-555-5555}
\begin{document}
\lipsum[1]
\newpage
\begin{multicols}{2}
\begin{mdframed}[linecolor=black!30,backgroundcolor=black!5]
\begin{center}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\reversemarginpar\marginnote{This is a marginal note}[-\baselineskip]
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\end{center}
\end{mdframed}
\columnbreak
\lipsum[1]
\end{multicols}
\end{document}
输出
至于垂直偏移,它应该是的倍数\baselineskip
。您应该-0.5\baselineskip
为边距部分的每一行计算。
答案2
以下是我使用的方法:
\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx} % demo option since I didn't have your placeholder file
\usepackage{fancyhdr}
\usepackage[showframe]{geometry}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{marginnote}
\usepackage{lipsum}
\renewcommand{\footrulewidth}{0.4pt}
\geometry{headheight = 0.7in,marginparwidth=10ex}% adjusted marginparwidth to fit note
\pagestyle{fancy}{\fancyhf{}\fancyhead[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}\fancyfoot[LR]{\includegraphics[height=0.7in, keepaspectratio=true]{placeholder}}}
\fancyhead[C]{\Huge{Lorem Ipsum} \\ \Large{Dolor sit amet}}
\fancyfoot[C]{loremipsum.com \\
\vspace{.1in}
[email protected] \\
\vspace{.1in}
555-555-5555}
\begin{document}
\onecolumn % put output into one column mode
\lipsum[1]
\newpage\twocolumn % revert to two column for this page
\begin{mdframed}[linecolor=black!30,backgroundcolor=black!5]
\begin{center}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}\reversemarginpar\marginnote{Test.}%
\vspace{.05in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\vspace{.1in}
\includegraphics[height=1.75in, keepaspectratio=true]{placeholder}
\end{center}
\end{mdframed}
\vfill\break
\lipsum[1]
%\onecolumn % uncomment after end of twocolumn page to revert to one column for the remainder
\end{document}
输出: