我有一个用数组和 tabularx 定义的乳胶表,请参阅下面的代码。
在 PDF 中,它看起来很好:
当我将其转换为 epub 时,它就完全损坏了:
我还有希望解决这个问题吗,还是我应该放弃 epub?我现在认为我应该只分发 PDF 本身,以确保它看起来不错。但是,如果它可以在电子阅读器上阅读就太好了。
用乳胶制作 epub 是难的。我最终使用了这个工作流程:
latexml --dest tmp/book.xml main.tex
latexmlpost -dest=tmp/book.html tmp/book.xml
ebook-convert tmp/book.html tmp/book.epub --language en --no-default-epub-cover
乳胶表代码的开头:
% centered X for tabularx
% see https://tex.stackexchange.com/a/89932
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\newcommand{\tx}{{\tt X}}
\newcommand{\ty}{{\tt Y}}
\[
% two rows of five tables each:
\begin{array}{c}
%%%%% FIRST ROW
% five position tables:
\begin{array}{cccc}
% position table 1 (table and caption):
\begin{array}{c}
\begin{tabularx}{50pt}{|Y|Y|Y|Y|}
\hline
\tx & & & \\ \hline
\ty & \ty & \tx & \\ \hline
& & & \\ \hline
& & & \\ \hline
\end{tabularx} \\
\textrm{position 1}
\end{array}
% position table 2 (table and caption):
\begin{array}{c}
\begin{tabularx}{50pt}{|Y|Y|Y|Y|}
\hline
\tx & & & \\ \hline
& & \tx & \\ \hline
\ty & \ty & \ty & \ty \\ \hline
& & & \\ \hline
\end{tabularx} \\
\textrm{position 2}
\end{array}
% position table 3 (table and caption):
\begin{array}{c}
\begin{tabularx}{50pt}{|Y|Y|Y|Y|}
\hline
\tx & & & \\ \hline
& & & \tx \\ \hline
& & & \\ \hline
& & & \\ \hline
\end{tabularx} \\
\textrm{position 3}
\end{array}
% position table 4 (table and caption):
\begin{array}{c}
\begin{tabularx}{50pt}{|Y|Y|Y|Y|}
\hline
\tx & & & \\ \hline
& & & \tx \\ \hline
\ty & \tx & & \\ \hline
& & & \\ \hline
\end{tabularx} \\
\textrm{position 4}
\end{array}
% position table 4 (table and caption):
\begin{array}{c}
\begin{tabularx}{50pt}{|Y|Y|Y|Y|}
\hline
\tx & & & \\ \hline
& & & \tx \\ \hline
& \tx & & \\ \hline
\ty & \ty & \ty & \ty \\ \hline
\end{tabularx} \\
\textrm{position 5}
\end{array}
\end{array}
\\
\\
%%%%% SECOND ROW
% ...