Text Formattingbeamer | Change Text Color

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

beamer | Change Text Color

Post by EigenGoofy »

Hello, all!

As the attachment shows, I want to change the color of the text located on the left upper corner from red to green.

My use color theme is

Code: Select all

\usecolortheme{crane}
I have tried following command which Does Not work:

Code: Select all

\setbeamercolor{alerted text}{fg=green}
So how can I change the color? Thank you!
Attachments
color font.jpg
color font.jpg (37.27 KiB) Viewed 30514 times
Last edited by localghost on Thu Jan 12, 2012 11:21 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

beamer | Change Text Color

Post by 5gon12eder »

This is not alerted text.

You may try one of those

Code: Select all

\setbeamercolor{palette primary}{fg=green}
\setbeamercolor{palette secondary}{fg=green}
\setbeamercolor{palette tertiary}{fg=green}
\setbeamercolor{palette quaternary}{fg=green}
It works for the Dresden theme together with the crane color theme. Since you didn't tell us what theme you are using it may or may not work. However, using Dresden with crane, the text that is red on your example should be dark blue so I suspect you have set up things differently.
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

Re: beamer | Change Text Color

Post by EigenGoofy »

Hello, 5gon12eder!

Thank you very much, 5gon12eder!

After trying Dresden theme with the crane color theme and all the four options on preamble for the code you provided, none of them really work. It may change the color of text when they are not highlighted, the color of circles, the color of author name, the color of address, or, the color of title.

The text that is red on my example is dark blue only if the current slide does not match the corresponding content. The text is from the content. You can try your own slides. If letting the current slide be the slide of introduction, then the text of introduction will be highlighted to red, and the text of conlusion, for example, remains dark blue.
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

beamer | Change Text Color

Post by 5gon12eder »

Sorry, with the file attached -- which basically is the 20 minute conference ornate template from the beamer package -- I can't reproduce the effect you described. Could you please provide a minimal working example?

Best
Attachments
demo.tex
(4.4 KiB) Downloaded 535 times
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

Re: beamer | Change Text Color

Post by EigenGoofy »

The attachment is an tex file for a minimal example.
Attachments
example1.tex
(5.54 KiB) Downloaded 528 times
Last edited by EigenGoofy on Sun Jan 22, 2012 9:21 pm, edited 1 time in total.
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

beamer | Change Text Color

Post by 5gon12eder »

This example is not just far away from being `minimal', it is almost impossible to be read by human eyes and it's obscured with tons of dysfunctional code presumably added by your WYSIWYG editor.

These are just some of the problems: Several packages are loaded more than once, and the order of package loading is counter-intuitive, the babel package is loaded without a language specified, the color package shouldn't be loaded since beamer loads xcolor by default, amsmath is also automatically loaded by beamer, lmodern should be used instead of ae & aecompl, float is almost certainly not needed in a beamer presentation (at least not in this example), amssymb, calligra, graphics (though I suggest using graphicx instead), textpos and listings are okay to use but not needed in this example, the secnumdepth and tocdepth settings are (i) default anyway and (ii) meaningless in a beamer presentation, setting the \title, \author, etc. should be done in the preamble, not in the document as should style redefinitions. Finally, there is this very strange block of plain TeX definitions in the preamble which I refuse to waste time on in order to try understanding them.

Cleaning up the example and formatting the code in a human-readable form, the code might look like this:

Code: Select all

\documentclass[11pt]{beamer}

\usepackage[latin9]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usetheme{Dresden}
\usecolortheme{crane}

\setbeamercolor{background canvas}{bg=}
\setbeamercolor{alerted text}{fg=green}
\setbeamercovered{transparent}

\AtBeginSubsection[]{
  \frame<beamer>{ 
    \frametitle{Outline}   
    \tableofcontents[currentsection,currentsubsection] 
  }
}


\title{Demon Hunter}
\author{Adam \and Eve}
\institute{Department of Hell\\University of Heaven}
\date{February 2, 2012}


\begin{document}
  \begin{frame}
    \titlepage
  \end{frame}
  
  \begin{frame}{Outline}
    \tableofcontents
  \end{frame}
  
  \section{Introduction}
  \subsection{History}
  \begin{frame}{History}
    \begin{block}{}
      \begin{itemize}
        \item<1-> Allow very complex experiments with maximum clarity and minimum effort
        \item<2-> Allow very simple experiments with minimum overhead
        \item<3-> A model is a script (there is no other reasonable way)
        \item<4-> Object oriented neural model design
        \item<5-> Integrated modeling, experimentation, analysis
        \item<6-> Container for standard, reusable component libraries.
      \end{itemize}
    \end{block}
  \end{frame}
  
  \section{Theory}
  \begin{frame}
    On their way to the anode they will acquire a kinetic energy
    \[
      E_{k}=\frac{1}{2}mv^{2}=eV
      \]
  \end{frame}  
\end{document}
And -- all of a sudden -- the strange red color disappears.
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
EigenGoofy
Posts: 42
Joined: Fri Jul 22, 2011 12:26 am

beamer | Change Text Color

Post by EigenGoofy »

Hi, 5gon12eder!

Thank you very much for your reply!

I am using LyX 2.0 with Beamer to edit my slides. This forum does not allow me to upload the file, like *.lyx, so I have to use the function from LyX to export my lyx file into the plain latex file (*.tex). During this process, there are many additional code added to the uploaded file so that it is hard to read them by human eyes. I am very sorry!

Actually, the following packages are loaded in the preamble of LyX.

Code: Select all

\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{graphics}
\usepackage{color}
\usepackage[absolute,overlay]{textpos}
\usepackage{calligra}
\usepackage{listings}
\usepackage{ae,aecompl}
I did not load the following packages as you mentioned (maybe LyX automatically add them all):
amsmath
amssymb
secnumdepth
tocdepth

If I use the way that you add the packages in LyX, as:

Code: Select all

\usepackage[latin9]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
It will induce error, like:
\usepackage
[T1]{fontenc}
The package babel has already been loaded with options:
[]
There has now been an attempt to load it with options
[english]
Adding the global options:
,english
to your \documentclass declaration may fix this.
Try typing <return> to proceed.
However the following way works:

Code: Select all

\usepackage[latin9]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
I think that why the strange red color appears is due to the feature of LyX.

Thank you, 5gon12eder~
Post Reply