0

In LaTeX, I would like to align some text so that looks something like this:

"⇒": some text 
      [an equation in align* environment]
      more text

"⇐": some other text
      [another equation]
      even more text

without the use of minipages, and without me having to manually specify any width or similar every time I want to insert something like this. I would also like, that the "more text" place holder is aligned with the "even more text" place holder, if for example I write something longer than "⇐".

So basically just like inside a tabular environment with invisible borders, but tabular won't let me use align*

4
  • you can use align in a p column of a tabular but you probably want $\begin{aligned}... in an l column Oct 5, 2022 at 15:25
  • @DavidCarlisle I can't get it running in p-columns either. What's the difference to using l? It seems that I always have to specify a width with p-cells which is something I want to avoid.
    – Hebol
    Oct 5, 2022 at 15:39
  • l is like mbox so horizontal mode (LR-mode in latex book) so can not have display constructs like align, or paragraphs or \vspace . p is like \parbox (par-mode in latex book) so can have all those things. You want l column and aligned here not align Oct 5, 2022 at 15:50
  • @DavidCarlisle thanks a lot, I was really blind. Using aligned in an l column worked perfectly now, thanks a lot!
    – Hebol
    Oct 6, 2022 at 16:15

2 Answers 2

2

align is a full width display. aligned is essentially the same alignment but makes a box the natural width of the alignment, which can be inlined in other constructs.

enter image description here

enter image description here

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align*}
  \Rightarrow:&\text{some text}\\
     &\begin{aligned}
       1&=3-2\\
       10&=3^2+1^2\\
       \end{aligned}\\
     &\text{more text}\\[10pt]
\Leftarrow:& \text{some other text}\\
     &\begin{aligned}
       2&=1+1\\
       5^2&=3^2+4^2\\
       \end{aligned}\\
      &\text{even more text}
\end{align*}
\end{document}
1
  • Thanks a lot! I'm using the aligned within a tabular environment l cell now, as you suggested before for better spacing, but I guess this works as well. Have a nice day!
    – Hebol
    Oct 6, 2022 at 16:16
0

Another option to the one mentioned by David Carlisle would be to use something like this:

\begin{tabular}{ll}
  asdf & text \\
       &
  $ \begin{aligned}
      a +  b & = c    \\
      c      & = b+ a
    \end{aligned} $
\end{tabular}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .