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.

Yes, I know of the existence of breqn, and I am very excited about this package.

I am trying to write a mathematics paper, that will be typeset in two different styles (different page sizes, and different textblocks, &c).

At some point I have to typeset a long exact sequence, which looks approximately like

\[ 1 \to A \to B \to C \to D \to E \to F \to \ldots \]

In my paper, all these letters are actually longer mathematical expressions (cohomology groups). In one paper, this sequence fits nicely on the page, but in the other, I get an hbox overflow error.

I immediately thought of breqn, but the result of using

\begin{dmath*}
  1 \to A \to B \to C \to D \to E \to F \to \ldots
\end{dmath*}

is that I get a linebreak at every \to. This is not what I want. There should be just 1 linebreak (if needed), and it should automatically be chosen at the \to between C and D.

How do I accomplish this?

share|improve this question
    
I do not see how that will help. If I use split, the formula will not be on 1 line in the document where line-breaking is not necessary. –  jmc Sep 21 '12 at 2:13
add comment

2 Answers

up vote 4 down vote accepted
\documentclass{article}
\usepackage[textwidth=5cm]{geometry}% just for the example
\usepackage{breqn}

\begin{document}

\begin{dmath*}
 {1 \to A \to B \to C} \to {D \to E \to F \to \ldots}
\end{dmath*}

\end{document}

enter image description here

share|improve this answer
    
Wow, thanks! That looks good. One question: Can it be done even more automatic? Suppose I want 5 different textwidths... /I realize this is more difficult question, focussing on a general solution. But I think general solutions are important./ –  jmc Sep 21 '12 at 2:24
1  
@jmc perhaps it can be done, but I think it requires too much work, specially since the requirement for the breaking point in this special case might not be the optimal one in other situations. The problem is the determination of the breaking point more than the textwidth. –  Gonzalo Medina Sep 21 '12 at 2:27
add comment

If you use inline rather than display math it would break automatically without needing any packages.

enter image description here

\documentclass{article}

\begin{document}

\def\tst{ 1 \to A \to B \to C \to D \to E \to F \to \ldots }


\fbox{\parbox{2cm}{$\displaystyle \tst $}}

\fbox{\parbox{3cm}{$\displaystyle \tst $}}

\fbox{\parbox{4cm}{$\displaystyle \tst $}}

\fbox{\parbox{5cm}{$\displaystyle \tst $}}

\fbox{\parbox{6cm}{$\displaystyle \tst $}}

\fbox{\parbox{7cm}{$\displaystyle \tst $}}

\end{document}
share|improve this answer
    
Hi David. Thanks for this answer. I have been disconnected from the internet for half a year. I will consider this. I think the \displaystyle is very useful, and I did not know of it yet. Thanks again! –  jmc Feb 15 '13 at 13:25
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.