
이 MWE를 고려하면
\documentclass[11pt]{book}
\usepackage{xcolor}
\usepackage{pifont} %http : // ctan.org/pkg/pifont
\newcommand{\cmark}{\textcolor{green!80!black}{\ding{51}}}
\newcommand{\xmark}{\textcolor{red}{\ding{55}}}
\begin{document}
\cmark \underline{A}
\cmark \underline{B}
\end{document}
lualatex로 컴파일하면 예상되는 출력이 제공됩니다.
하지만 사용 make4ht -ulm default -a debug report.tex "mathjax,htm"
하면
이 경고를 제공합니다
l.10 --- TeX4ht warning --- missing \Configure{HColor}{green!80!black}{...} (in
LaTeX: \\color@green!80!black ) ---
Unsupported font pzdr
그러나 항상 첫 번째 항목이 실패하지만 \cmark
그 이후의 모든 사용은 정상적으로 작동합니다.
다음은 원시 HTML입니다.
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US'>
<head><title></title>
<meta charset='utf-8' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='width=device-width,initial-scale=1' name='viewport' />
<link href='report.css' rel='stylesheet' type='text/css' />
<meta content='report.tex' name='src' />
<script>window.MathJax = { tex: { tags: "ams", }, }; </script>
<script async='async' id='MathJax-script' src='https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js' type='text/javascript'></script>
</head><body>
<!-- l. 10 --><p class='noindent'><span id='textcolor1'>80!black!//<span class='pzdr-x-x-109'>✓</span></span><span class='underline'>A</span>
</p><!-- l. 12 --><p class='indent'> <span id='textcolor2'><span class='pzdr-x-x-109'>✓</span></span><span class='underline'>B</span>
</p>
</body>
</html>
이는 Brave 브라우저와 Firefox에서 확인되었습니다.
왜 이런 일이 첫 번째에만 발생하며, 해결 방법은 무엇입니까? 이 문제를 해결하는 데 어떻게 사용합니까 \Configure{HColor}
?
업데이트
\newcommand{\cmark}{\textcolor{green!80!black}{\ding{51}}}
다음으로 변경하면 정상적으로 작동하는 것으로 나타났습니다 .\newcommand{\cmark}{\textcolor{green}{\ding{51}}}
그래서 tex4ht에서는 색상 혼합이 잘 지원되지 않는 것 같습니다. 별거 아닙니다. 나는 \textcolor{green}
tex4ht에서 사용하고 \textcolor{green!80!black}
지금은 PDF에서 사용하겠습니다.
TL 2021
답변1
green!80!black
이는 TeX4ht 형식의 색상 사양 지원에 오류가 있는 것 같습니다 . 색상 사양이 문서에 나오는 위치를 찾아서 수정했습니다. 이 버전을 사용해 보세요 xcolor.4ht
:
% xcolor.4ht (2019-04-09-10:06), generated from tex4ht-4ht.tex
% Copyright 2007-2009 Eitan M. Gurari
% Copyright 2009-2019 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any
% later version. The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version 2019-04-09-10:06}
\input color.4ht
\def\rowc@l@rs[#1]#2#3#4%
{\global\rownum=\z@
\global\@rowcolorstrue
\@ifxempty{#3}%
{\def\@oddrowcolor{\@norowcolor}}%
{\def\@oddrowcolor{\a:rowcolors{#3}%
\gdef\CT@row@color{\CT@color{#3}}}}%
\@ifxempty{#4}%
{\def\@evenrowcolor{\@norowcolor}}%
{\def\@evenrowcolor{\a:rowcolors{#4}%
\gdef\CT@row@color{\CT@color{#4}}}}%
\if@rowcmd
\def\@rowcolors
{#1\if@rowcolors
\o:noalign:{\relax\ifnum\rownum<#2\@norowcolor\else
\ifodd\rownum\@oddrowcolor\else\@evenrowcolor\fi\fi}%
\fi}%
\else
\def\@rowcolors
{\if@rowcolors
\ifnum\rownum<#2\o:noalign:{\@norowcolor}\else
#1\o:noalign:{\ifodd\rownum\@oddrowcolor\else\@evenrowcolor\fi}\fi
\fi}%
\fi
\CT@everycr{\@rowc@lors\the\everycr}%
\ignorespaces}
\NewConfigure{rowcolors}{1}
\def\@rowc@lors{\o:noalign:{\global\advance\rownum\@ne}\@rowcolors}
\def\showrowcolors{\o:noalign:{\global\@rowcolorstrue}\@rowcolors}
\def\hiderowcolors{\o:noalign:{\global\@rowcolorsfalse\@norowcolor}}
\def\:temp#1#2#3{{\set@color}}
\HLet\color@block\:temp
\def\:temp#1#2#3{}
\HLet\boxframe\:temp
\def\strip:fin:excl#1!{#1}
\expandafter\def\csname get!HColor\endcsname#1!#2//{%
\def\current:color:name{#1\if!#2!\else!\strip:fin:excl#2\fi}%
\if\relax#2\relax
%\expandafter\ifx \csname HColor!#1\endcsname\relax
\let\HColor=\relax
\expandafter\ifx \csname\string\color @#1\endcsname \relax\else
\expandafter\ifx \csname colortyp:\endcsname\relax \else
\extractcolorspec{#1\if!#2!\else!\strip:fin:excl#2\fi}\tmp:color%
\expandafter\convertcolorspec\tmp:color{HTML}\tmp:color%
\def\HColor{\#\tmp:color}%
\Configure{HColor}{\current:color:name}{\HColor}%
\csname colortyp:\expandafter\expandafter\expandafter\endcsname
\csname\string\color @#1\expandafter\endcsname
\space .!//%
\fi \fi
%
\else
\ifcsname HColor!#1\endcsname
\csname HColor!#1\endcsname #2//%
\fi
\fi
}
\expandafter\def\csname c:HColor!gray:\endcsname{%
\expandafter\def\csname HColor!gray\endcsname##1!##2//}
\Configure{HColor!gray}{\Configure{HColor}{}{}}
\expandafter\def\csname c:HColor!rgb:\endcsname{%
\expandafter\def\csname HColor!rgb\endcsname##1,##2,##3!##4//}
\Configure{HColor!rgb}{\Configure{HColor}{}{}}
\expandafter\def\csname c:HColor!cmyk:\endcsname{%
\expandafter\def\csname HColor!cmyk\endcsname##1,##2,##3,##4!##5//}
\Configure{HColor!cmyk}{\Configure{HColor}{}{}}
\def\get:xcolorcss#1#2{%
\expandafter\extractcolorspec\expandafter{#1}{\tsf:color}%
\expandafter\convertcolorspec\tsf:color{HTML}\tsf:color%
\edef#2{\#\tsf:color}%
}
\Hinput{xcolor}
\endinput
매크로에 수정이 필요했는데 \get!HColor
, 존재 여부를 확인하지 않고 색상 이름이 포함된 제어 시퀀스를 호출했습니다. 이러한 유형의 사양에는 존재하지 않으므로 해당 제어 시퀀스에 대한 매개변수는 먹히는 대신 문서에 남게 됩니다.
결과는 다음과 같습니다.