I am employee in mid-sized company that is currently experimenting with implementation of Latex
for writting technical documentation
(see Implementing Latex in our company).
Most of our documents need to be translated in various languages, which is done by translation agencies.
To perform this task, they normally use Trados Studio. However, this program does not support documents in
.tex format.
It does, however, support .html format. As I am using TexStudio (together with Tex Live), I am able to convert .tex documents
in .html format (using Tools -> Convert Source to Html). This creates a document that can show Html code when opened in
Notepad, but if you open it in web browser, a .tex code is shown.
However, the created document was not compatible with Trados Studio.
My question is:
-
How can I solve this problem? Is the problem in the fact that the created .HTML document is not "correctly" converted
(when checking the created Html document with Html validator, some errors pop up). -
If this approach of converting to .html documents is not the best approach for translating with Trados Studio, what alternative
approach do you suggest?
Note that our typical documents are roughly 100 pages long and there is large amount of them, so a solution
that is not time-intensive would be preffered.
Edit: I used make4ht -l filename.tex, while the minimized example (probably I missed something) is:
% !TeX program = lualatex
% !TeX encoding = UTF-8 Unicode
% !TeX spellcheck = de_DE
\documentclass[10pt,a4paper,twoside]{report}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,251.5mm}, %default je 150mm,237mm
outer=15mm,
inner=20mm,
top=25mm}
\usepackage{fontspec}
\setmainfont{Arial}
\usepackage{titlesec}
\usepackage[most]{tcolorbox}
\newtcolorbox{warning}[1][width=171.375mm, center]{%
enhanced jigsaw, %engine za risanje zahtevnejsih okvirjev
enlarge top initially by=3mm, %presledek pred okvirjem
enlarge bottom finally by=3mm, %presledek za okvirjem
borderline={3.5pt}{-5pt}{black}, %to je dodaten okvir
sharp corners, %kaksni so vogali
fonttitle=\bfseries, %NASLOV v krepkem
title=WARNUNG!, %ime naslova
coltitle=black, %font naslova crne barve
colbacktitle={white!80!gray}, %ozadje naslova sivo
halign title=center, %naslov centriran--------------------
fontupper=\bfseries, %besedilo warninga je v krepkem
halign=flush center, %upper (sredinski) part centriran, ALTERNATIVA: UKAZ CENTER
halign lower=right, %lower (spodnji) part poravnan desno
colframe=black, %barva okvirja
colback={white!80!gray}, %barva ozadja upper in lower part----
lower separated=false, %crta ki locuje
fontlower=\tiny, %font rms in številke
middle=0mm, %minimalen razmik med upper in lower part
bottom=0mm, %minimalen razmik med lower part in okvirjem
%breakable, %ce bi hoteli da se prelomijo cez strani.
#1
}
\newtcolorbox{caution}[1][]{%
enhanced jigsaw, %engine za risanje zahtevnejsih okvirjev
enlarge top initially by=1.5mm, %presledek pred okvirjem
enlarge bottom finally by=1.5mm, %presledek za okvirjem
% borderline={0pt}{0pt}{black}, %to je dodaten okvir
sharp corners, %kaksni so vogali
fonttitle=\bfseries, %NASLOV v krepkem
title=ACHTUNG!, %ime naslova
coltitle=black, %font naslova crne barve
colbacktitle={white!80!gray}, %ozadje naslova sivo
halign title=center, %naslov centriran--------------------
fontupper=\bfseries, %besedilo warninga je v krepkem
halign=flush center, %upper (sredinski) part centriran
halign lower=right, %lower (spodnji) part poravnan desno
colframe=black, %barva okvirja
colback={white!80!gray}, %barva ozadja upper in lower part----
lower separated=false, %crta ki locuje
fontlower=\tiny, %font rms in številke
middle=0mm, %minimalen razmik med upper in lower part
bottom=0mm, %minimalen razmik med lower part in okvirjem
%fontupper={\setlength{\parindent}{20pt}},
#1
}
\newtcolorbox{note}[1][]{%
enhanced jigsaw, %engine za risanje zahtevnejsih okvirjev
enlarge top initially by=1.5mm, %presledek pred okvirjem
enlarge bottom finally by=1.5mm, %presledek za okvirjem
% borderline={0pt}{0pt}{black}, %to je dodaten okvir
sharp corners, %kaksni so vogali
% fonttitle=\bfseries, %NASLOV v krepkem
title=HINWEIS, %ime naslova
coltitle=black, %font naslova crne barve
colbacktitle=white, %ozadje naslova sivo
halign title=center, %naslov centriran--------------------
% fontupper=\bfseries, %besedilo warninga je v krepkem
halign=flush center, %upper (sredinski) part centriran
halign lower=right, %lower (spodnji) part poravnan desno
colframe=black, %barva okvirja
colback=white, %barva ozadja upper in lower part----
lower separated=false, %crta ki locuje
fontlower=\tiny, %font rms in ?tevilke
middle=0mm, %minimalen razmik med upper in lower part
bottom=0mm, %minimalen razmik med lower part in okvirjem
%fontupper={\setlength{\parindent}{20pt}},
#1
}
\usepackage[a-2b]{pdfx}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
\newcommand{\fullref}[1]{\hyperref[#1]{\ref*{#1}\ \nameref*{#1}}}
\renewcommand{\figureautorefname}{Abbildung}
\usepackage{lastpage}
\usepackage{fancyhdr}
\def\cnvjobname{\expandafter\cnvjobnameA\jobname\relax}
\def\cnvjobnameA#1{\ifx\relax#1\else
\ifx?#1: \else \expandafter\ifx\string_#1 \else #1\fi\fi
\expandafter\cnvjobnameA\fi
}
\newcommand*{\setmyjobname}{%
\edef\myjobname{\cnvjobname}%
\expandafter\expandafter\expandafter\setmyjobnameaux
\expandafter\myjobname\expandafter"\myjobname"\relax
}
\newcommand*{\setmyjobnameaux}{}
\def\setmyjobnameaux#1"#2"#3\relax{\def\myjobname{#2}}
\setmyjobname
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\includegraphics*[height=0.6cm]{example-image-b}}
\renewcommand{\figurename}{Abbildung}
\renewcommand{\tablename}{Tabelle}
\newcommand{\cell}{\parbox[t]{20cm}\seqsplit}
\begin{document}
something
\end{document}
Best Answer
There are two issues with the MWE, if you have up-to-date TeX Live. First is the fatal error caused by the PDFX package, second is caused by Hyperref.
In general, packages that have effect only in the PDF mode should be avoided when you convert your document with TeX4ht, as it operates in the DVI mode. This can result in fatal errors just by loading of the package.
There are two ways to disable the package. The first is to edit your document and include packages conditionally. This can be done for example using the following command:
The second way is to change TeX4ht configuration files for packages. We have special files, that are loaded before a package, so package loading can be disabled. First, we have to declare such file in
usepackage.4ht
:The important line is this:
This declares the
pdfx-hooks.4h
file:The
\:dontusepackage
prevents package loading, preventing PDFX from the fatal error.Then there is a Hyperref error, caused by the following line:
The problem is that
\figureautorefname
is defined at the end ofhyperref.sty
, but Hyperref detects TeX4ht, and stops its loading earlier, so this command is undefined. We can fix it by copying of the autoref captions fromhyperref.sty
tohyperref-hooks.4ht
:With these changes, your document should compile without errors. You can update your TeX Live distribution, as these changes are already updated here.