专家,
有没有什么方法可以让我的方程式输出更漂亮,例如要求 LaTeX 忽略 \underbrace 和 \overbrace 为自己保留的水平空间?
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}
\begin{picture}(300,20)
\put(50,10){\vector(2,-3){20}}
\put(50,10){\vector(2,-1){60}}
\put(-10,15){these guys \textbf{here} must be eliminated. The next one \textbf{here} too, of course.}
\put(230,10){\vector(-2,-3){20}}
\end{picture}
\[ \{ \underbrace{x \in \mathbb{Z}}_{\text{Menge aller $x$ aus $\mathbb{Z}$}} \overbrace{|}^{\text{mit der Eigenschaft}} -1 \le x \le 2 \} \]
\\[1cm]
And I want to get it like this:
\[ \{x \in \mathbb{Z} \ | \ -1 \le x \le 2 \}, \]
where the \verb|\overbrace| doesn't wait till the \verb|\underbrace| is going to have the work done.
\end{document}
答案1
我建议您加载该mathtools
包并使用它\mathclap
宏来“粉碎”宽度解释性字符串“ \text{Menge aller $x$ aus $\mathbb{Z}$}
”和“ \text{mit der Eigenschaft}
”。我会使用\overset
指令而不是\overbrace
来排版垂直条上方的(堆叠)材料。(相对于垂直条,过度支撑太宽了。)
通过这种方法,解释字符串将以 排版\scriptstyle
,即使用比主数学字体样式( )小 30% 的字体\textstyle
。
另外,请注意竖线应为 类型mathrel
。如果写为\vert
或|
,则应在竖线两边加上粗空格 ( \;
)。或者,更简单地写为\mid
。
\documentclass{article}
\usepackage{mathtools} % for \mathclap macro
\usepackage{amsfonts} % for \mathbb macro
\begin{document}
\[ \{\,
\underbrace{x \in \mathbb{Z}}_{%
\mathclap{\text{Menge aller $x$ aus $\mathbb{Z}$}}}
\overset{\mathclap{\substack{%
\text{mit der Eigenschaft}\\ \downarrow}}}{\mid}
-1 \le x \le 2 % wrap the minus symbol in braces so that it acts as a unary operator
\,\} \]
\end{document}
答案2
这是一个使用mathtools
(的扩展amsmath
)和的解决方案stackengine
。对于短下括号,\underbracket
看起来更美观:
\documentclass{article}
\usepackage{mathtools, stackengine}
\usepackage{amsfonts}
\setstackEOL{\\}
\begin{document}
\begin{picture}(300,20)
\put(50,10){\vector(2,-3){20}}
\put(50,10){\vector(2,-1){60}}
\put(-10,15){these guys \textbf{here} must be eliminated. The next one \textbf{here} too, of course.}
\put(230,10){\vector(-2,-3){20}}
\end{picture}
\[ \bigl\{ \underbracket[0.5pt]{x \in \mathbb{Z}}_{\clap{\footnotesize Menge aller $x$ aus $\mathbb{Z}$}} \stackrel{\Shortstack {\clap{\footnotesize mit der Eigenschaft}\\$\downarrow $}}{\mid} -1 \le x \le 2\bigr\} \]
\\[1cm]
And I want to get it like this:
\[ \{x \in \mathbb{Z} \ | \ -1 \le x \le 2 \}, \]
where the \verb|\overbrace| doesn't wait till the \verb|\underbrace| is going to have the work done.
\end{document}