2

How to Linebreak and center the following

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc} % Kodierung
\usepackage[ngerman]{babel} % Sprache
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}


\begin{document}
    SUBSET-SUM := $\left \{ \begin{array}{c|c} < x_1,\dots ,x_n,t > & x_1,\dots ,x_n,t \in \mathbb{N} \text{ und es existiert eine Teilmenge } I \subseteq \{1,\dots,n\} \text{ mit } \sum_{i \in I} x_i = t
    \end{array} \right \}$.
\end{document}

If i compile this, i cannot read the outcome as it is outside my paper boundries.

I'd like it to look like this:

enter image description here

  • Welcome to the site, but please provide something that compiles. – Steven B. Segletes Jul 26 '16 at 19:52
  • It is not exactly clear how you want it to look, but here shows how to break it into lines and colums: \documentclass{article} \usepackage{amssymb,amsmath} \begin{document} \begin{itemize} \item SUBSET-SUM := $\left \{ \begin{array}{c|c} < x_1,\dots ,x_n,t > & x_1,\dots ,x_n,t \in \mathbb{N} \\ &\text{ und es existiert eine Teilmenge} \\ I \subseteq \{1,\dots,n\} & \text{ mit } \sum_{i \in I} x_i = t \end{array} \right \}$. \end{itemize} \end{document} – Steven B. Segletes Jul 26 '16 at 19:57
  • Thanks...i edited my first post so it should be clear now, how i'd like it to look like – Dennis Höhl Jul 26 '16 at 20:03
1

One more solution, with use of array package and m column type:

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc} % Kodierung
\usepackage[ngerman]{babel} % Sprache
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}
\usepackage{array}

\begin{document}
    SUBSET-SUM : = 
        $\left \{ \begin{array}{c|>{\raggedright\arraybackslash}m{0.55\textwidth}}
        \langle x_1,\dots ,x_n,t\rangle 
            &   $x_1,\dots ,x_n,t \in \mathbb{N}$  
                und es existiert eine Teilmenge 
                $I \subseteq \{1,\dots,n\}$ 
                mit 
                $\sum_{i \in I} x_i = t$
    \end{array} \right\}$.
\end{document}

it gives:

enter image description here

  • Thank you, too ... this looks even simpler then the one above – Dennis Höhl Jul 26 '16 at 20:28
2

Maybe this:

\documentclass{article}
\usepackage{amssymb,amsmath,stackengine}
\renewcommand\stackalignment{l}
\def\stacktype{L}
\setstackgap{L}{1.2\normalbaselineskip}
\stackMath
\begin{document}
\begin{itemize}
\item SUBSET-SUM := $\left\{ 
< x_1,\dots ,x_n,t >  \Bigg|\, \stackanchor{x_1,\dots ,x_n,t \in \mathbb{N} 
  \text{ und es existiert eine}} {\text{Teilmenge } I \subseteq \{1,\dots,n\} \text{ mit } 
  \displaystyle\sum_{i \in I} x_i = t}
 \right \}$.
\end{itemize}
\end{document}

enter image description here

  • Thank you ... didn't expect it to be that 'difficult' – Dennis Höhl Jul 26 '16 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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