I'm using MiKTeX 2.9 and installed the miktex-tex4ht-base2.9 in order to convert my LaTeX files into HTML. I just updated everything before starting so I should have the latest packages for everything. I am also using Windows 7.
My LaTeX file contains other LaTeX files via the \include
command. It is a book with chapters that are stored in a separate folder with their own tex files.
For example, I have Main.tex with Chapter1.tex, Chapter2.tex... and so forth which are included in the whole document using \include
.
Is it possible to call htlatex Main.tex
and it will compile all the required files or is there some step by step procedure to do each file? When I tried it, I got 100s of errors (pdflatex compiles without any errors and I have an output pdf file, htlatex even worked on a simple single file so I know htlatex is working properly). I would have pasted the errors but there are just so many and most of them relate to missing curly brackets for a section or missing an end{document}
which is why I am thinking it has something to do with the \include
command.
I have pasted below some errors,
?
! Extra }, or forgotten \endgroup.
l.22 ...lax }}\par \let \reserved@d =*\def \par }}
{section.1}{}}
?
! Extra }, or forgotten \endgroup.
l.22 ...t \reserved@d =*\def \par }}{section.1}{}}
Below is the first error I recieve after running htlatex Main.tex
! Undefined control sequence.
<argument> )Qfigure.\theHfigure
l.40 \:CrossWord{)Qfigure.\theHfigure }{1}{5}
%
This is the main.tex file,
\documentclass[11pt,a4paper,oneside]{article}
\usepackage{hyperref}
\usepackage[all]{hypcap} %for going to the top of an image when a figure reference is clicked
\usepackage{draftwatermark}
\usepackage{url}
\usepackage{fullpage}
\SetWatermarkText{INTERNAL}
\SetWatermarkFontSize{5cm}
\SetWatermarkScale{4.5}
\SetWatermarkLightness{0.9}
%For toggling between print pdf and electronic pdf
%change the reference style.
\newif\ifelectronic
%\electronicfalse
\electronictrue
\ifelectronic
\newcommand{\xyzref}[1]{\nameref{#1}}
\else
\newcommand{\xyzref}[1]{\ref{#1}}
\fi
%For switching between stand alone APPlication and plugin
\newif\ifapp
%\apptrue
\appfalse
%to NOT print the subsection numbers in the table of contents
\newcounter{sectocnonumdepth}
\setcounter{sectocnonumdepth}{2}
\renewcommand{\familydefault}{\sfdefault}
\hypersetup{colorlinks=true}
\usepackage{listings}
\begin{document}
\ifapp
\title{\textbf{XYZ Quick Start} \\ (For stand-alone application users)}
\else
\title{\textbf{XYZ Plug-in Quick Start} \\ (For Plug-in users)}
\fi
\author{Company XYZ}
\maketitle
\tableofcontents
\input{Chapters/Chap1}
\input{Chapters/Chap2}
\input{Chapters/Chap3}
\input{Chapters/Chap4}
\end{document}
Below is a sample chapter,
\section{Creating a New Project}
\label{sec:newProject}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{enumerate}
\item Go to `File' menu.
\item Select `New'.
\ifapp %if its the standalone
\item And click the XYZ Project option. Note: If you do not see this option then check whether you are in the XYZ perspective via Window$\rightarrow$Open Perspective.
\else %if its plugin
\item Select `Project...'.
\item A New Project dialog will open which will ask you to select a project wizard\index{Wizard}. Choose the XYZ project under the XYZ category (see figure \ref{fig:XYZWizard}) and then click `Next'.
\begin{figure}[hp]
\centering
\includegraphics[width=0.50\textwidth]{Images/XYZWizard.PNG}
\caption{Eclipse New Project Dialog}
\label{fig:XYZWizard}
\end{figure}
\fi
\item Give the project a name. You can either choose the default workspace location, or browse for another location. The Mod-Dat-Run style folder structure just creates the three respective folders in your project, if you check it (figure \ref{fig:XYZWizard2}); You can always create the folders later. These folders are independent of the files you put in them.
\begin{figure}[hp]
\centering
\includegraphics[width=0.50\textwidth]{Images/XYZWizard2.PNG}
\caption{XYZ New Project Wizard Dialog}
\label{fig:XYZWizard2}
\end{figure}
\ifapp
\else
\item After clicking `Finish', Eclipse will ask you if you want to change to the XYZ perspective, click yes.
\fi
\item The project has been created and you will be able to see it in the Project Explorer.
\end{enumerate}
mainbook.tex
contains\include{chap1/chaptertext} \include{chap2/chaptertext}
, using tex4ht from MikTeX 2.9, and I'm looking at the generated HTML page now.