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.

4
  • Could you please add a minimal working example (MWE) that shows what you have tried so far?
    – leandriis
    Commented Oct 3, 2019 at 20:59
  • Paracol has to be in outer par mode, like floats. For example, you cannot put one inside a minipage. Why not just use tabularx with two X columns? Commented Oct 4, 2019 at 0:49
  • @JohnKormylo does tabularx break across pages (unlike minipage)? I noticed I couldn't put marginnotes in paracol due to something about floats (I don't quite understand what floating is, just that apparently you cannot do nested floats?).
    – anak
    Commented Oct 4, 2019 at 2:49
  • Tabularx does not break across pages but you can use xltabular in this case.
    – leandriis
    Commented Oct 4, 2019 at 5:03

2 Answers 2

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}
1
  • Nice! Indeed this works, but I will hold out until any paracol gurus show their faces.
    – anak
    Commented Oct 3, 2019 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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .