Pandoc kann .tex-Dokument nicht verarbeiten, da Tikz ein Semikolon benötigt

Pandoc kann .tex-Dokument nicht verarbeiten, da Tikz ein Semikolon benötigt

texIch habe versucht, einen „Artikel“ (ich bin noch Student) von in eine Erweiterung umzuwandeln docx.

Pandoc gibt mir jedes Mal den folgenden Fehler aus, wenn ich versuche, die Datei zu konvertieren.

>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}

Dieses Problem tritt erneut auf, wenn ich versuche,tex4ht

---Danke im Voraus---

Antwort1

Ich kann Ihr Dokument mit TeX4ht in HTML konvertieren undalternativer Treiber für die Konvertierung von TikZ in SVG.

Das Dokument muss nur leicht bearbeitet werden, um den Treiber zu laden und einige mysteriöse Fehler zu beheben:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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}

Der hinzugefügte Code ist dieser:

\makeatletter
\ifdefined\HCode
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def}
\def\pgf@matrix@last@nextcell@options{}
\fi
\makeatother

Es ändert den TikZ-Treiber und definiert eine Steuersequenz, von der TikZ beschwert, dass sie nicht definiert sei.

Hier ist die erstellte HTML-Datei:

Bildbeschreibung hier eingeben

verwandte Informationen