3

I would like to introduce a line break in text line inside an equation.

What I have done is:

\begin{align*}
    \frac{\text{Reactividad\ relativa \\ Hidr\'ogeno\ secundario}}{\text{Reactividad\ relativa\\ Hidr\'ogeno\ secundario}}&=d
\end{align*}

And what I would like to reproduce is the left side of the equal:

enter image description here

  • 6
    Why don't you use variables and explain them in proper sentences? What I see in the picture makes me cringe. – Johannes_B Sep 13 '18 at 5:25
  • I have a big lack of latex language and for this reason I cannot give you a proper answer – Another.Chemist Sep 13 '18 at 5:27
2

A variant, with the \Centerstack command,, which automatically starts text mode, and can take an optional argument to set the alignment of the lines:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage[usestackEOL]{stackengine}

\begin{document}

    \begin{equation} %% \Longstack is probably better, look at the manual for stackengine...
        \frac{\,\Centerstack[l]{Relative reactivity of \\ a secondary hydrogen}\,}%
        {\Centerstack[l]{Relative reactivity of \\ a primary hydrogen}}
        = \frac{\,\Centerstack[l]{yield of product from \\ secondary hydrogen abstraction}\Bigm / \Centerstack[l]{number of \\ secondary hydrogens}\,}%
     {\Centerstack[l]{yield of product from \\ primary hydrogen abstraction}\Bigm /\Centerstack[l]{number of \\ primary hydrogens}}%
    \end{equation}

\end{document} 

enter image description here

7

Define a suitable command for those “textual variables”:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\tvar}[1]{%
  \textup{%
    \begin{tabular}{@{}l@{}}
    #1
    \end{tabular}%
  }%
}

\begin{document}

\begin{equation*}
\frac{\tvar{Reactividad relativa \\ Hidr\'ogeno secundario}}
     {\tvar{Reactividad relativa\\ Hidr\'ogeno primario}}
=
\frac{
      \left(\tvar{Abc def \\ ghi klm}\right)\bigg/
      \left(\tvar{Abc def \\ ghi klm}\right)
     }
     {
      \left(\tvar{Abc def \\ ghi klm}\right)\bigg/
      \left(\tvar{Abc def \\ ghi klm}\right)
     }
\end{equation*}

\end{document}

enter image description here

2

You can do it, which does not mean you should do it. I agree with @Johannes_B, using proper variables will increase the readability a lot.

You can use stackengine for these things:

enter image description here

and still, this is IMHO better:

enter image description here

Full MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{stackengine}
\begin{document}
    \begin{equation} %% \Longstack is probably better, look at the manual for stackengine... 
        \frac{\text{\stackunder{Relative reactivity of}{a secondary hydrogen}}}%
        {\text{\stackunder{Relative reactivity of}{a primary hydrogen}}} \cdots
    \end{equation}

    \bigskip

    But this is better: 

    Call $R_2$ the relative reactivity of a secondary hydrogen, $R_1$ the relative reactivity of a primary hydrogen, \dots
    \begin{equation}
        \frac{R_2}{R_1}\cdots
    \end{equation}
\end{document}

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.