Graphics, Figures & TablesWhy are these \newcolumntype giving error?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pdela
Posts: 15
Joined: Sun May 01, 2011 6:39 pm

Why are these \newcolumntype giving error?

Post by pdela »


The \setlenght and \newcolumntype orders are given error

Code: Select all

\setlength{\heavyrulewidth}{0.3em}
\newcolumntype{K}{\sffamily\small\columncolor[gray]{0.8}\raggedright}
\newcolumntype{L}{\scriptsize\columncolor[blue]{0.8}\centering}
\newcolumntype{N}{\scriptsize\columncolor[gray]{0.8}\entering}\begin{center}
These are the packages I'm charging

Code: Select all

\documentclass[a5paper,10pt,twoside,titlepage]{article}
\usepackage[latin5]{inputenx}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{aurical}%fuente para los teoremas
\input Konanur.fd
\newcommand*\initfamily{\usefont{U}{Konanur}{xl}{n}}%fuente usada en la portada FRANCIA
\usepackage[dvipsnames,usenames]{color}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage{fancybox}
\usepackage{graphicx}
\usepackage{fancyhdr}%permite personalizar el estilo de las cabezar, pies de página, etc...
\usepackage[margin=2.5cm]{geometry}%ajusta el contenido a tamaño a5 dejando un margen de 2,5 cm
\usepackage{chronology} %Permite dibujar una línea del tiempo para
			 % añadir acontecimientos y fechas (por Tim Storer)
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{tabularx}
And this is the table I'm trying to build

Code: Select all

\setlength{\heavyrulewidth}{0.3em}
\newcolumntype{K}{\sffamily\small\columncolor[gray]{0.8}\raggedright}
\newcolumntype{L}{\scriptsize\columncolor[blue]{0.8}\centering}
\newcolumntype{N}{\scriptsize\columncolor[gray]{0.8}\entering}\begin{center}

\begin{tabular}{|K|L|N|L}
\hline
 \rowcolor[rgb]{0.8,0.8,0.8}  \multicolumn{1}{|>{\bfseries\columncolor[rgb]{0.8,0.8,0.8}}c|}{Indicador} &%
  \multicolumn{1}{>{\bfseries\columncolor[rgb]{0.8,0.8,0.8}}c|}{\centering Valor} &%
\multicolumn{1}{|>{\bfseries\columncolor[rgb]{0.8,0.8,0.8}}c|}{\centering Posición en el mundo} &%
 \multicolumn{1}{|>{\bfseries\columncolor[rgb]{0.8,0.8,0.8}}c|}{\centering Incremento}\\ 
\hline 
blah & blah & blah & blah
\end{tabular}\end{center}
I would be so thankful if anyone can have a look at it
Last edited by pdela on Sat May 28, 2011 8:49 pm, 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.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Why are these \newcolumntype giving error?

Post by localghost »

They are completely wrong defined. Tell us what you are after and we will see what can be done. Do this by building a minimal example that is compilable as provided for everybody.


Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Why are these \newcolumntype giving error?

Post by Stefan Kottwitz »

Hi,
pdela wrote:
The \setlenght and \newcolumntype orders are given error

Code: Select all

\setlength{\heavyrulewidth}{0.3em}
using \heavyrulewidth requires loading the booktabs package or at least defining that length.

Stefan
LaTeX.org admin
pdela
Posts: 15
Joined: Sun May 01, 2011 6:39 pm

Re: Why are these \newcolumntype giving error?

Post by pdela »

I'm trying to define new columns so they have a background color (gray and blue)
and the appropiate size of the text \scriptsize \small ...
pdela
Posts: 15
Joined: Sun May 01, 2011 6:39 pm

Why are these \newcolumntype giving error?

Post by pdela »

Stefan_K wrote:Hi,
pdela wrote:
The \setlenght and \newcolumntype orders are given error

Code: Select all

\setlength{\heavyrulewidth}{0.3em}
using \heavyrulewidth requires loading the booktabs package or at least defining that length.

Stefan
ok, this fixed

thank you
pdela
Posts: 15
Joined: Sun May 01, 2011 6:39 pm

Why are these \newcolumntype giving error?

Post by pdela »

I found it!

but color blue doesn't work

\

Code: Select all

setlength{\heavyrulewidth}{0.3em}
\newcolumntype{K}{>{\sffamily\small\columncolor[gray]{0.8}\raggedright}l}
\newcolumntype{L}{>{\scriptsize\columncolor[gray]{0.6}\centering}c}
\newcolumntype{N}{>{\scriptsize\columncolor[gray]{0.8}\centering}c}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Why are these \newcolumntype giving error?

Post by Stefan Kottwitz »

It would work as mandatory argument, in braces:

Code: Select all

\newcolumntype{K}{>{\sffamily\small\columncolor{blue}\raggedright}l}
Stefan
LaTeX.org admin
pdela
Posts: 15
Joined: Sun May 01, 2011 6:39 pm

Re: Why are these \newcolumntype giving error?

Post by pdela »

ok, thread solved

thanks Stefan and localghost
Post Reply