I'm working on some presentation slides in ConTeXt and I can't figure out how to achieve top/bottom/middle vertical alignment of multiline content across two columns. Further complicating the issue is that I am using global vertical alignment using a makeup (which seems to throw off columnset).
I have tried 3 things, all of which have some issues (example code below):
paragraphs
don't seem to have any alignment support (and using them for multiline content seems to abuse what they are meant for)placefigure
combined withcombination
allows for different alignment options, but doesn't seem to support multiline content (I also tried adding avbox
, but that throws off the horizontal spacing)columnset
makes document compilation freeze if placed within a makeup (and doesn't seem to support vertical alignment anyway)
Example code using a couple of tikz pictures. I would like the option to align the two columns vertically by top/bottom/middle:
%&context
% Loading tikz
\usemodule[tikz]
\usemodule[pgfplots]
% Define vertical centering
\definemakeup[Center]
\starttext
%------------------------------------------------------------------------
% Paragraph
\defineparagraphs[ParColumns][n=2]
\setupparagraphs[ParColumns][1][width=.5\textwidth]
% no way to define vertical alignment?
\startCentermakeup
\startParColumns
\starttikzpicture
\node[draw, minimum height=1cm] (test1) {Left graphic};
\stoptikzpicture
\blank[small]
Some descriptive text
\nextParColumns
\starttikzpicture
\node[draw, minimum height=3cm] (test2) {Right graphic};
\stoptikzpicture
\stopParColumns
\stopCentermakeup
\stoptext
Using placefigure
without vbox
around left side content removes the linebreak between left graphic and text. Adding vbox
around the content introduces a massive horizontal space.
%&context
% Loading tikz
\usemodule[tikz]
\usemodule[pgfplots]
% Define vertical centering
\definemakeup[Center]
\starttext
%------------------------------------------------------------------------
% Combinations
\startCentermakeup
\placefigure[here,none]{}{
\startcombination[2*1, location=middle]
{
\starttikzpicture
\node[draw, minimum height=1cm] (test1) {Left graphic};
\stoptikzpicture
\blank[small]
Some descriptive text
}{}
{
\starttikzpicture
\node[draw, minimum height=3cm] (test2) {Right graphic};
\stoptikzpicture
}{}
\stopcombination
}
\stopCentermakeup
\stoptext
This is what happens if I add vbox
(with frame for clarity):