我如何让等式中的线断开,就像下面的例子中 starName=name 和birthdate=1960 之间的线一样。
\begin{document}
$\Pi_{movieTitle} \sigma_{starName = name \wedge birthDate = 1960}(StarsIn \times MovieStar)$
\end{document}
答案1
\documentclass{article}
\usepackage{stackengine}
\stackMath
\begin{document}
$\pi_{\mathtt{movieTitle}}\sigma
\stackunder{\scriptstyle\mathtt{starName=name}}
{\scriptstyle\wedge\mathtt{birthdate=1960}}
(\mathtt{StarsIn} \times \mathtt{MovieStar}).$
\end{document}
答案2
下面是使用\substack
该amsmath
包的宏的解决方案:
\documentclass{article}
\usepackage{amsmath} % for \substack macro
\newcommand{\V}[1]{\texttt{#1}} % place argument in monospaced font
\begin{document}
$\Pi_{\V{MovieTitle}} \
\sigma_{\substack{\V{StarName} = \V{name}\\ \wedge\V{BirthDate} = 1960}}\ (\V{StarsIn}\times \V{MovieStar})$
\end{document}