我一直使用 Latex 编写大部分文档,到目前为止,使用数学符号时没有出现任何错误。我需要为符号使用多种颜色,但我得到的错误是
未定义控制序列。...三角形($ \color{green} \triangle $)。}
这些是先前加载的包。
\documentclass[twoside,12pt]{Latex/Classes/PhDthesisPSnPDF}
\usepackage{lineno}
\usepackage{amsbsy}
\usepackage{xspace}
\usepackage{wtmmPkg}
\usepackage[authoryear,sort]{natbib}
\usepackage{multirow}
\usepackage{graphicx} %i added
\usepackage{epstopdf} %i added
\usepackage[flushleft]{threeparttable} %i added
\usepackage{tabularx} %i added
\usepackage{cleveref}%i added
\usepackage[breaklinks=true]{hyperref}
\usepackage{paralist}
\usepackage{fancyhdr} % for better header layout
\usepackage{lscape}
\usepackage{rotating}
\usepackage{amsmath} % Advanced maths commands
\usepackage{wasysym}
\usepackage{xcolor}
\PassOptionsToPackage{usenames,dvipsnames}{xcolor}
\usepackage{textcomp}
\usepackage{xcolor,pict2e}% to allow any radius
\usepackage{mathtools}
\usepackage{tikz}
\definecolor{turquoise}{rgb}{0.19, 0.84, 0.78}
\usepackage[lofdepth,lotdepth]{subfig}
\newcommand{\bluereddot}[1][0.3]{%
\begin{tikzpicture}[scale=#1]
\draw[fill=red,red] (0,0) circle (0.15);
\draw[blue] (0,0) circle (0.5);
\end{tikzpicture}%
}
\newcommand{\blackreddot}[1][0.3]{%
\begin{tikzpicture}[scale=#1]
\draw[fill=red,red] (0,0) circle (0.15);
\draw[black] (0,0) circle (0.5);
\end{tikzpicture}%
}
在图中,我使用了许多已用颜色编码的符号。格式如下
\begin{figure*}
\centering
\includegraphics[scale=0.4]{7036vbv.jpeg}{}
\includegraphics[scale=0.4]{7036ffn.jpeg}{}
\includegraphics[scale=0.4]{7036ffv.jpeg}{}
\includegraphics[scale=0.4]{7036nnv.jpeg}{}
\caption{UV CMDs and the corresponding V$_{o} $ vs (B$-$V)$_{o}$ showing the position of the crossmatched of NGC 7036. The red filled circles show the OCR candidates that have been crossmatched with GALEX and the black filled circles shows the isochrone generated form the FSPS Model. The blue unfilled circles denote the definite members of the cluster from previous studies. The green filled diamonds in the FUV vs (FUV $ - $ NUV) CMD denote the candidates having GALEX detections only. The $ \bluegreendot$ in the FUV vs (FUV $ - $ NUV) CMD shows a probable candidate for WD in the UV region seen in Figure ~\ref{obs_area}. The coloured crosses ($ \times$) denote the stars that are found along the MS in the optical but have become bluer in the UV. In all the CMDs the UV White Dwarf is represented as a green upright triangle ($ \color{green} \triangle $).}
\label{7036CMD}
\end{figure*}
无论何时将数学符号与颜色一起使用,编译时都会出现错误。
答案1
您从未定义过 \bluegreendot。这就是未定义的控制序列的含义。
\documentclass{article}
\usepackage{tikz}
\newcommand{\bluegreendot}[1][0.3]{%
\begin{tikzpicture}[scale=#1]
\draw[fill=red,red] (0,0) circle (0.15);
\draw[blue] (0,0) circle (0.5);
\end{tikzpicture}%
}
\begin{document}
\begin{figure*}
\centering
\includegraphics[scale=0.4]{example-image-a}
\includegraphics[scale=0.4]{example-image-a}
\includegraphics[scale=0.4]{example-image-a}
\includegraphics[scale=0.4]{example-image-a}
\caption{UV CMDs and the corresponding V$_{o} $ vs (B$-$V)$_{o}$ showing the position of the crossmatched of NGC 7036. The red filled circles show the OCR candidates that have been crossmatched with GALEX and the black filled circles shows the isochrone generated form the FSPS Model. The blue unfilled circles denote the definite members of the cluster from previous studies. The green filled diamonds in the FUV vs (FUV $ - $ NUV) CMD denote the candidates having GALEX detections only. The $ \bluegreendot$ in the FUV vs (FUV $ - $ NUV) CMD shows a probable candidate for WD in the UV region seen in Figure ~\ref{obs_area}. The coloured crosses ($ \times$) denote the stars that are found along the MS in the optical but have become bluer in the UV. In all the CMDs the UV White Dwarf is represented as a green upright triangle ($ \color{green} \triangle $).}
\label{7036CMD}
\end{figure*}
\end{document}