括号排版错误

括号排版错误

TikZ没有使用以下命令编译代码。

\draw[decorate,decoration={brace,raise=5pt,amplitude=5pt,mirror}] (a_mark_for_start_of_brace_near_A_for_brace_AC) -- (a_mark_for_end_of_brace_near_C_for_brace_AC);

\usetikzlibrary{calc,quotes,decorations.markings}在序言中已经说过了。

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,positioning,quotes,decorations.markings}

\begin{document}

\begin{tikzpicture}

\draw[latex-latex,name path=ell] (200:4) -- (20:4);
\coordinate (label_for_ell) at ($(20:4) +(20:3mm)$);
\node at (label_for_ell){$\ell$};

\coordinate (A) at (0,0);
\draw[fill, blue] (A) circle (1.5pt);
\node at ($(A)!-3mm!90:(20:3)$){$A$};

\coordinate (B) at (200:2);
\node at ($(B)!-3mm!90:(0,0)$){$B$};
\draw[fill, blue] (B) circle (1.5pt);

\coordinate (C) at (20:3);
\node at ($(C)!3mm!90:(0,0)$){$C$};
\draw[fill, blue] (C) circle (1.5pt);

%Braces indicating the distance between A and C is typeset. 
\coordinate (a_mark_for_start_of_brace_near_A_for_brace_AC) at ($(A)!3mm!-90:(C)$);
\coordinate (a_mark_for_end_of_brace_near_C_for_brace_AC) at ($(C)!3mm!90:(A)$);
%\draw[decorate,decoration={brace,raise=5pt,amplitude=5pt,mirror}] (a_mark_for_start_of_brace_near_A_for_brace_AC) -- (a_mark_for_end_of_brace_near_C_for_brace_AC);


%Title for the signed distance between A and C if C is such that B is between A and itself.
%M is the intersection of the vertical line through the point on which the label $\ell$ is
%centered and the point at which one of the arrowheads on $\ell$ is.
\coordinate (M) at (label_for_ell |- 200:4);
\coordinate (lower_left_corner_of_first_display) at ($(200:4) +(0,-0.3)$);
\coordinate (lower_right_corner_of_first_display) at ($(M) +(0,-0.3)$);
\coordinate (title_for_first_display) at ($(lower_left_corner_of_first_display)!0.5!(lower_right_corner_of_first_display)$);
\node[font=\bfseries,anchor=north,inner sep=0,align=center] at (title_for_first_display){$C$ is such that $B$ is between \\ $A$ and itself};

\end{tikzpicture}
\end{document}

答案1

对于name path钥匙,您需要intersections库,而brace装饰也需要decorations.pathreplacing库:

在此处输入图片描述

代码:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc,positioning,quotes,decorations.markings,intersections,decorations.pathreplacing}

\begin{document}

\begin{tikzpicture}

\draw[latex-latex,name path=ell] (200:4) -- (20:4);
\coordinate (label_for_ell) at ($(20:4) +(20:3mm)$);
\node at (label_for_ell){$\ell$};

\coordinate (A) at (0,0);
\draw[fill, blue] (A) circle (1.5pt);
\node at ($(A)!-3mm!90:(20:3)$){$A$};

\coordinate (B) at (200:2);
\node at ($(B)!-3mm!90:(0,0)$){$B$};
\draw[fill, blue] (B) circle (1.5pt);

\coordinate (C) at (20:3);
\node at ($(C)!3mm!90:(0,0)$){$C$};
\draw[fill, blue] (C) circle (1.5pt);

%Braces indicating the distance between A and C is typeset. 
\coordinate (a_mark_for_start_of_brace_near_A_for_brace_AC) at ($(A)!3mm!-90:(C)$);
\coordinate (a_mark_for_end_of_brace_near_C_for_brace_AC) at ($(C)!3mm!90:(A)$);
\draw[decorate,decoration={brace,raise=5pt,amplitude=5pt,mirror}] (a_mark_for_start_of_brace_near_A_for_brace_AC) -- (a_mark_for_end_of_brace_near_C_for_brace_AC);


%Title for the signed distance between A and C if C is such that B is between A and itself.
%M is the intersection of the vertical line through the point on which the label $\ell$ is
%centered and the point at which one of the arrowheads on $\ell$ is.
\coordinate (M) at (label_for_ell |- 200:4);
\coordinate (lower_left_corner_of_first_display) at ($(200:4) +(0,-0.3)$);
\coordinate (lower_right_corner_of_first_display) at ($(M) +(0,-0.3)$);
\coordinate (title_for_first_display) at ($(lower_left_corner_of_first_display)!0.5!(lower_right_corner_of_first_display)$);
\node[font=\bfseries,anchor=north,inner sep=0,align=center] at (title_for_first_display){$C$ is such that $B$ is between \\ $A$ and itself};

\end{tikzpicture}
\end{document}

相关内容