1

How does "loading a package with no arguments" e.g. \usepackage{xcolor} compare to "loading a package with an argument" e.g. \usepackage[table]{xcolor} ?!

In other words, are the two expressions equals, or "\usepackage[table]{xcolor}" has more specific use and can not be replaced by simply "\usepackage{xcolor}" ?!

I need to call "\usepackage[table]{xcolor}" to use colors in my table, but I'm wondering if I'm missing other color features by specifying only [table] as an argument !

Here is my preamble:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[french]{babel}
\usepackage[table]{xcolor} % <== Here it is
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{enumitem}
\usepackage{url}    
\usepackage{hyperref}
\usepackage[backend=biber,style=ieee]{biblatex}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{float}
\usepackage{caption}

\def\frenchtablename{Tableau}

and here is the table code:

\begin{table}[h]

\centerline{

\newcolumntype{S}{>{\columncolor{gray!50}} p{3cm}}

\arrayrulecolor{white}

\begin{tabularx}{1.1\textwidth}{|S|p{1cm}p{1cm}p{1cm}p{1cm}p{1.7cm}p{1.3cm}p{1.1cm}p{1.3cm}|}
\hline
\rowcolor{gray!50} 
\hline 
{}&\textbf{Argent}&\textbf{Cuivre}&\textbf{Indium}&\textbf{Galium}&\textbf{Germanium}&\textbf{Lithium}&\textbf{Tantale}&\textbf{Terres rares}\\
\hline
\textbf{Usage} & \rowcolor{gray!10} {Contacts & Câbles & Écrans & Leds & Wifi & Batteries & LCD, condensateurs & LCD, aimants}\\
\hline
\textbf{Part de la production mondiale dédiée aux TICs} & \rowcolor{gray!10} {21\% & 42\% & >50\% & 40\% & 15\% & 20\% & 66\% & 20\%}\\
\hline
\textbf{Réserve (ans)} & \rowcolor{gray!10} {15-30 & 40 & 10-15 & 10-15 & 10-15 & grandes & 150 & grandes}\\
\hline
\textbf{Recyclage} & \rowcolor{gray!10} {>50\% & >50\% & >1\% & >1\% & >1\% & >1\% &  >1\% & >1\%}

\end{tabularx}
}

\caption{Exemples de métaux utilisés dans les TICs et les enjeux associés (DREZET, 2012 ; VIDAL, 2016) \cite{lien1}}

\end{table}

and here is the table compiled:

enter image description here

P.S. Excuse me if it may sound a very basic question, but I'm a novice and I'm trying to clear up some confusions.

2
  • \\centerline{ is being misused here (and it shouldn't normally be used in latex just use \centering (and no braces. Commented Oct 17, 2021 at 19:18
  • @DavidCarlisle thanks for the remark Commented Oct 17, 2021 at 19:36

1 Answer 1

2

the table option causes the colortbl package to be loaded, and adds some addtional table related commands like \rowcolors.

3
  • I see, thanks @DavidCarlisle Commented Oct 17, 2021 at 19:31
  • @AmineBriki texdoc xcolor shoul dshow you the xcolor manual and all the package options ar listed in section 2.1.2 on page 7 Commented Oct 17, 2021 at 19:32
  • I will check it out @DavidCarlisle Commented Oct 17, 2021 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .