\underbrace 符号错误

\underbrace 符号错误

大家好,我尝试用谷歌搜索解决方案,但没有找到任何解决方案。我正在使用 beamer、xelatex 准备幻灯片。当我使用 \underbrace 时,括号不显示,而是显示一个蹩脚的符号。由于我是新用户,因此图片在这里:https://i.stack.imgur.com/8Vl2a.png

我在这里使用的包是

\usepackage{lastpage}
\usepackage{graphicx,graphics}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{unicode-math}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{mathtools}
%\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Hoefler Text}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}
\setmathfont{Cambria Math}

提前谢谢您。我认为问题可能出在字体上。

@Matthew,最小文件在这里: 有问题的页面

XeLaTeX 的版本是,

XeTeX 3.1415926-2.2-0.9997.4 (TeX Live 2010)
kpathsea version 6.0.0
Copyright 2010 SIL International and Jonathan Kew.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 4.4 [with modifications for XeTeX]
Compiled with zlib version 1.2.3; using 1.2.3
Compiled with FreeType2 version 2.3.11; using 2.3.11
Using Mac OS X Carbon, Cocoa & QuickTime frameworks

答案1

恐怕这是已知问题目前我还没有解决办法。您可以使用 LuaLaTeX 代替 XeLaTeX 吗?

答案2

由于您已经使用了这么多软件包(!),也许您不介意在列表中再添加一个软件包作为临时修复,以便在专家们努力修复错误时为您提供支持。有问题的软件包是 TikZ。以下是 的直接替代品\underbrace

\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\makeatletter
\def\underbrace#1{\@ifnextchar_{\tikz@@underbrace{#1}}{\tikz@@underbrace{#1}_{}}}
\def\tikz@@underbrace#1_#2{\tikz[baseline=(a.east)] {\node (a) {\(#1\)}; \draw[ultra thick,line cap=round,decorate,decoration={brace,amplitude=5pt}] (a.south east) -- node[below,inner sep=7pt] {\(\scriptstyle #2\)} (a.south west);}}
\makeatother

结果如下:

更换下支架

(在测试这个的时候,我注释掉了你的大量包,而且我不得不使用不同的数学字体;希望这些都不会对这个命令产生影响。厚度可以定制。)

这是代码中的“live”命令:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{unicode-math}
\usepackage{mathtools}
\setmathfont{xits-math.otf}

\makeatletter
\def\underbrace#1{\@ifnextchar_{\tikz@@underbrace{#1}}{\tikz@@underbrace{#1}_{}}}
\def\tikz@@underbrace#1_#2{\tikz[baseline=(a.east)] {\node (a) {\(#1\)}; \draw[ultra thick,line cap=round,decorate,decoration={brace,amplitude=5pt}] (a.south east) -- node[below,inner sep=7pt] {\(\scriptstyle #2\)} (a.south west);}}
\makeatother

\begin{document}

\begin{frame}

\frametitle{Problem}

if we assume $g(x) = -k'(x)$, that is $G(\mathbf{x}) = c_{g,d}g(||\mathbf{x}||^2)$
\[
\hat{\nabla} f_{h,k}(\mathbf{x}) = \underbrace{\frac{2c_{k,d}}{nh^{d+2}} \left[ \sum_{i=1}^n g\left( \left|\left| \frac{\mathbf{x-x_i}}{h}\right|\right|^2\right)\right]}_{\mbox{$\color{red} \hat{f}_{h,G}(\mathbf{x})$}}\underbrace{\left[ \frac{\sum_{i=1}^n \mathbf{x_i} g\left( \left|\left| \frac{\mathbf{x-x_i}}{h}\right|\right|^2\right)}{ \sum_{i=1}^n g\left( \left|\left| \frac{\mathbf{x-x_i}}{h}\right|\right|^2\right)} - \mathbf{x}\right]}_{\color{red} \emph{\mbox{Mean Shift, $\mathbf{m}_{h,G}(\mathbf{x})$}}}
\]
which yields the mean shift update rule, 
\[
\mathbf{m}_{h,G}(\mathbf{x}) = \frac{1}{2}h^2c \frac{\hat{\nabla}f_{h,K}(\mathbf{x})}{\hat{f}_{h,G}(\mathbf{x})} = \mathbf{y}_{j+1} - \mathbf{y}_j
\]
\end{frame}

\end{document}

相关内容