5

In the following example, there is space after the paracol environment. How do you smash the space after the environment so that the lower rule is snuggly fit against the paracol environment just like the upper rule is?

\documentclass[a4paper]{article}
\usepackage{polyglossia}
\usepackage{xcolor}
\usepackage{paracol}
\usepackage{duckuments}

\backgroundcolor{c(1pt,0pt)(1pt,0pt)}[rgb]{0.85,0.95,1}
\newcommand*{\myrule}{\noindent\hfil\rule{0.8\textwidth}{.4pt}\hfil}

\begin{document}
    \myrule
    \begin{paracol}{2}
        \sloppy
        \switchcolumn[0]*
        \blindduck[1]
        \switchcolumn[1]
        \blindduck[2]
    \end{paracol}
    \myrule
\end{document}

good rule bad rule

  • you are setting the rule as a paragraph and from your image the baseline to baseline spacing of the top and bottom rules look similar (the base spacing is slightly over sized because of the descender in y – David Carlisle Jun 18 '18 at 20:43
  • Oh, right. There probably is space above the top rule, then, too. What is the descender in y? I think I'll just try to raise \myrule by 0.5\baselineskip. Would that position it in the center of the (paragraph) text line? – thymaro Jun 18 '18 at 20:47
  • @DavidCarlisle hmm... not quite. \rule[0.5\baselineskip]{0.8\textwidth}{.4pt} raises it too high, so that the space between rule 1 and paracol is wider than between paracol and rule 2. – thymaro Jun 18 '18 at 20:49
  • because you have boxed the text the it looks like the bottom rule is baselineskip below the coloured box, not baselineskip below the last baseline in the box, these are different because y in the last line has a tail "descender" below the baseline which moves the bottom of the colour box away from the baseline of the last row of text. – David Carlisle Jun 18 '18 at 20:58
8

enter image description here

\documentclass[a4paper]{article}
\usepackage{polyglossia}
\usepackage{xcolor}
\usepackage{paracol}
\usepackage{duckuments}

\backgroundcolor{c(1pt,0pt)(1pt,0pt)}[rgb]{0.85,0.95,1}
\newcommand*{\myrule}{\noindent\hfil\rule{0.8\textwidth}{.4pt}\hfil}

\begin{document}
    \myrule
    \begin{paracol}{2}
        \sloppy
        \switchcolumn[0]*
        \blindduck[1]
        \switchcolumn[1]
        \blindduck[2]
    \end{paracol}
    \nointerlineskip\myrule
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.