0

I have been using Latex to write most of my documents and I have had no errors so far when using Math symbols. I need to use many colors for the symbols but the error that I get is

Undefined control sequence. ... triangle ($ \color{green} \triangle $).}

These are the packages previously loaded.

\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}%
}

In the figure, I have used many symbols that have been color coded. The format is the following

\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*}

Wherever the math symbols are used with colors, there is an error that comes when compiling.

  • 3
    Could you please minimalize your code to a minimal, but (not)working example. That means only one code snippet and only necessary packages. – TeXnician May 26 '17 at 11:40
  • 1
    Put the colour instruction outside the maths environment. \color{green}$ ...$ or whatever. – cfr May 26 '17 at 11:55
  • 1
    Probably \DeclareRobustCommand{\bluereddot} instead of \newcommand{\bluereddot} (and similarly for the others) should help. – egreg May 26 '17 at 12:06
  • 2
    Please, post the full error message including line breaks. Then it can tell you the command that is undefined. Also error messages contain the line number that helps identifying the place in the source file. – Heiko Oberdiek May 26 '17 at 12:35
2

You never defined \bluegreendot. That's what undefined control sequence means.

\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}
  • Thanks. This must have slipped my mind when finishing the work. – BRMBU May 28 '17 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.