梅威瑟:
\documentclass{article}
\usepackage{cprotect}
\begin{document}
\cprotect\section{\verb|invlaplace(exp((a*s)^(1/2)), s, t)|}
test
\end{document}
pdflatex 输出:
但htlatex foo.tex
生成了以下 HTML 输出:
HTML 内容如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">
<!-- html -->
<meta name="src" content="foo.tex">
<meta name="date" content="2013-11-16 02:34:00">
<link rel="stylesheet" type="text/css" href="foo.css">
</head><body
>
<h3 class="sectionHead"><span class="titlemark">1 </span> <a
id="x1-10001"></a><span class="obeylines-h"><span class="verb"><span
class="cmtt-10">invlaplace(exp((a*s)^(1/2)),</span><span
class="cmtt-10"> s,</span><span
class="cmtt-10"> t)</span></span></span>ˆˆEˆˆL </h3>
<!--l. 6--><p class="noindent" >test
</body></html>
如何去除额外 ^^E^^L
添加的噪音?使用This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
答案1
你真的需要使用该cprotect
包吗?一个简单的解决方法是,你可以使用
\documentclass{article}
\usepackage[]{fancyvrb}
\begin{document}
\section{\protect\Verb|invlaplace(exp((a*s)^(1/2)), s, t)|}
test
\end{document}