1

I have a TikZ diagram to the right of a minipage environment. I have some text that I want under the minipage environment. The interline spacing is about half of the other interline spacing.

I don't insist on using a minipage here. I just want the appropriate typesetting.

\documentclass{amsart}
\usepackage{mathtools}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}


\begin{document}



\noindent \begin{minipage}[t]{4.875in}
\noindent \raggedright{\textbf{1.) }The following figure depicts three congruent semicircles bounded by another \\
semicircle; the diameters of the three smaller semicircles cover the diameter of \\
the bigger semicircle, and each of the three smaller semicircles is tangent to \\
two other semicircles at the endpoints of its diameter. \textit{A} is the area of \\
of the region enclosed by the three smaller semicircles and \textit{B} is the area}
\end{minipage}
%
\hspace{-0.25cm}
%
\raisebox{0mm}[0mm][0mm]
{
\begin{tikzpicture}[baseline=(current bounding box.north west)]

\coordinate (O) at (0,0);
\draw[fill=blue!50] (-1.5,0) -- (1.5,0) arc (0:180:1.5) -- cycle;
%
\draw[fill=yellow] (-3/2,0) -- (-1/2,0) arc (0:180:1/2) -- cycle;
\draw[fill=yellow] (-1/2,0) -- (1/2,0) arc (0:180:1/2) -- cycle;
\draw[fill=yellow] (1/2,0) -- (3/2,0) arc (0:180:1/2) -- cycle;

\draw[fill] (O) circle (1.5pt);


\end{tikzpicture}
} \\
the region enclosed by the big semicircle but outside the three smaller semicircles. Compute the ratio of $A : B$.


\end{document}

2 Answers2

2

You want to look at How to keep a constant baselineskip when using minipages (or \parboxes)? but there's a much better alternative:

\documentclass{amsart}
\usepackage{mathtools}

\usepackage{wrapfig}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}


\begin{document}

\noindent
\begin{minipage}[t]{4.875in}\raggedright
\textbf{1.)} The following figure depicts three congruent semicircles 
bounded by another semicircle; the diameters of the three smaller 
semicircles cover the diameter of the bigger semicircle, and each of 
the three smaller semicircles is tangent to two other semicircles at 
the endpoints of its diameter. $A$ is the area of of the region 
enclosed by the three smaller semicircles and $B$ is the area\par
\xdef\tpd{\the\prevdepth}
\end{minipage}\hfill
\raisebox{0mm}[0mm][0mm]{%
  \begin{tikzpicture}[baseline=(current bounding box.north west)]

  \coordinate (O) at (0,0);
  \draw[fill=blue!50] (-1.5,0) -- (1.5,0) arc (0:180:1.5) -- cycle;
  %
  \draw[fill=yellow] (-3/2,0) -- (-1/2,0) arc (0:180:1/2) -- cycle;
  \draw[fill=yellow] (-1/2,0) -- (1/2,0) arc (0:180:1/2) -- cycle;
  \draw[fill=yellow] (1/2,0) -- (3/2,0) arc (0:180:1/2) -- cycle;

  \draw[fill] (O) circle (1.5pt);
  \end{tikzpicture}
}

\prevdepth=\tpd
\noindent
the region enclosed by the big semicircle but outside the three smaller 
semicircles. Compute the ratio of $A : B$.

\bigskip

\begin{wrapfigure}[4]{r}{3.2cm}
  \vspace{-\baselineskip}
  \begin{tikzpicture}[baseline=(current bounding box.south west)]

  \coordinate (O) at (0,0);
  \draw[fill=blue!50] (-1.5,0) -- (1.5,0) arc (0:180:1.5) -- cycle;
  %
  \draw[fill=yellow] (-3/2,0) -- (-1/2,0) arc (0:180:1/2) -- cycle;
  \draw[fill=yellow] (-1/2,0) -- (1/2,0) arc (0:180:1/2) -- cycle;
  \draw[fill=yellow] (1/2,0) -- (3/2,0) arc (0:180:1/2) -- cycle;

  \draw[fill] (O) circle (1.5pt);
  \end{tikzpicture}
\end{wrapfigure}
\noindent
\textbf{1.)} The following figure depicts three congruent semicircles 
bounded by another semicircle; the diameters of the three smaller 
semicircles cover the diameter of the bigger semicircle, and each of 
the three smaller semicircles is tangent to two other semicircles at 
the endpoints of its diameter. $A$ is the area of of the region 
enclosed by the three smaller semicircles and $B$ is the area
the region enclosed by the big semicircle but outside the three smaller 
semicircles. Compute the ratio of $A : B$.

\end{document}

enter image description here

egreg
  • 1,121,712
  • I am looking at your first display. The interline spacing is correct ... but now I would like "two" to be typeset on the fourth line and "the region" to be typeset on the fifth line. – A gal named Desire Dec 17 '18 at 23:20
  • What does \par\xdef\tpd{\the\prevdepth} instruct LaTeX to do? – A gal named Desire Dec 17 '18 at 23:21
  • @AgalnamedDesire Did you read the linked question and answer? I would never alternate ragged right (with manual breaking) for a text such as this. The first way is as wrong as it can be, I added it just for showing the method for preserving the baseline skip. – egreg Dec 17 '18 at 23:22
  • What is the difference between using \raggedright and manual line breaking? – A gal named Desire Dec 17 '18 at 23:27
  • I will look at your explanation in the link now. – A gal named Desire Dec 17 '18 at 23:27
  • I added \par\xdef\tpd{\region\prevdepth to the end of the text in the minipage environment and \prevdepth=\tpd after the minipage environment. I get an error saying "\par\xdef\tpd{\region\prevdepth is not a defined control sequence." – A gal named Desire Dec 18 '18 at 00:26
  • The error is apparently in using \par\xdef\tpd{\region\prevdepth instead of \par\xdef\tpd{\the\prevdepth. Why is there using the code with "region" a mistake? "Region" is the last word in the line, and the "g" in it sets the low below the baseline in the minipage environment. – A gal named Desire Dec 18 '18 at 02:24
  • @AgalnamedDesire What's making you into thinking that \region is a defined command? I use \par to finish the paragraph, after which \the\prevdepth will refer to the depth of the last line. – egreg Dec 18 '18 at 07:43
1

it is not very clear to me what you like to obtain. see, if the my guessing is close to your goal:

enter image description here

for above result i use the wrapfig package:

\documentclass[dvipsname]{amsart}
\usepackage{tikz}
\usetikzlibrary{calc, intersections}

\usepackage{wrapfig}

\begin{document}
\begin{wrapfigure}{r}{0.25\textwidth}
    \begin{tikzpicture}
\draw[fill=blue!50] (-1.5,0) -- (1.5,0) arc (0:180:1.5) -- cycle;
%
\draw[fill=yellow] (-3/2,0) -- (-1/2,0) arc (0:180:1/2) -- cycle;
\draw[fill=yellow] (-1/2,0) -- (1/2,0) arc (0:180:1/2) -- cycle;
\draw[fill=yellow] (1/2,0) -- (3/2,0) arc (0:180:1/2) -- cycle;

\draw[fill] (0,0) circle (1.5pt);
    \end{tikzpicture}
\end{wrapfigure}
\noindent\textbf{1.)}
The following figure depicts three congruent semicircles bounded by another
semicircle; the diameters of the three smaller semicircles cover the diameter 
of the bigger semicircle, and each of the three smaller semicircles is tangent 
to two other semicircles at the endpoints of its diameter. $A$ is the area of
of the region enclosed by the three smaller semicircles and $B} is the area
the region enclosed by the big semicircle but outside the three smaller 
semicircles. Compute the ratio of $A : B$.
\end{document}
Zarko
  • 296,517