2

I wanted to created a table and I get an illegal unit of measure error, but I use cm, which works great normally.... I don't know why but sometimes I get this error and sometimes it works great... enter image description here

 \documentclass[12pt]{article}


\usepackage[ngerman]{babel}
\usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}
\usepackage[sfdefault]{ClearSans}
\usepackage[utf8]{inputenc}
\setlength{\parskip}{1.2ex}
\setlength{\parindent}{0em}
\usepackage{tabularx}

\begin{document}

\title{Stundenplanung Selbstverteidigung}
\date{}
\maketitle

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{1}}

\begin{tabular}{L{4cm}L{4cm}L{3cm}}
Name & Material & Anleitung \\

\end{tabular}
\end{document}
7

You have to add a # in every of your \newcolumntype definitions:

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}}

\newcolumntype defines a macro with one argument, this argument(the column width) can be accessed by #1.

8

You have

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{1}}

You meant

\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}

as it is it always uses 1 as the width and complains about no unit.

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.