# How to set table size to \linewidth without using a package such as tabularx?

PLOS journals provide the following instructions for preparing a LaTeX manuscript:

1. Do NOT use any other packages than those specified in the template. If you use any other packages, your manuscript will be returned.
2. Please limit the use of macros. The conversion software we use often cannot handle even "simple" macros, which then increase the chance for errors in the converted document.

The template only uses the packages: amsmath, amssymb, graphicx, cite, and color.

Here is an example of the table that I would like to include in my document:

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{color}
\topmargin 0.0cm
\oddsidemargin 0.5cm
\evensidemargin 0.5cm
\textwidth 16cm
\textheight 21cm
\usepackage[labelfont=bf,labelsep=period,justification=raggedright]{caption}
\makeatletter
\makeatother
\date{}
\begin{document}
\begin{table}[!ht]
\caption{\bf{Test Table}}
\begin{tabular*}{1\linewidth}{@\extracolsep{\fill}}{rllllrrrlllll}
\hline
& Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 \\
\hline
& Rowname & something  & 1000000 & 200 & 3000 & 40 &   1.5 & 320000 & 5.8 & 80 &  $^\ast$   \\
\hline
\end{tabular*}
\begin{flushleft}
caption text caption text
\end{flushleft}
\label{tab:priors}
\end{table}
\end{document}

I have tried to adapt the answer to a previous question along the lines of: \begin{tabular*}{.5\linewidth}{@{\extracolsep{\fill}}rllllrrrlllll}, but this does not work.

-
tabularx is part of the required packages of LaTeX and therefore part of LaTeX (2e that is). Apparently they don't use (La)TeX but some "conversion software" to convert it to something else. Really a shame! But all of this doesn't help you. –  Martin Scharrer May 3 '11 at 22:29
Please don't use \bf in modern LaTeX documents. The correct macro is \textbf{...}. See Does it matter if I use \textit or \it for an explanation. Apart from this \bf{...} is wrong (if you using the default definition) and should be {\bf ...}. –  Martin Scharrer May 3 '11 at 22:32
@Martin PLOS apparently has a few other really stupid restrictions, such as “no vector graphics” (only TIFF). The “best practices” are basically a list of LaTeX “don’t”s. –  Konrad Rudolph May 4 '11 at 8:16
@Konrad: I'm not surprised. I assume it is nearly impossible to change their minds about that. –  Martin Scharrer May 4 '11 at 8:18

If you want to make the total width of the table equal to \linewidth and to have the columns evenly spaced, then you can reduce the font for the table (using, for example, \fontsize as in my example code), then set the inter-column space to 0pt (redefining \tabcolsep), and then use

\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}llllrrrllll}

(there was an error in your code).

I also suppressed the commands depending on the caption package since it is not on the list of "accdepted" packages, and increased the vertical space between rows (redefining \arraystretch):

\documentclass[10pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{color}
\topmargin 0.0cm
\oddsidemargin 0.5cm
\evensidemargin 0.5cm
\textwidth 16cm
\textheight 21cm

\date{}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{table}[!ht]
\footnotesize
\caption{Test Table}
\renewcommand\arraystretch{1.3}
\renewcommand\tabcolsep{0pt}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}llllrrrllll}
\hline
Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 & Column1 \\
\hline
Rowname & something  & 1000000 & 200 & 3000 & 40 &   1.5 & 320000 & 5.8 & 80 &  $^\ast$   \\
\hline
\end{tabular*}\par\medskip
text caption text
\label{tab:priors}
\end{table}

\end{document}

This produces:

-

You have a syntax error in your code. It should be:

\begin{tabular*}{1\linewidth}{@{\extracolsep{\fill}}rllllrrrlllll}

not

\begin{tabular*}{1\linewidth}{@\extracolsep{\fill}}{rllllrrrlllll}

This gives you the following table. Note that your example content is to wide for \linewidth.

You didn't states what result you really want (i.e. how the table should be aligned etc.), so I can't tell if this is all you need. An alternative option would be to just typeset the table in its natural width and center it using \centering.

-