提问于:
浏览数:
2259
## 编译环境
操作系统
* [ x] Windows 7/8/10
Tex发行版
* [x ] TexLive `2020`
## 我的问题
书中第826页,有如下示例:
```tex
\tikz{
\coordinate["$A$"] (A) at (2,2);
\coordinate["$B$" below] (B) at (0,0);
\coordinate["$C$" below] (C) at (3,0);
\draw (A) -- (B) -- (C) -- cycle;
\path
let \p1 =($(A)-(B)$), \p2 =($(A)-(C)$),
\n1 = {veclen(\x1,\y1)}, \n2 = {veclen(\x2,\y2)}
in coordinate ["$D$" below]
(D) at ($ (B)!scalar(\n1/(\n1+\n2))!(C) $);
\draw (A) -- (D);
}
```
这段代码怎么才能编译通过?
我将其写入测试文件:
```tex
\documentclass[UTF8]{ctexart}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\tikz{
\coordinate["$A$"] (A) at (2,2);
\coordinate["$B$" below] (B) at (0,0);
\coordinate["$C$" below] (C) at (3,0);
\draw (A) -- (B) -- (C) -- cycle;
\path
let \p1 =($(A)-(B)$), \p2 =($(A)-(C)$),
\n1 = {veclen(\x1,\y1)}, \n2 = {veclen(\x2,\y2)}
in coordinate ["$D$" below]
(D) at ($ (B)!scalar(\n1/(\n1+\n2))!(C) $);
\draw (A) -- (D);
}
\end{document}
```
系统报错:
> Package pgfkeys: I do not know the key '/tikz/\"$A$\"' and I am going to ignore it. Perhaps you misspelled it.