如何防止 tex4ht 或 pdftohtml html 文档破坏对齐?

如何防止 tex4ht 或 pdftohtml html 文档破坏对齐?

文本向左倾斜,连字符断开。此外,lettrine 包原本完美缩进的类型因此错位。规则和图形本身就是一幅图像。

例如:


\documentclass[twocolumn]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{graphicx}
\usepackage{blindtext}
\usepackage{fancyhdr}
\setlength{\columnsep}{0.7cm}

\usepackage{lettrine}
\renewcommand{\footrulewidth}{0.4pt}
\title{bla bla}
\date{}
\begin{document}
\maketitle
\fontfamily{ptm}\selectfont

\begin{figure}
\includegraphics[width=0.45\textwidth]{/Path/to/file}
\end{figure}

\cfoot{}
\thispagestyle{fancy}\blindtext

\lettrine[lines=2,slope=2pt,findent=2pt,nindent=3pt,loversize=0.1]{B}{}\blindtext

\begin{tabular}{ l l l }
\multicolumn{3}{c}{Bla bla bla)} \
\hline
\multicolumn{1}{c}{blo}
& \multicolumn{1}{c}{blu}
\
\cline{1-3}
Test & 18.5 \% \
Test & 17.4 \% \
Test & 17.5 \% \
Test & 13.6 \% \
\hline
\end{tabular}

\end{document}


然后在终端中运行: tex4ht [filename.tex]或者pdftohtml -c [filename.pdf]将其转换为 html。

因此,图形、规则和线条最终会成为其自己的图像文件。(*.png)

字母类型未对齐。并且文档的文本(在本例中已使用该twocolumn选项先前指定)不再对齐。

在此处输入图片描述 在此处输入图片描述

答案1

默认情况下,HTML 页面不会对齐。不过,在现代浏览器上可以使用 TeX 连字算法的 JavaScript 实现,而且效果确实很好。

您需要下载文件并配置 tex4ht 以添加脚本元素来引用脚本并添加class="hyphenate"您想要打开连字符的位置。

基本上只需按照此处的简单说明即可:

http://code.google.com/p/hyphenator/wiki/en_HowToUseHyphenator

相关内容