删除文本中的黑框

删除文本中的黑框

这是我的 MWE:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,positioning}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick},font=\sffamily]

\draw [very thick,decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(1,-1) -- (5,-1) node [black,midway,yshift=-1cm] {\bfseries My text};

\end{tikzpicture}

\end{document}  

如何去除“我的文本”周围的黑框?

在此处输入图片描述

答案1

我猜你需要drawin every node/.style={draw,outer sep=0pt,thick}。如果不需要,你可以删除它,然后框就会消失。

否则,请使用以下draw=none选项node

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,positioning}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick},font=\sffamily]

\draw [very thick,decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(1,-1) -- (5,-1) node [draw=none,black,midway,yshift=-1cm] {\bfseries My text};

\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

在设置上做了一个小的编辑every node/.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,positioning}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

\begin{tikzpicture}[every node/.style={},font=\sffamily]

\draw [very thick,decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(1,-1) -- (5,-1) node [black,midway,yshift=-1cm] {\bfseries My text};

\end{tikzpicture}

\end{document}  

在此处输入图片描述

相关内容