I have defined an environment for consistently typesetting a pair of alternative assumptions being made. The idea is that wherever I make an assumption, the assumptions are indented and on the left will be one possible assumption and on the right another, different assumption. So I have a way of showing: at this point, we either assume x or y. If we assume x, then abc, if we assume y, then def.
I defined the environment in the following way:
\newcommand{\assuming}[1]{\begin{center}\itshape[#1]\end{center}}
\newenvironment{altassumption}{\begin{center}%
\begin{tabular}{*{2}{p{0.44\textwidth}}}}%
{\end{tabular}\end{center}}
This works well enough, although perhaps I could tweak the output a bit, I'll see. I encountered a bit of a problem with the spacing above and below, however. Observe this MWE:
\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{setspace}
\doublespacing
\newcommand{\assuming}[1]{\begin{center}\itshape[#1]\end{center}}
\newenvironment{altassumption}{\begin{center}%
\begin{tabular}{*{2}{p{0.44\textwidth}}}}%
{\end{tabular}\end{center}}
\begin{document}
Lorem ipsum dolor sit amet, consectetuer
\begin{altassumption}
\assuming{adipiscing elit. Aenean commodo}
Aenean massa. Cum sociis natoque penatibus et magnis dis
ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
&
\assuming{massa quis enim. Donec pede justo,}
fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo,
rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis
eu pede mollis pretium. Integer
\end{altassumption}
tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean
vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat
vitae, eleifend ac, enim.
\begin{altassumption}
laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel
augue. Curabitur ullamcorper ultricies nisi.
&
rhoncus. Maecenas tempus,
\end{altassumption}
tellus eget condimentum rhoncus, sem quam semper libero, sit amet
adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus
pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt
tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis
ante. Etiam sit amet orci
\end{document}
Unfortunately, I've had to use double spacing, because I want to be able to write all over and annotate printed versions of the document.
You can see that the vertical spacing around the first pair of assumptions is very different to that around the second.
As you can see, if we add a few more words to our first assumption, the space below the environment is actually free to be filled up, creating different spacing above the environment to that below.
Lorem ipsum dolor sit amet, consectetuer
\begin{altassumption}
\assuming{adipiscing elit. Aenean commodo}
Aenean massa. Cum sociis natoque penatibus et magnis dis
ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu,
pretium quis, sem. Nulla consequat
&
\assuming{massa quis enim. Donec pede justo,}
fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo,
rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis
eu pede mollis pretium. Integer
\end{altassumption}
tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean
vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat
vitae, eleifend ac, enim.
Clearly, then, this depends on the precise length of the content and clearly I have taken the wrong approach to this environment. Can anyone suggest a fix or an altogether better approach?
pdfparcolumns
for this sort of thing. Thesetspace
package will likely produce some surprising spacing around environments if you aren't careful or in some edge cases (but since this spaced out version is for editing, aesthetics seem rather beside the point).\usepackage[parfill]{parskip}
is a fossilised part of my preamble I've never really questioned! I used it because I want a blank line between paragraphs and no indentation of new paragraphs. A long time ago I must have learned that was the way to do it, and I've honestly never noticed any problems with spacing around tables generally or anything like that\par
(empty line) that you have after “Integer”, which causes an extra line to be added to the (implicit)\parbox
. This essentially happens because you are nesting acenter
environment within another, which isn’t allowed for a reason (interference between\@setpar
and\@restorepar
) that cannot be explained in 600 characters. If you are interested in the details, I can post an answer (when I have time to… :-) .\@restorepar
affair. The new question cites this one.