Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As you know, this is how to create labels in METAPOST:

label(btex some text etex, (0,0));

How do I place text on multiple lines -- in this case such that "some" appears on one line, and "text" appears on the next line? Putting "\\" between them doesn't seem to work at all.

Here is the skeleton of my file:

verbatimtex
%&latex 
\documentclass[10pt]{article}
\begin{document}
etex
input mp-tool;
beginfig(0);

label(btex some text etex, (0,0));

endfig;
verbatimtex
\end{document}
etex
end
share|improve this question
    
Welcome to TeX.SX! Are you using LaTeX to format the labels? Can you make a complete example of your .mp file? (Just with the essential bits) –  egreg Jul 8 '12 at 15:04
    
@egreg Thanks! I have now pasted the skeleton of my document. Also, I should perhaps mention that I then use "mptopdf" to compile it into a PDF file. –  MayGodBlessKnuth Jul 8 '12 at 15:21
add comment

1 Answer 1

up vote 4 down vote accepted

The answer may surprise you:

verbatimtex
%&latex 
\documentclass[10pt]{article}
\begin{document}
etex
input mp-tool;
beginfig(0);

label(btex \begin{tabular}{@{}c@{}} some \\ text \end{tabular} etex, (0,0));

endfig;
verbatimtex
\end{document}
etex
end

You can also use \begin{tabular}[t] or \begin{tabular}[b] to modify the vertical alignment.

share|improve this answer
    
Didn't try, but the tabular preamble appears to be missing its closing brace. –  Bruno Le Floch Jul 9 '12 at 12:11
    
@BrunoLeFloch Thanks, fixed –  egreg Jul 9 '12 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.