
我有一張帶有標題的投影機幻燈片。在它上面我有一個 tikzpicture,其中包含一個用 chemfig 繪製的分子。如果沒有分子,圖片就很好了:
然而,一旦我放入分子,就會發生這種情況:
代碼:
\documentclass[presentation,utf8,t]{beamer}
\usepackage{tikz}
\usepackage{chemfig}
\usetikzlibrary{positioning}
\begin{document}
\begin{frame}
\frametitle{A tikzpicture with some molecules}
\begin{tikzpicture}[scale=0.75]
\draw[gray] (0,0) grid (15,10);
\setcrambond{2pt};
\node[anchor=west] at (4,6) {%
\chemfig[][scale=0.5]{%
(?-[:130]O-[:190](-[:130,0.7]-[:50]OH)-[:-190](-[:190]O-[:-190,,,,dash pattern=on 2pt off 2pt])<[:-50](-[:-190]HO)-[:10,,,,line width=2pt]
?[,{<}](-[:-50,.7]NH-[:-130](=[:180,0.7]O)-[:-50]CH_3))
-[:10]O-[:-10]
?[b]-[:50](-[:190]HO)-[:-10](-[:50,.7]NH-[:130](=[:180,0.7]O)-[:50]CH_3)-[:10](-[:-10,,,,dash pattern=on 2pt off 2pt])<[:-130]O-[:-190,,,,line width=2pt]
?[b,{<}](-[:-130,.7]-[:-50]OH)
}
};
\end{tikzpicture}
\end{frame}
\end{document}
任何想法?
在 Windows 7 上透過 texworks 使用 Texlive
答案1
確實,罪魁禍首是\setcrambond
。
它需要其他兩個選項,即使它們是空的。
\setcrambond{2pt}{}{}
是正確的形式(添加;
或不添加並不重要)。