3

I’m using the picture environment (with linguex). However my pictures overlap with the text:

enter image description here

I've fixed the problem by adding in a rule with zero width and height equivalent to the picture (30 times 0.3ex) plus 1ex (for extra clearance): \rule[-10ex]{0ex}{10ex}. How can I avoid this manual fix?

enter image description here


Separate question: to get characters with ascenders and descenders to align with the baseline of the text, I’m sticking them into boxes with zero height and depth: \raisebox{0ex}[0pt][0pt]{$\omega$}. Surely there’s a less verbose way?


\documentclass[12pt]{article}
\usepackage{lipsum, mathptmx, qtree, linguex}

\begin{document}
\lipsum[1]

\ex.   \setlength\unitlength{.3ex}
\begin{picture}(24,-30)
\multiput(2.5,-1.5)(12,-15){2}{\line(20,-30){6}}
\put(0,0){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\omega$}}}
\put(12,-15){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\pi$}}}
\put(24,-30){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\varphi$}}}
\end{picture}
\rule[-10ex]{0ex}{10ex}

\lipsum[1]
\end{document}
0

1 Answer 1

4

The picture environment takes two sets of ordered pairs as arguments. The first is the image dimension (you need a positive number on the y value to have the same effect as the vspace), and the second ordered pair is the coordinates of the lower-left corner of the picture. In this MWE, I use \begin{picture}(24,33)(0,-30) to achieve a size large enough (33) to avoid the need for the \vspace.

\documentclass[12pt]{article}
\usepackage{lipsum, mathptmx, qtree, linguex}

\begin{document}
\lipsum[1]

\ex.   \setlength\unitlength{.3ex}
\begin{picture}(24,33)(0,-30)
\multiput(2.5,-1.5)(12,-15){2}{\line(20,-30){6}}
\put(0,0){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\omega$}}}
\put(12,-15){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\pi$}}}
\put(24,-30){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\varphi$}}}
\end{picture}
%\rule[-10ex]{0ex}{10ex}

\lipsum[1]
\end{document}

enter image description here

To get, as the OP requests, the numbering at the top of the figure, one way (changing his code the least), is to wrap the picture environment in a \belowbaseline macro from the stackengine package. There are perhaps other ways inside the picture environment, but I'm not sure.

\documentclass[12pt]{article}
\usepackage{lipsum, mathptmx, qtree, linguex}
\usepackage{stackengine}
\begin{document}
\lipsum[1]

\ex.   \setlength\unitlength{.3ex}
\belowbaseline[-5pt]{%
\begin{picture}(24,34)(0,-31)
\multiput(2.5,-1.5)(12,-15){2}{\line(20,-30){6}}
\put(0,0){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\omega$}}}
\put(12,-15){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\pi$}}}
\put(24,-30){\makebox(0,0)[t]{\raisebox{0ex}[0pt][0pt]{$\varphi$}}}
\end{picture}%
}

\lipsum[1]
\end{document}

enter image description here

5

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .