Using a Color Package with the Parallel Package

colorparallel

I am compiling a dual language document in LaTeX using the Parallel package. I am having trouble applying a color package to the parallel columns. For my project, I have several places where it is customary to color words or phrases of text (red in this case) to offset them from the other text. Using the Parallel package, when there is a line break in the colored text, the color spills over onto the opposite column, as in the included MWE. In the example, only the right (English) column includes a red phrase, but the color red is included in both columns of the parallel environment. This project must be compiled using the LuaLaTeX+se engine based on the requirements of other packages not included in this MWE.

Parallel and Color

\documentclass[12pt]{book}

\usepackage[paperwidth=8.5in, paperheight=11.0in, margin=1.5in, top=1in, bottom=.5in, footskip=.1in]{geometry}

\usepackage[latin, english]{babel}

\usepackage{libertine}

\usepackage{parallel}

\usepackage{lettrine}

\usepackage{xcolor}

\begin{document}
\begin{Parallel}{}{}
\tolerance=1000

\ParallelLText{
\selectlanguage{latin}
\setlength{\linewidth}{\hsize}\lettrine{L}orem ipsum dolor sit amet, consectetur adipiscing elit. Nullam accumsan ac lorem sit amet consequat. Nulla faucibus sed neque sit amet sollicitudin. Suspendisse ornare eros in nulla mattis, at dictum felis vestibulum. Proin efficitur lectus eu odio hendrerit, eget faucibus mi mattis. Mauris sem odio, efficitur tristique diam pretium, dictum maximus magna. Donec dictum a odio vel rhoncus. In ultricies libero gravida nulla sodales sollicitudin. Praesent urna risus, varius sit amet laoreet et, hendrerit at enim. Pellentesque id ex vel sapien pulvinar molestie in non dolor. Nulla luctus ultricies augue at fermentum. Suspendisse commodo dignissim turpis, eu condimentum tellus gravida sit amet. Phasellus et magna suscipit, cursus velit at, ultricies dui.
}

\ParallelRText{
\selectlanguage{english}
\setlength{\linewidth}{\hsize}\lettrine{B}ut I must explain to you how all this mistaken idea of denouncing of a pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, \textcolor{red}{but because those who do not know} how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.
}
\end{Parallel}

\end{document}

Best Answer

If luatex is a possibility you could use luacolor =

enter image description here

\documentclass[12pt]{book}

\usepackage[paperwidth=8.5in, paperheight=11.0in, margin=1.5in, top=1in, bottom=.5in, footskip=.1in]{geometry}

\usepackage[latin, english]{babel}

\usepackage{libertine}

\usepackage{parallel}

\usepackage{lettrine}

\usepackage{luacolor}

\begin{document}
\begin{Parallel}{}{}
\tolerance=1000

\ParallelLText{
\selectlanguage{latin}
\setlength{\linewidth}{\hsize}\lettrine{L}orem ipsum dolor sit amet, consectetur adipiscing elit. Nullam accumsan ac lorem sit amet consequat. Nulla faucibus sed neque sit amet sollicitudin. Suspendisse ornare eros in nulla mattis, at dictum felis vestibulum. Proin efficitur lectus eu odio hendrerit, eget faucibus mi mattis. Mauris sem odio, efficitur tristique diam pretium, dictum maximus magna. Donec dictum a odio vel rhoncus. In ultricies libero gravida nulla sodales sollicitudin. Praesent urna risus, varius sit amet laoreet et, hendrerit at enim. Pellentesque id ex vel sapien pulvinar molestie in non dolor. Nulla luctus ultricies augue at fermentum. Suspendisse commodo dignissim turpis, eu condimentum tellus gravida sit amet. Phasellus et magna suscipit, cursus velit at, ultricies dui.
}

\ParallelRText{
\selectlanguage{english}
\setlength{\linewidth}{\hsize}\lettrine{B}ut I must explain to you how all this mistaken idea of denouncing of a pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, \textcolor{red}{but because those who do not know} how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.
}
\end{Parallel}

\end{document}
Related Question