I use ctable to make my LaTeX tables. My ultimate goal is to produce a presentation of HTML5 slides. The tables that I need to present are all created in LaTeX with ctable.

For example, I have my LaTeX ctable saved in table.tex. Then I try

pandoc -s table.tex -o table.md

to create a markdown version of the table, so that I can then use

pandoc -s --mathjax -S -i -t slidy table.md -o table.html

to produce the HTML5 slides. However, the first step

pandoc -s table.tex -o table.md

just produces a completely empty file table.md.

How can create an HTML5 slideshow with tables created in LaTeX ctable?

Here is an example ctable, so this code would be the contents of table.tex referenced above.

\ctable[botcap,caption={Basic descriptive statistics for GSS data},label=tab:gss1,pos=!tbp,]{lrrr}{}{\FL
\multicolumn{1}{l}{}&\multicolumn{1}{c}{N}&\multicolumn{1}{c}{mean}&\multicolumn{1}{c}{std. dev.}\ML
age&$1969$&$   48.19$&$   17.69$\NN
children&$1971$&$    1.89$&$    1.67$\NN

migrated from stackoverflow.com Jan 1 '14 at 9:08

This question came from our site for professional and enthusiast programmers.

  • You should ask your (La)TeX questions on TeX - LaTeX. – Matt Ball Jan 1 '14 at 2:07
  • But it's not a latex question. I want to generate markdown and html output from the latex input. The latex input is fine, and I can generate ps and pdf output from the latex as it is fine. – user3149973 Jan 1 '14 at 2:13
  • I want to use this latex input to produce html5 slide output. How to do that is my question – user3149973 Jan 1 '14 at 2:14
  • This isn't a LaTeX/TeX question as pandoc does not use tex. You may get some helpful suggestions (especially as I've just seen that John MacFarlane has an account here) but in general, this isn't the place to post pandoc questions. – Loop Space Jan 1 '14 at 19:49

Pandoc doesn't seem to support ctable. When it generates LaTeX tables from Markdown, for example, it uses longtable. See the PDF requirements.

Having said that, I haven't been able to get it to parse tables from LaTeX at all, regardless of the table implementation.

I see two options:

  • Change your input file format to something that Pandoc can fully ingest, like its enhanced Markdown format. It supports tables and TeX-style math.

    I get the impression that you have made a significant investment in your existing source files, so this is unlikely to be a good solution for you.

  • Change your presentation format to PDF and use something like Beamer to generate your presentation directly from LaTeX.

    Incidentally, Pandoc supports Beamer output and handles it very well from Markdown source:

    pandoc -s --mathjax -S -i -t beamer -R test.md -o test.pdf

    You may also be able to tweak your .tex file and use the -R raw option to Pandoc to pass unrecognized LaTeX from your source file directly through to Beamer, though I haven't gotten this to work. I'm not enough of a LaTeX expert to troubleshoot this.

If HTML output and LaTeX input are both non-negotiable, you may be stuck tweaking tables manually as you do your conversion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy