Let me start by saying that this is very similar to a previously posted question, How to keep a constant baselineskip when using minipages (or \parboxes)?, for which egreg gave a very nice solution. But either I'm not thinking through egreg's solution correctly or this is a closely related but nevertheless different question.
Also, I know I am doing things here that are generally frowned upon: namely, I set \parskip
. But, I'm only doing this to create visually what it is that I don't want: LaTeX
to think that I have a new paragraph here. LaTeX
thinking there's a new paragraph does become an issue if, for example, I'm using \everypar
to perform some task at the beginning of every paragraph.
Onto my question:
I occasionally find that I must align minipages
to fill a line after which I do not want a new paragraph but a continuation of the current paragraph. But for some reason the interlinear spacing between the line filled with minipages
and the following line is too small.
I could fix this by inserting \par~
at the end of the apparently offending minipage
, or by using \\[\baselineskip]
at the end of the line. But that opens up too excessive a break and visually creates the appearance of a new paragraph. My desire is not to create that visual break but rather insert the proper interlinear spacing. As mentioned already, egreg's solution introduces a new paragraph which is not what I want. When I try to use egreg's solution without introducing a new paragraph I get an error about being in horizontal mode.
I could put in a strut at the end of the minipage
to add more depth, but I really hate just eye-balling it when it seems I should be able to get the interlinear spacing perfect.
Also, sometimes I can fix this by setting \hangindent
. But there are times when that's really not a feasible solution. Finally, I'd also prefer to avoid using the wrapfig
package because there are other contexts in which I need a similar correction but wrapping is not what is needed.
Here's my MWE:
\documentclass{article}
\usepackage{calc}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{pst-node}
\usepackage[margin=1.25in]{geometry}
%%
\newcommand{\mytext}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.}
\setlength{\parskip}{5ex}
\pagestyle{empty}
\begin{document}
\newsavebox{\righthandmatter}
\begin{lrbox}{\righthandmatter}
\fbox{\begin{minipage}[t]{0.35\linewidth-2\fboxrule-2\fboxsep-2em}
\vspace{-\baselineskip}
\rule[-1cm]{0pt}{2cm} Some image or something
\end{minipage}}
\end{lrbox}
\noindent%
\textbf{Example 1:} Interlinear spacing is undesirably small---see arrow.\\[0.5\baselineskip]
\noindent%
\begin{minipage}[t]{0.65\linewidth}
\raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{A}{$\longrightarrow$}}}
\lipsum[2]
\end{minipage}\hspace*{\fill}%
\usebox{\righthandmatter}
\mytext
\noindent%
\textbf{Example 2:} Following \texttt{egreg}'s suggestion: \LaTeX\ thinks there's a new paragraph---see arrow.\\[0.5\baselineskip]
\noindent%
\begin{minipage}[t]{0.65\linewidth}
\raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{B}{$\longrightarrow$}}}
\raisebox{0pt}[0pt][0pt]{\rput(3.5in,-9.0\baselineskip){\color{blue}\rnode{C}{$\longleftarrow$ \fbox{\footnotesize{}Undesired new paragraph.}}}}
\lipsum[2]
%% solution suggested by egreg
\par\xdef\tpd{\the\prevdepth}
\end{minipage}\hspace*{\fill}%
\usebox{\righthandmatter}
%% enacting egreg's solution (But now I have a new paragraph).
\prevdepth\tpd%
\noindent\mytext
\vspace{1.5ex}
\noindent%
\textbf{Example 3:} Interlinear spacing is as I want, but lines of the following text terminate too soon.\\[0.5\baselineskip]
\noindent%
\begin{minipage}[t]{0.65\linewidth}
\raisebox{0pt}[0pt][0pt]{\rput(-3ex,-8.25\baselineskip){\color{blue}\rnode{D}{$\longrightarrow$}}}%
\raisebox{0pt}[0pt][0pt]{\rput(4.8in,-8.75\baselineskip){\color{blue}\rnode{E}{$\longleftarrow$ \fbox{\footnotesize{}line terminates too soon.}}}}
\lipsum[2]
\mytext
\end{minipage}\hspace*{\fill}%
\usebox{\righthandmatter}
\end{document}
Here's an image:
How do I fix the interlinear spacing to get the desired effect?
To better illustrate I provide another example. The right hand matter is indivisible such as a graphic. The left hand matter consists of a variety of paragraphs, equations, spaces for student responses, and possibly more graphics.
Please keep in mind that this is a MWE so the content of the material which justifies formatting decisions is lost. But also, I usually face these sorts of formatting decisions in contexts where material resources are scarce and the luxury of using multiple pages cannot be abused too often.
Following StephanLehmke's suggestion of \parshape
: I could write
\documentclass{article}
\usepackage{calc}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{pst-node}
\usepackage[margin=1.25in]{geometry}
%%
\setlength{\parskip}{5ex}
\newlength{\aelinewidth}
\pagestyle{empty}
\begin{document}
\setlength{\aelinewidth}{\linewidth}
\newsavebox{\righthandmatter}
\begin{lrbox}{\righthandmatter}
\fbox{\begin{minipage}[t]{0.35\linewidth-2\fboxrule-2\fboxsep-2em}
\vspace{-\baselineskip}
\rule[-2.5cm]{0pt}{3.5cm}\parbox{\linewidth}{\raggedright{}Some image or something that is unbreakable}
\end{minipage}}
\end{lrbox}
\noindent%
\begin{minipage}[t]{0.65\linewidth}
\begin{minipage}[t]{\linewidth}
\textbf{Question 1:}
Nam dui ligula, fringilla a, euismod sodales, sol- licitudin vel,
wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at,
lobortis vitae, ultricies et, tellus. Donec ali- quet, tortor sed\par
\parshape 6 0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt \linewidth 0pt 6in
\textbf{Question 2:}
Nam dui ligula, fringilla a, euismod sodales, sol- licitudin vel,
wisi. Morbi auctor lorem non justo. Nam lacus libero, pretium at,
lobortis vitae, ultricies et, tellus. Donec ali- quet, tortor sed
accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a
mi. Morbi ac orci et nisl hendrerit mol- lis. Suspendisse ut
massa. Cras nec ante. Pellentesque a nulla. Cum sociis natoque
penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Aliquam tincidunt urna. Nulla ullamcor- per vestibulum
turpis. Pellentesque cursus luctus mauris. \textbf{Continuation of
question 2's paragraph} Lorem ipsum dolor sit amet, consectetuer
adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing
vitae, felis. Nam dui ligula, fringilla a, euismod sodales, sol-
licitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero,
pretium at, lobortis vitae, ultricies et, tellus. Donec ali- quet,
tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare
odio metus a mi. Morbi ac orci et
\end{minipage}
\end{minipage}\hspace*{\fill}%
\usebox{\righthandmatter}
\end{document}
which gives me a reasonably good result like I wanted:
So now my question becomes, is there an approach other than using \parshape
which is more in the spirit and style of egreg's solution on the above mentioned link? Essentially, I feel that I'm not understanding something about interlinear glue. I guess I'm asking for a clarification of that glue which would be applicable in the situations I've illustrated above.
This is probably the wrong place to put this comment: But, interestingly enough, I had to embed my \parshape
paragraph inside another minipage
or else the width of the containing minipage
is ignored. This related to an earlier question I posted minipage is wider than I wanted. The solution I got before was that it had to do something with how align
worked whether the equation was tagged or not. Remove the inner wrapping minipage
and there's another example whether the minipage
width is ignored.
\parshape
should be used for this purpose.