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.

This is what I have so far:

formatted badly

Formatting in section 1 is a joke. I can't even read the cases. Under section 2 I cheated with a manual line break \\ and a parbox. Still the result disgusts me.

What I would like to achieve is, that the equation number stays in front of the equation. Too long equation are broken automatically after \textwidth has been reached and that the cases text starts right after the comma and behaves like normal text in regard to line breaks and text length. I don't know if other math environments are better suited for this (I am pretty used to align) and if i can somehow control the cases environment better.

Small sidenote: When breaking the equation manually before the \right] it won't get typesetted anymore

\documentclass{article}
\usepackage[leqno]{amsmath}

\begin{document}

\section{Unformated Solution}
    \begin{align}
             E_{h,betr} =
            \begin{cases}
                \left[ \left(Q_{h,li0} + Q_{h,li} \times GHZ \right) + f_{h,rech} + E_{e,hilf,spez} \times f_{e,prim} \right] \times A_{ebf} \times f_{h,red}, &wenn Lebenszyklus des Gebäudes kein Vielfaches des Lebenszyklus der Heizung ist \\
                \left[ \left(Q_{h,li0} + Q_{h,li} \times GHZ \right) + f_{h,rech} + E_{e,hilf,spez} \times f_{e,prim} \right] \times A_{ebf} \times f_{h,red} + E_{h,erst} + E_{h,ent}, wenn Lebenszyklus des Gebäudes ein Vielfaches des Lebenszyklus der Heizung ist
            \end{cases}
    \end{align}

\section{Formated Solution} 
    \begin{align}
             E_{h,betr} =
            \begin{cases}
                \left[ \left(Q_{h,li0} + Q_{h,li} \times GHZ \right) + f_{h,rech} + E_{e,hilf,spez} \times f_{e,prim} \right] \times \\ A_{ebf} \times f_{h,red}, &\parbox[t]{0.3\textwidth}{wenn Lebenszyklus des Gebäudes kein Vielfaches des Lebenszyklus der Heizung ist} \\
                \left[ \left(Q_{h,li0} + Q_{h,li} \times GHZ \right) + f_{h,rech} + E_{e,hilf,spez} \times f_{e,prim} \right] \times \\ A_{ebf} \times f_{h,red} + E_{h,erst} + E_{h,ent}, &\parbox[t]{0.3\textwidth}{wenn Lebenszyklus des Gebäudes ein Vielfaches des Lebenszyklus der Heizung ist}
            \end{cases}
    \end{align}
\end{document}
share|improve this question
1  
You may be interested in the breqn package. –  Ulrich Schwarz May 28 '13 at 19:31
    
@Ulrich Schwarz : Will look into that. Thank you. –  Sensei May 28 '13 at 20:43

1 Answer 1

It looks like your equations are sufficiently long and that there's so much text to describe each of the two "cases" as to make the cases environment unsuitable to the task at hand. I think you're be better off using the \intertext command and simply typesetting the description of the first "case" between the two parts of the equation; place the text describing the second case after the end of the align environment.

enter image description here

\documentclass{article}
\usepackage[leqno]{amsmath}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\DeclareMathOperator{\E}{E} % expectation operator 
\newcommand{\GHZ}{\textit{GHZ}}  % define some variable names
\newcommand{\betr}{\textit{betr}}
\newcommand{\rech}{\textit{rech}}
\newcommand{\hilf}{\textit{hilf}}
\newcommand{\spez}{\textit{spez}}
\newcommand{\prim}{\textit{prim}}
\newcommand{\ebf}{\textit{ebf}}
\newcommand{\red}{\textit{red}}
\newcommand{\erst}{\textit{erst}}
\newcommand{\ent}{\textit{ent}}
\begin{document}
\begin{align}
\E_{h,\betr} &=
\big[ (Q_{h,li0} + Q_{h,li} \times \GHZ \,) + f_{h,\rech} \\
&\qquad + \E_{e,\hilf,\spez} \times f_{e,\prim} \big] \times A_{\ebf} \times f_{h,\red}\notag\\
\intertext{wenn Lebenszyklus des Gebäudes kein Vielfaches des Lebenszyklus der Heizung ist, und}
&= \big[ (Q_{h,li0} + Q_{h,li} \times \GHZ \,) + f_{h,\rech} \notag\\
&\qquad + \E_{e,\hilf,\spez} \times f_{e,\prim} \big] \times A_{\ebf} \times f_{h,\red} 
    + \E_{h,\erst} + \E_{h,\ent}\notag
\end{align} 
wenn Lebenszyklus des Gebäudes ein Vielfaches des Lebenszyklus der Heizung ist.
\end{document}
share|improve this answer
    
Thank you for you suggestion. I think I will get the best result if I follow your advice. Maybe if I mix your solution with the comment from Ulrich Schwarz there need be no manual line breaks in the equation. –  Sensei May 28 '13 at 20:47

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.