1

I am trying to change the color of the name of a section in ACM template.

\section{\color{red} My Section}

I have found this solution but it did not work.

It gives the error of Undefined color RED

This is my code:

\documentclass[acmlarge]{acmart} 

\settopmatter{printacmref=false}% 
\renewcommand\footnotetextcopyrightpermission[1]{}% 
\renewcommand\footnotetextauthorsaddresses[1]{}% \pagestyle{plain} 
\fancyfoot{} 

\makeatletter 
\def\runningfoot{\def\@runningfoot{}} 
\def\firstfoot{\def\@firstfoot{}} 
\def\@copyrightspace{\relax} 
\makeatother 

\usepackage{amsmath} 
\usepackage{amsfonts} 
\usepackage{amsthm}  
\usepackage{amssymb} 
\usepackage[mathscr]{euscript}
\usepackage{booktabs} % For formal tables


\begin{document} 

\title{My Title} 

\author{Me} 

\maketitle 

\thispagestyle{empty} 

\section{\color{red} My Section}

This is my file. This is an algorithm, called \textsc{exp3}. Numbers like $1,2,3$ are not small caps. 

\end{document}
3

As you can see in the log file, the error says ! Package xcolor Error: Undefined color RED. while you are using the red one! It's because of changing the case by section macro, therefore you have to prevent this action. The following will fix your issue by preventing uppercase. \lowercase macro also forces latex not to convert to uppercase.

\protected\def\mycolor{\color{red}}

\section{\mycolor My Section}
\section{\lowercase{\color{green}}My Section}

enter image description here

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.