
나는 "기사"(아직 학부생입니다)를 확장 프로그램으로 변환하려고 시도 tex
했습니다 docx
.
Pandoc은 파일을 변환하려고 할 때마다 다음 오류를 표시합니다.
>pandoc meta.tex -o meta.docx
Error at "source" (line 40, column 1):
unexpected }
expecting \end{document}
};
^
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The original template (the Legrand Orange Book Template) can be found here --> http://www.latextemplates.com/template/the-legrand-orange-book
% Original author of the Legrand Orange Book Template:
% Mathias Legrand ([email protected]) with modifications by:
% Vel ([email protected])
% TEMPLATE EDITOR: Miguel Avila
% Original License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[11pt,fleqn]{book} % Default font size and left-justified equations
\usepackage[top=3cm,bottom=3cm,left=2.8cm,right=2.8cm,headsep=10pt,letterpaper]{geometry} % Page margins
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{format-color}{HTML}{0b6969}
\definecolor{white}{HTML}{FFFFFF}
%----------------------------------------------------------------------------------------
% STRUCTURE
%----------------------------------------------------------------------------------------
\input{structure} % Insert the commands.tex file which contains the majority of the structure behind the template
\begin{document}
\begingroup
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node (current page.north west) {
\begin{tikzpicture}[remember picture,overlay]
\fill[format-color](-2.8cm,3cm) rectangle (\paperwidth,-\paperheight);
\end{tikzpicture}
}; % ERROR LINE, because the nested picture
\matrix [column sep=5mm,row sep=10cm] at (current page.center) {
\node [fill=black,fill opacity=0.4,text opacity=1,inner sep=1cm] {
\fontsize{56}{56}\centering\sffamily\parbox[c][][t]{\paperwidth} {
\centering \textcolor{white}{\textbf{Portair}}\\ % Book title
\textcolor{white}{\huge \textbf{Man in the middle}}
}
};\\
\node [inner sep=0.5cm,fill=black,text opacity=1,fill opacity=0.4] {
\fontsize{28}{28}\centering\bfseries\sffamily\parbox[c][][t]{\paperwidth} {
\centering\textcolor{white}{\huge Miguel Avila}
}
}; % Author name
\\
};
\end{tikzpicture}
\endgroup
\end{document}
사용하려고 하면 이 문제가 반복됩니다.tex4ht
---미리 감사드립니다---
답변1
TeX4ht를 사용하여 귀하의 문서를 HTML로 변환할 수 있으며TikZ에서 SVG로 변환하기 위한 대체 드라이버.
드라이버를 로드하고 알 수 없는 오류를 수정하려면 문서를 약간만 편집하면 됩니다.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The original template (the Legrand Orange Book Template) can be found here --> http://www.latextemplates.com/template/the-legrand-orange-book
% Original author of the Legrand Orange Book Template:
% Mathias Legrand ([email protected]) with modifications by:
% Vel ([email protected])
% TEMPLATE EDITOR: Miguel Avila
% Original License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[11pt,fleqn]{book} % Default font size and left-justified equations
\usepackage[top=3cm,bottom=3cm,left=2.8cm,right=2.8cm,headsep=10pt,letterpaper]{geometry} % Page margins
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{format-color}{HTML}{0b6969}
\definecolor{white}{HTML}{FFFFFF}
\makeatletter
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\def\pgf@matrix@last@nextcell@options{}
\fi
\makeatother
%----------------------------------------------------------------------------------------
% STRUCTURE
%----------------------------------------------------------------------------------------
% \input{structure} % Insert the commands.tex file which contains the majority of the structure behind the template
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begingroup
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay,ampersand replacement=\&]
\node (current page.north west) {
\begin{tikzpicture}[remember picture,overlay]
\fill[format-color](-2.8cm,3cm) rectangle (\paperwidth,-\paperheight);
\end{tikzpicture}
}; % ERROR LINE, because the nested picture
\matrix [column sep=5mm,row sep=10cm] at (current page.center) {
\node [fill=black,fill opacity=0.4,text opacity=1,inner sep=1cm] {
\fontsize{56}{56}\centering\sffamily\parbox[c][][t]{\paperwidth} {
\centering \textcolor{white}{\textbf{Portair}}\\ % Book title
\textcolor{white}{\huge \textbf{Man in the middle}}
}
};\\
\node [inner sep=0.5cm,fill=black,text opacity=1,fill opacity=0.4] {
\fontsize{28}{28}\centering\bfseries\sffamily\parbox[c][][t]{\paperwidth} {
\centering\textcolor{white}{\huge Miguel Avila}
}
}; % Author name
\\
};
\end{tikzpicture}
\endgroup
\end{document}
추가된 코드는 다음과 같습니다.
\makeatletter
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\def\pgf@matrix@last@nextcell@options{}
\fi
\makeatother
TikZ 드라이버를 변경하고 TikZ가 정의되지 않은 제어 시퀀스를 정의합니다.
생성된 HTML 파일은 다음과 같습니다.