In working on the native HTML generator, I have already simulated tabular, inserting HTML tags where appropriate, and starting each cell on a new line. Various technical difficulties had to be overcome, and some remain to make it more robust, but I'd like to try a different approach, if possible.
I'd like to do this using the native LaTeX tabular/array commands, inserting HTML tags at a very low level.
Using the array.sty package, I have inserted tags in \insert@column, which works fine until there are paragraph cells. Paragraphs can end up with their lines side-by-side with the other paragraphs on the same row, which causes problems because I'm using pdftotext to convert the final LaTeX output into raw text, and pdftotext is set to maintain the layout of the page, which results in side-by-side paragraphs having their lines merged together horizontally.
So in the end it comes down to being able to cause each cell, or at least each paragraph box (\@startpbox, \@endpbox}, to be forced onto a new line on the page, breaking the horizontal alignment of the \halign command.
Is there a filename for the low-level source which has the definition of \halign? I have a TeXLive distribution, and have already found source2e.pdf, but that doesn't go to the TeX primitive level.
Better yet, is there some command to insert alongside the HTML tags to force \halign to break the horizontal layout and start the next cell on a new line?
Thanks.
General ⇒ Unwrap a table inside \halign
Unwrap a table inside \halign
Brian Dunn
BDTechConcepts.com
BDTechConcepts.com
NEW: TikZ book now 40% off at Amazon.com for a short time.

Unwrap a table inside \halign
Here is a minimum-working example to play with.
(I will also have to find a way to pass a boolean from the paragraph commands to insert@column to modify its tag, instead of printing separate par tags.)
(I will also have to find a way to pass a boolean from the paragraph commands to insert@column to modify its tag, instead of printing separate par tags.)
Code: Select all
\documentclass{article}
\usepackage{lmodern}
\usepackage{array}
\makeatletter
\let\originsert@column\insert@column
\renewcommand{\insert@column}{(TD)\originsert@column(/TD)}
\let\orig@startpbox\@startpbox
\renewcommand{\@startpbox}[1]{\orig@startpbox{#1}(par)}
\let\orig@endpbox\@endpbox
\renewcommand{\@endpbox}{(/par)\orig@endpbox{}}
\makeatother
\begin{document}
\begin{tabular}{lp{2in}p{2in}}
% \makeatletter
% \show\@preamble
% \makeatother
A & B & C \\
D & E & F \\
\multicolumn{3}{c}{GG} \\
H &
II IIII III I IIII II I \newline III II II &
J JJJ J JJJJ JJJJ JJJ JJJJ JJ JJJ \\
\end{tabular}
\end{document}
Brian Dunn
BDTechConcepts.com
BDTechConcepts.com