I need to export my .tex
file to .doc. I tried to do it using
mk4ht ooxelatex file.tex
but got complete garbage as output. The file itself is quite simple - some text and a pair of images.
Is there a way to do it?
EDIT:
I need to export my .tex
file to .doc. I tried to do it using
mk4ht ooxelatex file.tex
but got complete garbage as output. The file itself is quite simple - some text and a pair of images.
Is there a way to do it?
EDIT:
The reason why compilation of your document fails is probably that tex4ht
has some problems with xetex
and fontspec
, it is best to use pdftex
or luatex
as engines for use with tex4ht
.
Best option for xelatex
documents is to have some switch in the preamble, so you don't load problematic packages when you compile the document with tex4ht
Your sample document corrected:
\documentclass[a4paper, 12pt]{article}
% NOTES
% Organization?
% Citations in text?
\makeatletter
\newcommand\compparbox[2]{%
\parbox{\dimexpr #1\relax}{#2}
}
\@ifpackageloaded{tex4ht}{
\usepackage[russian]{babel} % for russian hypenation
\usepackage[utf8]{inputenc}
}{
% TEMPORARY - remove in final version!
\setlength{\emergencystretch}{10em}
\usepackage{xltxtra}
\setmainfont[Mapping=tex-text]{Linux Libertine O}
\usepackage[russian]{babel} % for russian hypenation
\usepackage[top=20mm, bottom=20mm, left=25mm, right=25mm]{geometry}
\pagestyle{empty} % remove page numbering
}
\usepackage{setspace}
\usepackage{enumitem}
\setlist{nolistsep} % denser list
\usepackage[colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
\begin{document}
\singlespacing
\begin{center}
\large
Заголовок
\vspace{1em}
\normalsize
Автор \href{mailto:[email protected]}{\nolinkurl{<[email protected]>}} (Россия, Москва)
\end{center}
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
Много текста
\vspace{2em}
\noindent
\compparbox{\textwidth/2 - 0.8em}{
\phantomsection
\label{comp1}
%\includegraphics[width=\textwidth/2 - 0.8em]{comp1-mne.png}
Рис.1. Картирование ``сенсорного''\\ компонента.
}
\hspace{1em}
\compparbox{\textwidth/2 - 0.8em}{
\phantomsection
\label{comp4}
% \includegraphics[width=\textwidth/2 - 0.8em]{comp4-mne.png}
Рис.2. Картирование ``моторного'' \\ компонента.
}
\vspace{2em}
\subsection*{Список литературы}
\begin{enumerate}
\item \phantomsection \label{ikeda1992}
Ikeda A., L\"{u}ders H., Burgess R., Shibasaki H. 1992. Movement-related potentials recorded
from supplementary motor area and primary motor area. Brain. V. 115. pp 1017-1043.
\end{enumerate}
\end{document}
with \@ifpackageloaded{tex4ht}
you can decide which package to load or not to load, when tex4ht
is running. As first parameter include packages for use with tex4ht
, as second packages for xelatex
.
Compile with
mk4ht oolatex sample.tex "xhtml, charset=utf-8"
Note: Your parboxes are incorrectly transformed with tex4ht
, I think you will need some custom configuration to get it working. But this needs some knowledge of odt
xml structure
\parbox
. What package should I import so the converter would recognize it?
\renewcommand{\parbox}[2]{ #2 }
still achieves the same effect - first argument is still printed for some reason.