我目前知道的 TikZ 中唯一的花括号是库中的花括号\usetikzlibrary{decorations.pathreplacing}
。但是,我不喜欢它们的外观,我更喜欢在数学模式中使用的普通括号。
我不知道如何获得它们。非常感谢您的帮助。提前谢谢您,愿上帝保佑。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\setlength{\parindent}{0cm}
\begin{document}
This is ugly:
\begin{tikzpicture}[scale=1]
\draw [decorate,decoration={brace,amplitude=10pt}] (0,0) -- (5,0);
\end{tikzpicture}
This is pretty: \\
$\overbrace{\qquad\qquad\qquad\qquad\qquad\qquad\qquad\;}$
\end{document}
编辑
尝试编译此代码时:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations,calligraphy}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw [very thick,decorate,decoration={calligraphic brace,amplitude=10pt}] (0,0) -- (5,0);
\end{tikzpicture}
\end{document}
我得到以下日志档案有错误(Pastebin 链接)。
pdflatex --version
给出以下输出:
pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX)
kpathsea version 6.3.0
Copyright 2018 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.00
答案1
尝试使用very thick
修饰符。如果你使用的是旧版本的 latex,请取消注释以修复:
\documentclass{article}
\usepackage{tikz}
% uncommment next lines if you get "Undefined control sequence ..." error
% \usepackage{expl3}
% \ExplSyntaxOn
% \int_new:N \g__prg_map_int
% \ExplSyntaxOff
\usetikzlibrary{decorations,calligraphy}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw [very thick,decorate,decoration={calligraphic brace,amplitude=10pt}] (0,0) -- (5,0);
\end{tikzpicture}
\end{document}