我正在写一份组合学简历,所以我需要写一些内容,比如某个数字等于满足某个条件的对象数。我尝试了这种方式
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{enumerate}
\usepackage[shortlabels]{enumitem}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{makeidx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage[most]{tcolorbox}
\newcommand{\row}{\operatorname{row}}
\newcommand{\col}{\operatorname{col}}
\begin{document}
\[M_{\lambda \alpha}=\#\mbox{matrices such that \\ \row(A)=\lambda, \col(A)=\alpha}\]
\end{document}
but
\` 没有提供我需要的换行符。可能是我没有使用正确的环境?
基本上我想要的是两件事相等,但在右边我需要两行(或更多......)
ps:显然我在序言中定义了 \row 和 \col......
答案1
看看以下内容是否是您所寻找的:
\documentclass{article}
%\usepackage[utf8]{inputenc} % is default for recent article
\usepackage[spanish]{babel}
\usepackage{mathtools}
\newcommand{\row}{\operatorname{row}}
\newcommand{\col}{\operatorname{col}}
% other packages in your preamble are not relevant for your example
\begin{document}
\begin{align*}
M_{\lambda \alpha} & = \text{\# matrices such that} \\
&\qquad \row(A)=\lambda, \col(A)=\alpha
\end{align*}
\end{document}
附录:
\documentclass{article}
\usepackage[spanish]{babel}
\usepackage{mathtools}
\newcommand{\row}{\operatorname{row}}
\newcommand{\col}{\operatorname{col}}
\begin{document}
\[
M_{\lambda \alpha} =
\begin{aligned}
& \text{\# matrices such that} \\
& \row(A)=\lambda, \col(A)=\alpha
\end{aligned}
\]
or
\[
M_{\lambda \alpha} = \#\
\begin{aligned}
& \text{matrices such that} \\
& \row(A)=\lambda, \col(A)=\alpha
\end{aligned}
\]
\end{document}