If I do the following command:
xtable(diamonds[1:5,1:4], label = 'tab:myTab', caption='This is my caption',align = c("rr|lr|r"))
I get the following output:
\begin{table}[ht]
\centering
\begin{tabular}{rr|lr|r}
\hline
& carat & cut & color & clarity \\
\hline
1 & 0.23 & Ideal & E & SI2 \\
2 & 0.21 & Premium & E & SI1 \\
3 & 0.23 & Good & E & VS1 \\
4 & 0.29 & Premium & I & VS2 \\
5 & 0.31 & Good & J & SI2 \\
\hline
\end{tabular}
\caption{This is my caption}
\label{tab:myTab}
\end{table}
My question is: Is it possible to have the xtable output not {table}, but rather {table*}?
========================= EDIT =========================
I am taking into account Repmat's input. I am using the code found here (How to center LaTeX xtable output in full text width).
1) I added one package to their preamble
\usepackage{tabularx}
2) Then, I changed their command:
print(x.big, tabular.environment ='longtable', floating = FALSE, include.rownames=FALSE)
To four commands:
print(x.big, tabular.environment ='tabular*', include.rownames=FALSE, width= "\\linewidth")
print(x.big, tabular.environment ='tabular*', include.rownames=FALSE, width= "\\textwidth")
print(x.big, tabular.environment ='tabularx', include.rownames=FALSE, width = "\\linewidth")
print(x.big, tabular.environment ='tabularx', include.rownames=FALSE, width= "\\textwidth")
Each time, this generated an output as follows:
When what I am trying to do is generate output more like:
I would not mind having to just move the xtable over by a hard-coded specified amount too (like by 3 inches to the right) - but I have been able to figure that out as well.
{table*}
and{table}
? maybe it is related to table numeration in latex, is it? – SabDeM