3

Is it possible to have a margin note to the left of the left column on the second page with this code and approximately halfway down the page? I cannot get it to show up using \marginpar or the marginnote package. I want the rest of the document to look approximately the same. I am using the multicol package because I don't want the entire document to be two columns just the second page.

\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}
loremipsum@gmail.com \\
\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}
  • You could use the twocolumn class option and use the \onecolumn and \twocolumn switches to change layouts through the document, but that still doesn't fix the fact that a \marginpar is not allowed within mdframed environments. Is manual positioning of the note acceptable? – Paul Gessler Jan 31 '14 at 6:27
  • However, \marginnote does work inside mdframed, so that is a solution. It does affect your manual spacing between the figures though. I can post my work as an answer if you'd like to see what I did. – Paul Gessler Jan 31 '14 at 6:45
  • Yes please. I would love to see what you did. Thank you. – David Caliri Jan 31 '14 at 7:05
4

Since you want only this part in two columns, the best choice is the one you've made, in my opinion (use multicols).

You have to use \reversemarginpar otherwise the margin par will be printed on the right.

Also, adjusting the vertical offset through the second optional argument of \marginnote gives the correct positioning.

MWE

\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}
loremipsum@gmail.com \\
\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} 

Output

enter image description here

In regards of the vertical offset, it should be a multiple of \baselineskip. You should calculate -0.5\baselineskip for each line in the margin par.

2

Here's what I used:

\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}
loremipsum@gmail.com \\
\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}

With output: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.