答案1
一种变体,使用\Centerstack
命令,它会自动启动文本模式,并且可以采用可选参数来设置行的对齐方式:
\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}
答案2
为这些“文本变量”定义一个合适的命令:
\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}
答案3
你能做这件事,这并不意味着你应该做吧。我同意@Johannes_B,使用适当的变量将大大提高可读性。
您可以使用stackengine
对于这些事情:
但在我看来,这仍然更好:
完整 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}