It is a bug in package parallel
. \linewidth
is not set correctly. Environment enumerate
thinks, it could use the full \textwidth
and as result the left and right parts overprint each other:
\documentclass{article}
\usepackage{color}
\usepackage{parallel}
\begin{document}
\begin{Parallel}{0.45\textwidth}{0.45\textwidth}
\ParallelLText{
\textcolor{red}{Bonds}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item \qquad Left text
\item lll
\end{enumerate}
}
\ParallelRText{
\textcolor{red}{Stocks}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item rrr
\item \qquad Right text
\end{enumerate}
}
\ParallelPar
\end{Parallel}
\end{document}
Solution
Package pdfcolparallel
fixes this bug by setting \linewidth
to the correct value.
If pdfTeX in PDF mode is used, it also adds support for pdfTeX's multiple color stacks for fixing color problems.
\documentclass{article}
\usepackage{color}
\usepackage{pdfcolparallel}
\begin{document}
\begin{Parallel}{0.45\textwidth}{0.45\textwidth}
\ParallelLText{
\textcolor{red}{Bonds}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item \qquad Left text
\item lll
\end{enumerate}
}
\ParallelRText{
\textcolor{red}{Stocks}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item rrr
\item \qquad Right text
\end{enumerate}
}
\ParallelPar
\end{Parallel}
\end{document}
With vertical line
Also the color of the vertical line can be changed with package pdfcolparallel
:
\documentclass{article}
\usepackage{color}
\usepackage{pdfcolparallel}
\setkeys{parallel}{rulebetweencolor=blue}
\begin{document}
\begin{Parallel}[v]{0.45\textwidth}{0.45\textwidth}
\ParallelLText{
\textcolor{red}{Bonds}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item \qquad Left text
\item lll
\end{enumerate}
}
\ParallelRText{
\textcolor{red}{Stocks}
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item rrr
\item \qquad Right text
\end{enumerate}
}
\ParallelPar
\end{Parallel}
\end{document}
With package hyperref
Package hyperref
needs to add specials to support links and anchors. However these "specials" disrupt the method of package parallel
. In this case, the anchors for the items of environment enumerate
are probably not needed, thus they can be disabled by environment NoHyper
:
\documentclass[12pt,a4paper,final]{book}
\usepackage[utf8]{inputenc}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{color}
\usepackage{pdfcolparallel}
\setkeys{parallel}{rulebetweencolor=blue}
\usepackage{hyperref} % for bookmark
\usepackage{bookmark}
\hypersetup{
unicode, % non-Latin characters in Acrobat's bookmarks
pdftoolbar=true, % show Acrobat's toolbar?
pdfmenubar=true, % show Acrobat's menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={My title}, % title
pdfauthor={Author}, % author
pdfsubject={Subject}, % subject of the document
pdfcreator={Creator}, % creator of the document
pdfproducer={Producer}, % producer of the document
pdfkeywords={keyword1} {key2} {key3}, % list of keywords
pdfnewwindow=true, % links in new window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=blue, % color of internal links (change box color with linkbordercolor)
citecolor=green, % color of links to bibliography
filecolor=magenta, % color of file links
urlcolor=cyan % color of external links
}
\begin{document}
\pagenumbering{roman}
\cleardoublepage
\pdfbookmark{\contentsname}{Contents}
\tableofcontents
\chapter{Fundamental differences}\hfill
\section{Bonds vs stocks}
\begin{Parallel}[v]{0.45\textwidth}{0.45\textwidth}
\ParallelLText{
\textcolor{red}{Bonds}%
\begin{NoHyper}%
\begin{enumerate}
\item Not a share of ownership
\item Fixed maturity
\item Contractual payment
\item Bondholders acquire decision rights in default states.
\end{enumerate}%
\end{NoHyper}%
}
\ParallelRText{
\textcolor{red}{Stocks}%
\begin{NoHyper}%
\begin{enumerate}
\item Share of ownership.
\item Not maturity.
\item No contractual payment.
\item Stockholders have decision rights as long as the firm is solvent.
\end{enumerate}%
\end{NoHyper}%
}
\ParallelPar
\end{Parallel}
\end{document}
As the documentation of mdwlist
shows, you need to repeat the optional argument to enumerate
in this situation; it needs a couple of extra level of brackets:
\documentclass{article}
\usepackage{enumerate,mdwlist}
\begin{document}
\begin{enumerate}[I]
\item Item
\item Item
\suspend{enumerate}
Text in between...
\resume{enumerate}[{[I]}]
\item Item
\item Item
\end{enumerate}
\end{document}
Alternatively you can used the enumitem
package with the shortlabels
option to get the same syntax for specifying labels in enumerate
and use its resume*
option for the resumed list.
\documentclass{article}
\usepackage[shortlabels]{enumitem}
\begin{document}
\begin{enumerate}[I]
\item Item
\item Item
\end{enumerate}
Text in between...
\begin{enumerate}[resume*]
\item Item
\item Item
\end{enumerate}
\end{document}
Best Answer
There are a number of ways. Here's using the
enumerate
package:Here's another method via the
enumitem
package. It yields the same output as above:And then, without any packages: