latex转HTML

latex转HTML_第1张图片

作者:金良([email protected]) csdn博客:http://blog.csdn.net/u012176591


注意:工作目录文件夹及文件名都要用英文,不要用中文,否则不能生成公式的图片。 

编译命令如下(注意编译后会在工程所在目录产生一个Images文件夹,要把待插入的图片放在里面):

latex转HTML_第2张图片


源码:

\documentclass{ctexart}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{color}%xcolor包生成网页后颜色设置失效,所以用了color包
\usepackage[CJKbookmarks=true,colorlinks,linkcolor=blue,anchorcolor=blue,citecolor=green]{hyperref}
\title{LaTeX转HTML}
\date{\today}
\author{Jins0.618}
\begin{document}
\maketitle
\section{绘制表格}
  \begin{table}[h]
  \caption{{\bf 英文刊名常用词及国际省略法}}
    \begin{tabular}{p{3.5cm}ll}
      Letter    &快报\\
      Survey    &概览,综述\\
    \end{tabular}
  \end{table}
\section{书写公式}
{\LARGE\textcolor[rgb]{1,0,0}{接下来是公式}}:%使用的rgb颜色,每项0到1
\begin{equation}
\begin{split}
  g'(z)&= \frac{\mathrm d}{\mathrm d x} \frac{1}{1+\exp(-z)}\\
       &= g(z)(1-g(z))
\end{split}
\end{equation}
\section{插入图片}
\begin{figure}[!ht]
    \centering
    \includegraphics[width=0.5\textwidth,height=1in]{bupt.jpg}
    \caption{插图实例}
    \label{fig:myfigure}
\end{figure}
\section{超链接}
下面是超链接的网址
\url{http://blog.csdn.net/u012176591}
\end{document}


效果如下:

latex转HTML_第3张图片

微笑问题:

当引入包{tabu}后,会出错。查原因,有人说是支持性不好。


微笑问题:

--- error --- Can't find/open file `Jins0618.dvi'

有人给出这样的解释:

In some platforms, the operating systems pass on the quotes of the parameters of htlatex, httex, and httexi to the utilities tex4ht and t4ht. In such cases, the utilities issue complaints of the above nature for file names ‘xxx’ other than those being compiled. The problem can be resolved by installing a filter named ‘htcmd’, and submitting the tex4ht and t4ht commands to the filter. Backslash characters ‘\’ might need replacements with double backslash characters ‘\\’ or forward slash characters ‘/’.

For instance, if htlatex.bat contains a command line of the form ‘C:\tex4ht\t4ht %1 %4’, then after introducing the filter the modified command line will take the form ‘C:\\tex4ht\\htcmd C:\\tex4ht\\t4ht %1 %4’.

微笑问题:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.65 \\ ?
         涠杂Φ牧诮泳卣?\bm{A}$如下:\\
查看出错位置,发现错误原因是一个换行符,清除掉即可。
latex转HTML_第4张图片

微笑问题:

[3]
! TeX capacity exceeded, sorry [input stack size=5000].
\bm@command ->
              \mathchar 30032 \let \prOteCt \relax \let \prOteCt \relax \let...
l.91   \item 如果极限存在,它是否与$\bm{P_0}
                                            $的选取无关?


究其原因,可能是因为\bm{}命令里不能出现下标,把下标放到外面即可。修改如下:


微笑发现对某些汉字不能编译,本人在实践中遇到的字是“测”字,得了该字所在处编译停止,提示好多错误,之前的公式也不能转换成图片。把这个字改成其他字或拼音即可。

微笑对某些符号,比如朴素贝爷斯的字母表示,那个特殊的字符会提示出错。

微笑编译得到的HTML源码如果不能完全拷贝到博客编辑器,这很可能是因为HTML源码中有特殊字符,我这里遇到的是“NUL”,它的位置就是复制时遇到的断点位置。



  • tex2page 王垠
    http://docs.huihoo.com/homepage/shredderyin/tex2page/intro-Z-H-2.html 
    http://zzg34b.w3.c361.com/tutorial/tool.htm 


你可能感兴趣的:(html,latex)