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.

I am trying to use an inline equation to list bunch o tuples. However, I it does not automatically go to next line. I am doing it manually, but this time it looks ugly. By the way I am writing in a two column template, so I have limited space at each line. Here is what I do:

${x_i,\;y_i }$= $ {{60,45},\; {60,90},\;{60,135},\;{60,180},\;{60,225},\; \ {100,90},\; {100,160},\;{100,225}} $

Is there a way to automatically do this?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You have to distinguish which commas are eligible for breaks; so I suggest a command for it:

\documentclass[twocolumn,12pt]{article}
\newcommand{\bc}{,\penalty0 \;}

\begin{document}
$x_i,y_i=60,45\bc 60,90\bc 60,135\bc 60,180\bc 60,225\bc 100,90\bc 100,160\bc 100,225$
\end{document}

enter image description here

Don't overuse \; (it's wrong between x_i and y_i) and also braces: the ones you have in your example are all useless.

share|improve this answer
    
the \; before the penalty will leave a space at the end of the line if it's broken there. it would be better to put the penalty before the space. (tested; space at the beginning of line is ignored after break.) –  barbara beeton Sep 30 '12 at 13:03
    
@barbarabeeton You're right, of course. –  egreg Sep 30 '12 at 13:05

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.