Text FormattingSpecific New Column Issue

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Specific New Column Issue

Post by InquisitorMo »

I cannot figure out why this won't work, as I've done it before in the exact same document.

I'm trying to right align a fixed width column, but I get an "undefined control sequence" error.

If I change the letter "z" to a "p" (so in other words just specify a fixed width column, then this MWE compiles.

Code: Select all

\documentclass[12pt]{article}
\usepackage{tabularx}

% Another column I used with different syntax, which works 
% correctly in another part of the document when I use R{2in}
% in the column parameter.
%\newcolumntype{R}{>{\raggedleft\arraybackslash}X}

\newcolumntype{z}[1]{>{\ragggedleft\arraybackslash}p{#1}} 

\begin{document}
  \begin{tabularx}{\textwidth}{r l | z{2in} l}
    \textbf{\small{Text}} & \small{Text} & \textbf{\small{Text}} & \small{Text} \\
  \end{tabularx}
\end{document}

Recommended reading 2024:

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

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

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

Specific New Column Issue

Post by localghost »

A very good example! Minimal and self-contained, thus easy to handle.

The macro is called \raggedright. You have inserted a "g" too much in the declaration of your z column type.

By the way, using your R column type seems to be better here since you are in a tabularx environment.


Thorsten
InquisitorMo
Posts: 44
Joined: Mon Jul 15, 2013 12:22 am

Re: Specific New Column Issue

Post by InquisitorMo »

After an hour of thinking I was doing something completely structurally wrong... that typo was VERY painful. But I still wound up laughing at myself.

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

Specific New Column Issue

Post by localghost »

Typos can happen to everyone of us. It's just a case of missing the forest for the trees here.
Post Reply