0

I can't seem to find an appropriate option in the paracol documentation, but I was wondering if there is a way to easily adjust the margins using the paracol package or if I have to do some external solution (like using the geometry package, such as Change \textwidth and \textheight in mid-document, but note this doesn't seem to work for mid-page). That is, I want the paracol part to be wider (mid-page) relative to the rest of the text (in particular, cutting into the left margin).

For context, I was using two mdframes in minipages to get them side by side. To adjust the margins, I (dirtily) used \hspace*{-0.2\linewidth} or something like that until I was happy how much it cut into the left margin (I didn't care about the right margin). I switched to paracol instead of minipages so that my environment would work across page breaks, but now I can't figure out how to adjust the paracol part so it has a different left margin (that is, the left margin of the page itself is smaller).

Thanks!

EDIT: here is sort of the thing I am testing with:

\usepackage{paracol}
\usepackage{mdframed}

\newenvironment{env}[1][]
{
    % \hspace*{-0.2\linewidth}
    \begin{paracol}{2}      
        \begin{leftcolumn}
            \begin{mdframed}
                {#1}
            \end{mdframed}
        \end{leftcolumn}

        \begin{rightcolumn}
            \begin{mdframed}
}           
{
            \end{mdframed}
        \end{rightcolumn}
    \end{paracol}
}

And as I said, inputting \hspace*{-0.2\linewidth} in the commented part didn't yield a change in the margins.

anak
  • 155
  • 7

2 Answers2

1

With the help of the adjustwidth environment from the changepage package you can achieve the following:

enter image description here

\documentclass{book}
\setlength{\parindent}{0pt}
\usepackage{lipsum}
\usepackage{paracol}
\usepackage{changepage}
\begin{document}

\begin{paracol}{2}

\lipsum[4]

\switchcolumn

Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u

\switchcolumn*
\begin{adjustwidth}{-1.5cm}{0cm} 
\lipsum[1]
\end{adjustwidth}
\switchcolumn

\lipsum[4]

\switchcolumn*

\lipsum[4]

\switchcolumn

Nam nibh leo, scelerisque quis ex a, venenatis iaculis libero. Integer neque libero, interdum quis nisl id, accumsan semper tortor. Aenean cursus quam sit amet nibh rhoncus tempor u


\end{paracol}
\end{document}
leandriis
  • 62,593
  • Nice! Indeed this works, but I will hold out until any paracol gurus show their faces. – anak Oct 03 '19 at 23:22
0

One can add a third (empty) column with a negative width.

\documentclass{article}
\usepackage{paracol}
\usepackage{lipsum}% MWE only
\usepackage{showframe}% MWE only

\setcolumnwidth{\dimexpr -0.2\textwidth-\columnsep,\dimexpr 0.6\textwidth-0.5\columnsep}

\begin{document}
\begin{paracol}{3}
\sloppy
\switchcolumn[1]
  \lipsum[1]
\switchcolumn[2]
  \lipsum[2]
\end{paracol}
\end{document}
John Kormylo
  • 79,712
  • 3
  • 50
  • 120