文本中的破折号后面会显示一条不需要的下划线\path
:
\path{{hyphenated-text}/directory}.
在 HTML 输出中显示为:
连字符-_text/目录
关于如何避免这种结果有什么想法吗?
平均能量损失
\DocumentClass{article}
\usepackage{url}
\usepackage{setspace}
\usepackage{hyphenat}
\begin{document}
\par Some text ... located in the \path{{blah-directory}/blah} directory.
\end{document}
参考chtml文件内容:
% This configuration makes sure that the produced HTML fits
% the subset of HTML-tags used by the QtTextbrowser.
%
% The supported subset for Qt-4.7 can be found here:
% http://qt-project.org/doc/qt-4.7/richtext-html-subset.html
%
% It also cleans up all unnecessary stylesheets an span-tags.
%
\Preamble{html, charset=utf-8}
% remove the entire default navigation bar
\Configure{crosslinks}
{}{}{}
{}
{}{}{}{}
\Configure{crosslinks+}
{}{}{}
{}
{}{}{}{}
% set clean paragraph tags for \par
\Configure{HtmlPar}
{ \HCode{<p>} }{ \EndP \HCode{<p>} }
{ \HCode{</p>} }{ \HCode{</p>} }
% set appropriate headings for sections
\Configure{section}
{}{}
{\HCode{<h2 id="">}\TitleMark\space}{\HCode{</h2>}\ShowPar \IgnoreIndent \par}
\Configure{subsection}
{}{}
{\HCode{<h3 id="">}\TitleMark\space}{\HCode{</h3>}\ShowPar \IgnoreIndent \par}
\Configure{subsubsection}
{}{}
{\HCode{<h4 id="">}\TitleMark\space}{\HCode{</h4>}\ShowPar \IgnoreIndent \par}
\Configure{paragraph}
{}{}
{\HCode{<h4 id="">}\TitleMark\space}{\HCode{</h4>}\ShowPar \IgnoreIndent \par}
% set clean inline tags and line breaks
\Configure{textit}{\ifvmode\ShowPar\fi\HCode{<i>}}{\HCode{</i>}}
\Configure{textbf}{\ifvmode\ShowPar\fi\HCode{<b>}}{\HCode{</b>}}
\Configure{texttt}{\ifvmode\ShowPar\fi\HCode{<tt>}}{\HCode{</tt>}}
\Configure{newline}{\ifvmode\ShowPar\fi\Tg<br />}
% remove surrounding div tags for figures and set the align attribute properly
\ConfigureEnv{figure}
{\IgnorePar\EndP\HCode{<table class="figure" align="center"><tr><td>}\ShowPar}
{\IgnorePar\HCode{</td></tr></table>}\ShowPar}
{}{}
% remove surrounding rulers for figures
\Configure{float}
{\ifOption{refcaption}{}{\csname par\endcsname\ShowPar \leavevmode}}
{\HCode{}}
{\ifvmode \IgnorePar \fi\EndP \HCode{}\csname par\endcsname\ShowPar}
% center captions properly and use i-tag rather than stylesheets
\Configure{caption}
{\HCode{}\IgnorePar\EndP\HCode{<div class="caption" align="center"><i>}}
{: } {\HCode{}}
{\IgnorePar\EndP\HCode{</i></div>}}
% set appropriate table settings
\Configure{halignTB<>}{tabular}
{\HCode{id="TBL-\TableNo" class="tabular" cellspacing="0" cellpadding="5" align="center" border="1"}<>\HAlign}
\Configure{halignTB<>}{longtable}
{\HCode{id="TBL-\TableNo" class="longtable" cellspacing="0" cellpadding="5" align="center"
border="1"}<>\HAlign}
% remove unnecessary style sheet from tr-tags
\Configure{halignTR} {}
\Configure{halignTD} {}{}
{<}{\HCode{ align="left" }}
{-}{\HCode{ align="center" }}
{>}{\HCode{ align="right" }}
{l}{\HCode{ align="left" }}
{c}{\HCode{ align="center" }}
{r}{\HCode{ align="right" }}
{p}{\HCode{ align="left" }}
{}
% clean up tabular environment; removes unnecessary div-tags
\ConfigureEnv{table}
{\ifvmode \IgnorePar\fi \EndP \HCode{<div class="table">}}
{\ifvmode \IgnorePar\fi \EndP \HCode{</div>}\par\ShowPar}
{}{}
\ConfigureEnv{tabular}
{}{}{}{}
\Configure{tabular}
{\IgnorePar\EndP \halignTB{tabular}}
{\HCode{</table>}}
{\HCode{\Hnewline<tr }\halignTR\HCode{>\Hnewline}}
{\HCode{</tr>}}
{\HCode{<td }\halignTD\HCode{>}\ShowPar}
{\IgnorePar\HCode{</td>}\ShowPar}
\ConfigureEnv{longtable}
{}{}{}{}
\Configure{longtable}
{\IgnorePar\EndP \halignTB{longtable}}
{\HCode{</table>}}
{\HCode{\Hnewline<tr }\halignTR\HCode{>\Hnewline}}
{\HCode{</tr>}}
{\HCode{<td }\halignTD\HCode{>}\ShowPar}
{\IgnorePar\HCode{</td>}\ShowPar}
% ignore \hline
\Configure{hline}{}
\Configure{multicolumn}
{}{}{}{}
% This part is taken from the original html4.4ht of tex4ht.
% Only a <b> tag is added here to get the correct font-weight working
\ConfigureEnv{lstlisting}
{\ifvmode \IgnorePar\fi \EndP
\gHAdvance\listingN by 1
\HCode{<!--l. \the\inputlineno-->}%
\gdef\start:LstLn{%
\HCode{<div class="lstlisting" id="listing-\listingN" style="font-family: 'Courier New', Courier, monospace;"><b>}%
\gdef\start:LstLn{\leavevmode\special{t4ht@+\string&{35}x00A0{59}}x%
\HCode{<br />}}}
\bgroup
\Configure{listings}
{{\everypar{}\leavevmode}}
{{\everypar{}\leavevmode}}
{\start:LstLn \HCode{<span class="label">}}
{\HCode{</span>}}%
}
{\egroup
\ifvmode \IgnorePar\fi \EndP \HCode{</b></div>}\par}
{} {}
\begin{document}
\CssFile
/* mycss.sty */
body {
font-family: "Times New Roman";
font-size: 11pt;
}
h1, h2, h3, h4 {
font-family: Arial;
}
h1 {
font-size: 48pt;
}
h2 {
font-size: 18pt;
}
h3 {
font-size: 14pt;
}
h4 {
font-size: 13pt;
}
div.caption {
font-size: 9pt;
font-weight: normal;
}
a {
text-decoration: none;
}
span.texttt {
font-family: monospace;
}
\EndCssFile
\EndPreamble