Featured Book

LaTeX Beginners Guide

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 4 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

xcolor package and beamer

Add tags Information and discussion about specific document classes and how to create your own document classes.

xcolor package and beamer

Postby m.carrara3 on Sat Sep 13th, 2008

I have a problem; I'm using beamer class for my thesis presentation and I need to change the font's color into a tabular enviroment but it doesn't work.
After \begin{document} I'm using this package
Code: Select all  •  Open in writeLaTeX
\usepackage[dvipsnames]{xcolor}

I also post the code I'm using into the document:
Code: Select all  •  Open in writeLaTeX
\resizebox{\textwidth}{!}{
\begin{tabular}{|l|c|}
\hline
                        \textbf{{\textcolor{red}{Mg}}} & {\textcolor{red}{59.20 $\%$}} \\
                        \hline
                        \textbf{Al micrometrico} & 36.20 $\%$ \\
                        \hline
                        \textbf{{\textcolor{ForestGreen}{Al nanometrico}}} & {\textcolor{ForestGreen}{23.04 $\%$}} \\
                        \hline
                        \textbf{$MgH_2$} & 33.65 $\%$ \\
                        \hline
                        \textbf{Al nano + $MgH_2$} & 37.15 $\%$ \\
\hline
\end{tabular}
}


Any suggestion?

M
m.carrara3
 
Posts: 21
Joined: Mon Sep 8th, 2008

Re: xcolor package and beamer

Postby localghost on Sat Sep 13th, 2008

I assume that you are compiling with pdflatex hence you are loading the xcolor package with the wrong option.
Code: Select all  •  Open in writeLaTeX
\usepackage[svgnames]{xcolor}

This line has to be inserted in the preamble, not in the body of the document. Names of colors stay the same.


Best regards
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: xcolor package and beamer

Postby m.carrara3 on Sat Sep 13th, 2008

I've already put \usepackage command in the preable;
now I changed the option with the one you gave to me but it still doesn't work out...

Error message says to me:
Package xcolor Error: Undefined color ForestGreen...

Even if I put the right option class for ForestGreen color; I looked also to xcolor guide but it doesn't seem to solve my problem at all...

I tried also to use xcolor command outside tabular but I got the same error...
m.carrara3
 
Posts: 21
Joined: Mon Sep 8th, 2008

Re: xcolor package and beamer

Postby localghost on Sat Sep 13th, 2008

The main fault is to load the xcolor package again because it is already loaded by the beamer class. This is expressed by an error message (which you should get, too).
Code: Select all  •  Open in writeLaTeX
! LaTeX Error: Option clash for package xcolor.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

To avoid this, put the option svgnames into the option list for the document class. It will be passed to xcolor.
Code: Select all  •  Open in writeLaTeX
\documentclass[svgnames,smaller]{beamer}

Delete the line which loads the package and it will work fine.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: xcolor package and beamer

Postby m.carrara3 on Sat Sep 13th, 2008

Cool!!!! It works perfectly!!! Thanks!!!!
m.carrara3
 
Posts: 21
Joined: Mon Sep 8th, 2008

Re: xcolor package and beamer

Postby dejan85 on Sat Nov 8th, 2008

I have the similar problem. I follow instruction from site http://faculty.csuci.edu/jorge.garcia/tex/beamer.htm to install beamer, a test beamer with their template.txt from site. I got the same error
Code: Select all  •  Open in writeLaTeX
"! LaTeX Error: Option clash for package xcolor..."
.
template.txt :
Code: Select all  •  Open in writeLaTeX
\documentclass[t]{beamer}
\input mybeamersettings

First line I changed to "\documentclass[svgnames,smaller]{beamer}" but I got the same error.
I download some presentation with first lines
Code: Select all  •  Open in writeLaTeX
\documentclass[10pt]{beamer}
\mode<presentation> {
  \usetheme{Warsaw}
  \setbeamercovered{transparent}
}

and the same error appears.
I can't make pdflatex with any correct .tex fail.
Please, can you tell me what may be a problem. I need to fix this very soon for my thesis presentation.
dejan85
 
Posts: 8
Joined: Sat Nov 8th, 2008

Re: xcolor package and beamer

Postby Stefan_K on Sat Nov 8th, 2008

Hi,

dejan85 wrote:First line I changed to "\documentclass[svgnames,smaller]{beamer}" but I got the same error.

Further you have to remove the line
Code: Select all  •  Open in writeLaTeX
\usepackage[...]{xcolor}

in your preamble or mybeamersettings.tex.

If this doesn't help please post a small code example containing enough information.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6312
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: xcolor package and beamer

Postby dejan85 on Sat Nov 8th, 2008

I want to remove this line, but it doesn't exist, neither in my tex file, nor in the mybeamersettings.tex. In mybeamersettings there are only two lines with usepackage:
Code: Select all  •  Open in writeLaTeX
\usepackage[english]{babel}
\usepackage{listings,amsmath,multimedia
}

I didn't make the presentation, I'd downloaded the example from http://faculty.csuci.edu/jorge.garcia/tex/beamer.htm. It should be working. You can look at the example. There is no "\usepackage[...]{xcolor}" line.
dejan85
 
Posts: 8
Joined: Sat Nov 8th, 2008

Re: xcolor package and beamer

Postby Stefan_K on Sun Nov 9th, 2008

The error message shows that the xcolor package was loaded more than once. Have a look at "Option clash for package" in the UK TeX FAQ for more information.
That example worked for me. For further investigation you could post your .log file as attachment here, perhaps we would find the cause there.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6312
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: xcolor package and beamer

Postby dejan85 on Sun Nov 9th, 2008

I look at my.log file and I find lines that contains xcolor
Code: Select all  •  Open in writeLaTeX
C:\texmf\tex\latex\xcolor\xcolor.sty
...
C:\texmf\tex\latex\pgf\xxcolor.sty

After second line there is Option clash... Probably, latex load xcolor package more than once automatically, so I really don't know how to solve problem. I upload my .log file.
Attachments
template.log
my log file
(9.52 KiB) Downloaded 100 times
dejan85
 
Posts: 8
Joined: Sat Nov 8th, 2008

Next

Return to Document Classes

Who is online

Users browsing this forum: No registered users and 4 guests