I have recently found myself needing to convert some lovely LaTeX-typeset tables into a format that MS Word can handle more gracefully than pasting in as a graphic. Kieran last year pointed to tools such as Hevea (along with a set of regular expressions—all hail—) to do the work. I’ve heard from others that tools such as latex2rtf work quite well. Both of those tools are pretty heavy duty, however (the Hevea manual is a 500K PDF which is still downloading from a slow server, and latex2rtf has a slew of config files and options), especially for my lightweight task.
For quickly making word-acceptable (ugly, but editable by your editor or colleagues) tables, I found a reasonably easy process: 1) output the table to a small standalone LaTeX file; 2) use TTH to convert the table to HTML; 3) paste the table into Word; 4) use Word’s “convert text to table” command. You’ll then have a useable table, ready for whatever formatting tweaking you want to do. This all takes about 30 seconds per table.
This has worked just fine for my purposes—specifically in this case, building a set of summary tables in R that need to be brought into a Word document (Word turned out not to handle converting into a table the text pasted straight from R). The estimable Frank Harrell has some further instructions, as well as a small wrapper script, to make TTH work with Sweave documents, too.
\documentclass[a4paper,10pt]{article}
\usepackage{graphicx}
\usepackage{lscape}
\title{Output tables for 1xN statistical comparisons.}
\author{}
\date{\today}
\begin{document}
\begin{landscape}
\pagestyle{empty}
\maketitle
\thispagestyle{empty}
\section{Average rankings of Friedman test}
Average ranks obtained by each method in the Friedman test.
\begin{table}[!htp]
\centering
\begin{tabular}{|c|c|}\hline
Algorithm&Ranking\\\hline
Algorithm 1&3.5\\Algorithm 2&3.5\\Algorithm 3&3.5\\Algorithm 4&3.5\\Algorithm 5&3.5\\Algorithm 6&3.5\\\hline\end{tabular}
\caption{Average Rankings of the algorithms (Friedman)}
\end{table}
Friedman statistic (distributed according to chi-square with 5 degrees of freedom): 0. \newline P-value computed by Friedman Test: 1.\newline
Iman and Davenport statistic (distributed according to F-distribution with 5 and 45 degrees of freedom): 0. \newline P-value computed by Iman and Daveport Test: 1.\newline
\newpage
\section{Post hoc comparison (Friedman)}
P-values obtained in by applying post hoc methods over the results of Friedman procedure.
\begin{table}[!htp]
\centering\footnotesize
\begin{tabular}{ccccccccc}
$i$&algorithm&$z=(R_0 – R_i)/SE$&$p$&Holm Hochberg Hommel &Holland&Rom&Finner&Li\\
\hline5&Algorithm 2&0&1&0.01&0.010206&0.010515&0.010206&0\\4&Algorithm 3&0&1&0.0125&0.012741&0.013109&0.020308&0\\3&Algorithm 4&0&1&0.016667&0.016952&0.016667&0.030307&0\\2&Algorithm 5&0&1&0.025&0.025321&0.025&0.040204&0\\1&Algorithm 6&0&1&0.05&0.05&0.05&0.05&0.05\\\hline
\end{tabular}
\caption{Post Hoc comparison Table for $\alpha=0.05$ (FRIEDMAN)}
\end{table}Bonferroni-Dunn’s procedure rejects those hypotheses that have a p-value $\le0.01$.
Holm’s procedure rejects those hypotheses that have a p-value $\le0.01$.
Hommel’s procedure rejects those hypotheses that have a p-value $\le0.01$.
Holland’s procedure rejects those hypotheses that have a p-value $\le0.010206$.
Finner’s procedure rejects those hypotheses that have a p-value $\le0.010206$.
Li’s procedure rejects those hypotheses that have a p-value $\le0$.
\newpage
\section{Adjusted P-Values (Friedman)}
Adjusted P-values obtained through the application of the post hoc methods (Friedman).
\begin{table}[!htp]
\centering\small
\begin{tabular}{ccccccc}
i&algorithm&unadjusted $p$&$p_{Bonf}$&$p_{Holm}$&$p_{Hochberg}$&$p_{Hommel}$\\
\hline1&Algorithm 2&1&5&5&1&1\\2&Algorithm 3&1&5&5&1&1\\3&Algorithm 4&1&5&5&1&1\\4&Algorithm 5&1&5&5&1&1\\5&Algorithm 6&1&5&5&1&1\\\hline
\end{tabular}
\caption{Adjusted $p$-values (FRIEDMAN) (I)}
\end{table}
\begin{table}[!htp]
\centering\small
\begin{tabular}{ccccccc}
i&algorithm&unadjusted $p$&$p_{Holland}$&$p_{Rom}$&$p_{Finner}$&$p_{Li}$\\
\hline1&Algorithm 2&1&1&1&1&1\\2&Algorithm 3&1&1&1&1&1\\3&Algorithm 4&1&1&1&1&1\\4&Algorithm 5&1&1&1&1&1\\5&Algorithm 6&1&1&1&1&1\\\hline
\end{tabular}
\caption{Adjusted $p$-values (FRIEDMAN) (II)}
\end{table}
\newpage
\end{landscape}\end{document}
— t Jan 5, 06:57 AM #