Extension talk:Wiki2LaTeX/Development/w2lParser.php

Table support
I've transplanted the table parser from mediaWiki into doTableStuff and externalTableHelper, so the parser is now totally compatible with the wiki table markup supported by mediaWiki. (Except captions, that requires some extra LaTeX fiddeling, like putting the table inside a figure, or something.)

To coax LaTeX into making a nice table, some extra input is needed. Therefore, I added support for an extra attribute "latexfmt" to the table. The attribute as then passed on to LaTeX to tell how many rows there are, and which type of cells should be used for each row. An extra cell type Y is introduced for left-aligned text than can wrap. Example:

HTML-style tables can be supported by replacing &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; etc. in processHtmlEntities, but the tables will normally look terrible because the latexfmt attribute is missing.

-Ole, Aug 22nd 2007.


 * "The attribute as then passed on to LaTeX to tell how many rows there are...", don't you mean "columns"? Could you post the tex script generated for this example so I can double check that what I'm seeing is correct? I don't get any vertical lines, unfortunately I wouldn't quite call it a "nice" table! Hoogs 11:03, 24 September 2007 (UTC)
 * The error was caused by a typo above at the latexfmt-attribute. Should work now as expected.--HG 11:40, 24 September 2007 (UTC)