0

On beamer document class, in the part of \author does not let me put an specific color.

I have

\author{\pink{ my name} \\ other name}

Specifically does not work with \pink but it does for \blue,\green, etc.

Also I indicate to put color only on {my name} but it automatically put color on {other name}, why?

I am using \usepackage[dvipsnames]{xcolor}

Help me please

  • 2
    Please make a compilable minimal working example (MWE) that shows what you tried. – leandriis Mar 23 at 21:19
  • 2
    The general usage of the command is as follows: \textcolor{<color>}{<text>} Applied to your case this would be \textcolor{pink}{ my name} – leandriis Mar 23 at 21:27
  • 2
    @user178403: As already mentioned, a MWE would be very helpful to see what code you use and where possible errors come from. Using \usepackage[divsnames]{xcolor} in combination with the beamer documentclass will by the way generate an error message which should in general not be ignored. – leandriis Mar 23 at 21:44
  • 4
    @user178403 If you want to use dvipsnames with beamer: \documentclass[xcolor={dvipsnames}]{beamer}, but you will still need to use the proper colour syntax, either \textcolor{pink}{...} or {\color{pink}....}. – user36296 Mar 23 at 21:50
  • 2
    @user178403 Never ignore error messages. Fix all 18 errors before you try to further customise your presentation. – user36296 Mar 23 at 22:35
1

The combination of \usepackage[dvipsnames]{xcolor} with the beamer documentclass will result in an eror message. The correct usage is the following: \documentclass[xcolor=dvipsnames]{beamer}.

In order to color a certain text, you have the following possibilities:

a) The \textcolor{<color>}{<text>} command:

\documentclass[xcolor=dvipsnames]{beamer}
\author{\textcolor{pink}{my name} \\ other name}

\begin{document}
\begin{frame}
\maketitle
\end{frame}
\end{document}

b) The \color{<color>} switch that is active inside a group or until a different \color switch is used:

\documentclass[xcolor=dvipsnames]{beamer}
\author{{\color{pink} my name} \\ other name}

\begin{document}
\begin{frame}
\maketitle
\end{frame}
\end{document}

c) Define your own \pink{<text>} command using \newcommand as shown in the following example:

\documentclass[xcolor=dvipsnames]{beamer}
\newcommand{\pink}[1]{\textcolor{pink}{#1}}
\author{\pink{my name} \\ other name}

\begin{document}
\begin{frame}
\maketitle
\end{frame}
\end{document}
  • 1
    Thanks for removing this from the list of unanswered questions! – user36296 Mar 24 at 16:12

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.