排版这个包含大量单词的集合推导式的正确方法是什么?\textrm
手动空格真的是唯一的方法吗?
$$D = (S,
\{(a,b) \,|\, \exists s,x,y\in S^* \textrm{ and }
i < j \textrm{ such that }
w^i = sax \textrm{ and } w^j = sby\})$$
答案1
有了这样的答案,我就会专注于问题中的“其中包含很多单词”部分。通常使用的解决方案是\text{...}
使用$...$
其中的数学部分的代码片段,就像在普通文本模式下使用的那样。您的示例可能如下所示:
\[
D = (S, \{(a,b) \mid \text{$\exists s,x,y\in S^*$ and $i < j$
such that $w^i = sax$ and $w^j = sby$}\})
\]
答案2
这样做的目的是让描述尽可能简短。冗长的描述会将主要部分隐藏在结尾处,读者很难读完。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Here is a possibility
\[
D = (S, \{(a,b) \mid w^i=sax, w^j=sby \text{ for some $s,x,y\in S^*$, $i < j$}\}
\]
but probably it is better if you describe the set in words.
For $w\in S$, define $T_{w}$ as the set of pairs $(a,b)\in S\times S$
such that there exist $s,x,y\in S^{*}$ and $i<j$ so that $w^i=sax$ and
$w^j=sby$. Set $D=(S,T_w)$; then ...
\end{document}