5

I'm trying to get the baselines of the two adjacent columns here below to be properly aligned. The package grid cannot handle the floats as I want, so I've tried with gridset. It looks like it can do the job but I can't get it to work...

This is the page after it's been typeset using gridset: enter image description here

You can see the last line of the second column is higher than the first.

I Know that setting up a grid system in LaTeX isn't the easiest job but I hope there's a fix for my issue. Any solution is welcome, I'm not restricted to use gridset.


(Not so M)WE:

\documentclass{scrartcl}
\usepackage{lipsum}
\usepackage[utf8]{inputenx}
\usepackage{microtype}
\usepackage[top=.6667in,left=.5in,right=.5in,bottom=.5in]{geometry}
\usepackage{graphicx}
\usepackage[dvipsnames,svgnames,x11names,table]{xcolor}
\usepackage{titling}
  \setlength{\droptitle}{-31.5pt}% aligns the top of the title with the top of the right column
  \preauthor{}
  \author{}
  \postauthor{}
  \predate{}
  \date{}
  \postdate{}
  \pretitle{\noindent\bfseries\fontsize{40pt}{0pt}\selectfont}% the font size can be modified if needed
  \title{Title}
  \posttitle{}
\usepackage{multicol}
  \setlength{\columnsep}{.25in}
  \setlength{\columnseprule}{.4pt}
\usepackage{gridset}
\usepackage{lettrine}
  \renewcommand{\LettrineTextFont}{\upshape}
  \renewcommand{\LettrineFontHook}{\color[gray]{0.5}}
  \setcounter{DefaultLines}{3}
\usepackage[osfI,sups]{XCharter}
\usepackage[T1]{fontenc}

\frenchspacing
\setlength{\parskip}{0pt}
\setlength{\parindent}{1em}

\begin{document}

\begin{figure}[t]
\includegraphics[width=\textwidth]{thepicture}
\end{figure}
\begin{multicols}{2}
\savepos{pos1}
%\theposinfo{pos1}% in my case y=44087932; my picture is 691x137
%\thegridinfo{pos1}
\edef\gridbase{44087932}
\maketitle
\vskipnextgrid
\lettrine{L}{orem} \lipsum
\end{multicols}
\end{document}
CarLaTeX
  • 62,716
Arch Stanton
  • 1,497
  • 2
    This question is almost a duplicate of http://tex.stackexchange.com/questions/53008/align-baseline-in-multicol, but I didn't find an answer there. – Arch Stanton Jun 27 '15 at 16:31
  • There is also grid-system. I thought there was a new package using the l3* stuff but I can't seem to find it so may be imagining it. – cfr Jun 28 '15 at 01:22
  • 1
    Here's the question: where exactly do you want LaTeX to add the vertical space required to get the columns to align? You have basically redefined every element used on that page in a way that removes the stretchy glue which usually gets used as filler. There is no glue around the title (or author or date) and no glue at paragraph breaks. And there is none, really, any place else. If the first column did not include a problematic font size, that would be fine. But 40pt is not, it seems getting you an exact multiple of a regular line. So things cannot possibly be aligned at both top and base. – cfr Jun 28 '15 at 01:35
  • Also, are you sure that combining gridset and multicols is wise? – cfr Jun 28 '15 at 01:43
  • @cfr The space should go between the title and the beginning of the text. I don't know if it's wise to combine these two packages, but afaik my only alternative is to use ConTeXt and I don't know it. I took out the part redefining the \parskip and tried \posttitle{\vspace{0pt plus \baselineskip}}, but it didn't work. – Arch Stanton Jun 28 '15 at 18:45
  • Ideally, if I knew all the vertical spaces between the title and the figure and between the title and the text I could choose a font size such that the sum is a multiple of the \baselineskip (but then I don't know how the font size relates to the text height). I tried to make a complicate thing just for exercise... But I came to like the layout and I'd like to make something out of it, that's why I'm asking for help here. So, thanks :-) – Arch Stanton Jun 28 '15 at 18:51
  • Why can't you use multicols without gridset? – cfr Jun 28 '15 at 18:59
  • @cfr Because the baselines are not aligned with multicols alone. – Arch Stanton Jun 29 '15 at 05:22
  • @cfr Tried without gridset and with \posttitle{\vspace{0pt plus 13.6pt}} (13.6pt being my \baselineskip) and it worked! Does it depend on \flushcolumns now being able to work more freely thanks to the glue? I was a bit careless in effect in redefining all the pre- and post-stuff. Thanks for pointing it out! – Arch Stanton Jun 29 '15 at 07:37
  • 1
    I am not sure but I think so. I think when you redefine everything without any glue, there's nothing for \flushcolumns to work with i.e. there's nothing it can do when they aren't flush. So you are asking it to line stuff up but then specifying everything precisely so that it is impossible to do that. – cfr Jun 29 '15 at 12:04
  • I was too hurry to celebrate... as soon as I replaced the dummy picture with the actual one, different in size, columns were all over the place again. Same code. Jeeeez... – Arch Stanton Jun 29 '15 at 14:14
  • @cfr do you know how to put a glue between the picture and the beginning of the text? A \vspace between \end{figure} and \begin{multicols}{2} makes nothing. – Arch Stanton Jun 29 '15 at 15:04
  • Try \vspace*? – cfr Jun 29 '15 at 15:05
  • \vspace*{0pt plus 13.6pt} brings the text down by well over the 13.6pt I asked. It works like a switch, 0pt plus 13.6pt adds the same space as 0pt plus 1pt. Thanks anyway – Arch Stanton Jun 29 '15 at 15:10
  • \vskip? But I'm not sure that will work. – cfr Jun 29 '15 at 15:37
  • Already tried, it gives an error. – Arch Stanton Jun 29 '15 at 15:48
  • What you're trying to do is done in rvdtx, which uses grid. You won't want to use rvdtx, but you can see what trick they're using to get what you want. – JPi Sep 02 '15 at 13:38
  • Thanks, but I can't really understand it... Is it the definition of the environment decl? I wouldn't know how to use it, however. Just add it in the preamble and put my text inside it? – Arch Stanton Sep 03 '15 at 08:33

0 Answers0