TransWikia.com

Adjusting page width/margins in paracol

TeX - LaTeX Asked by anakhro on January 6, 2021

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.2linewidth} 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.2linewidth}
    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.2linewidth} in the commented part didn’t yield a change in the margins.

2 Answers

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}

Answered by leandriis on January 6, 2021

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.2textwidth-columnsep,dimexpr 0.6textwidth-0.5columnsep}

begin{document}
begin{paracol}{3}
sloppy
switchcolumn[1]
  lipsum[1]
switchcolumn[2]
  lipsum[2]
end{paracol}
end{document}

Answered by John Kormylo on January 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP