4

I am writing Flashcards for the upcomming finals.

To describe the equations I use the align* environment like this:

\begin{align*}
    x_+ &: \text{ Molenbruch von Enzymen, bei denen funktionelle Gruppen protoniert sind}\\
    x_n &: \text{ Molenbruch von Enzymen, bei denen die Ladung mehr oder weniger ausgeglichen ist}\\
    x_- &: \text{ Molenbruch von Enzymen, bei denen funktionelle Gruppen deprotoniert sind }
\end{align*}

long descriptions are going over the margin. (using a6paper)

is there any way to wrap the text within the align* environment other than this:

\begin{align*}
    x_+ &:      \text{ Molenbruch von Enzymen, bei denen }\\
        &:\quad \text{funktionelle Gruppen protoniert sind}\\
    x_n &:      \text{ Molenbruch von Enzymen, bei denen}\\
        &:\quad \text{die Ladung mehr oder weniger ausgeglichen ist}\\
    x_- &:      \text{ Molenbruch von Enzymen, bei denen}\\
        &:\quad \text{funktionelle Gruppen deprotoniert sind }
\end{align*}

It should provide the same behavior like centering and stuff, just with wrapping. Centering is important to make things clearer.

  • This looks more like a {description} list to me – cgnieder Jan 13 '13 at 16:50
  • @cgnieder, i already tried that but looked kinda wierd because it isn't centerd and generates "ugly" output with large itemlabels – Rico Jan 13 '13 at 17:05
  • Well, you can always customize such a list with enumitem. (I guess by “not centered” you mean “no additional margins”?) – cgnieder Jan 13 '13 at 17:12
  • enumitem could solve the problem, i'll try that. "additional margins" is what i ment, right. – Rico Jan 13 '13 at 17:20
  • I used paralist and enumitem works fine would be great to set the left and right margins even. I tried [leftmargin=1em, rightmargin=1em] to let it look like the align* but it didn't work out – Rico Jan 13 '13 at 17:55
4

This looks like a {description} list to me. In order to get the required margins one can use enumitem. The key is section 3.3 More on horizontal spacing of the documentation. The code below could be a starting point:

\documentclass{article}
\usepackage{enumitem}
\newlist{indenteddesc}{description}{1}
\setlist[indenteddesc]{
  leftmargin=5em,  % labelindent+labelwidth+labelsep
  rightmargin=3em,
  labelindent=3em, % set equal to rightmargin
  labelwidth=1.5em,% choose a width the labels fit in
  labelsep=.5em
}
\usepackage{lipsum}% for dummy text
\begin{document}

\lipsum[1]

\begin{indenteddesc}
 \item[$x_+$] Molenbruch von Enzymen, bei denen funktionelle Gruppen protoniert
   sind
 \item[$x_n$] Molenbruch von Enzymen, bei denen die Ladung mehr oder weniger
   ausgeglichen ist
 \item[$x_-$] Molenbruch von Enzymen, bei denen funktionelle Gruppen deprotoniert
   sind
\end{indenteddesc}

\lipsum[1]

\end{document}

enter image description here

  • works fine with long entries but does not behave like align* while using shorter entries. – Rico Jan 13 '13 at 18:27
  • @Timebandit Well, of course, since this one has fixed indents. I'm not really able to see why this is a problem? It might very well be you won't get an exact equivalent for {align} with any solution. – cgnieder Jan 13 '13 at 18:45
  • I think you're right, in this case this is the best way to handle it. I just reduced the itemsep to make it look more compact. – Rico Jan 13 '13 at 18:55
  • @Timebandit If you want the whole thing visually centered even if the lines are shorter you can always put a frame around it or something... – cgnieder Jan 13 '13 at 18:57
  • Sounds right. Is there any possibility to center enumerations? – Rico Jan 13 '13 at 19:28
4

Maybe with a tabularx environment instead of align*:

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\noindent\begin{tabularx}{\linewidth}{lX}
$x_+$ & Molenbruch von Enzymen, bei denen funktionelle Gruppen protoniert sind\\
    $x_n$ & Molenbruch von Enzymen, bei denen die Ladung mehr oder weniger ausgeglichen ist\\
    $x_-$ & Molenbruch von Enzymen, bei denen funktionelle Gruppen deprotoniert sind
\end{tabularx}
\end{document}

enter image description here

  • 1
    With \noindent before \begin{tabularx} – egreg Jan 13 '13 at 16:14
  • @egreg thanks, I have added that to my answer. – Benedikt Bauer Jan 13 '13 at 16:41
  • Like description this works for long entries, but for shorter entries, where wrap is not necessary, it shows a behavior different from align* – Rico Jan 13 '13 at 18:14

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.