.cfg 파일이 아닌 .cls 파일에서 .css 생성

.cfg 파일이 아닌 .cls 파일에서 .css 생성

구성 파일(예: \Css {})이 아닌 사용자 정의된 .cls 파일을 기반으로 .css 파일을 생성하는 것이 가능합니까? 예를 들어 환경 인용문은 내 클래스 파일에 다음과 같이 정의되었습니다.

\newenvironment{quote}%
               {\list{}{\topsep9\p@\leftmargin\z@\rightmargin\z@}%
                \small\fontseries{b}\selectfont%
                \item\relax\}%
               {\endlist}%

htlatex test "xhtml,fn-in" "-cunihft" "-cvalidate -p"HTML 변환 명령을 사용하고 있는데 변환된 HTML 출력은 다음과 같습니다.

                    <p class="indent" >
                    <span 
class="ptmr8t-x-x-90">Collusion  is  when  firms  use  history-dependent  strategies  to  sustain</span></p>

CSS 출력은 다음과 같습니다.

.quote {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; margin-right:1em; text-align:justify;}

이는 CSS 출력이 실제로 클래스(.cls) 파일에서 생성되지 않고 대신 구성 파일(tex4ht에 사용되는 .cfg)에서 생성됨을 의미합니다.

이제 CSS에서 예상되는 출력("인용문")은 다음과 같습니다.

.quote {font-size:80%; font-weight: bold;}

어떻게 이를 달성할 수 있나요? 제안해주세요...

답변1

.4ht수업용 파일을 만들 수 있습니다 . 수업이 있다면 다음과 같이 말해보세요 myclass.cls.

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{myclass}[2017/07/11 Example LaTeX class]
\LoadClass[]{article}
\renewenvironment{quote}%
               {\list{}{\topsep9\p@\leftmargin\z@\rightmargin\z@}%
                \small\fontseries{b}\selectfont%
                \item\relax}%
               {\endlist}% 

\endinput

구성 .4ht파일은 다음과 같습니다 myclass.4ht.

\ConfigureEnv{quote}{\NoFonts}{\EndNoFonts}{}{}
\Css{.quote{font-size:80\%; font-weight: bold;}}

\endinput

환경 구성은 quote이러한 요소를 제거하기 위해 환경 내부의 글꼴 경험적 방법만 비활성화합니다 <span class="ptmr8t-x-x-90">. quotein 의 기본 구성은 환경에 자동으로 tex4ht추가되므로 <div class="quote">수동으로 수행할 필요가 없습니다. 명령 에서 를 사용하여 문자를 \Css이스케이프해야 합니다 .%\%

다음 샘플 파일:

\documentclass{myclass}

\begin{document}
\section{Do common commands work?}

Yes, \textbf{they} \textit{do}\footnote{even footnotes?}.
\begin{quote}
  Collusion  is  when  firms  use  history-dependent  strategies  to  sustain
\end{quote}
\end{document}

다음 결과가 생성됩니다.

여기에 이미지 설명을 입력하세요

<div class="quote">
<!--l. 8--><p class="noindent" >Collusion is when firms use history-dependent strategies to sustain</p></div>

답변2

제가 요청한 요구사항과 유사한 Andrew의 답변을 보았는데, 링크는 다음과 같습니다.tex4ht에서 CFG 파일의 \Configure 코딩을 단순화할 수 있습니까?노력해주신 모든 분들께 감사드립니다...

관련 정보