[tex4ht] font choice in OpenOffice
Thierry Masson
rhomunulist at gmail.com
Sat Oct 21 09:22:12 CEST 2017
Hello Michal,
You are right about the default settings in OpenOffice (I use LibreOffice, but it doesn't matter here).
I have managed to change the default font using a personal "ooffice.4ht" file (I have copied the original one in my working folder) and I have added elements like
<style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-adornments="Normal" style:font-family-generic="roman" style:font-pitch="variable"/>\Hnewline
and
<style:text-properties
style:font-name="Times New Roman"
fo:font-family="'Times New Roman'"
style:font-style-name="Normal"
style:font-family-generic="roman"
style:font-pitch="variable"/>
</style:style>
at places where I wanted Times New Roman (in style:name="Text-body" and style:name="p-bibitem" for the moment).
For titles (style:name="Heading"), I have installed Arial in the same way.
Then the document uses Times New Roman and Arial when I open it in OpenOffice.
Now that I understand the procedure, if I discover a place in the text which uses the default font (Liberation as you suspected), I can change this behaviour.
This solution looks like a hack: it should be useful to have a latex command inside the document to install these fonts.
May be it already exits (the documentation I found is quite succinct: a webpage with minimal information) or we will get one in a future version of tex4ht…
On the other hand, one needs also a documentation about the syntax of the style.xml file used by OpenOffice to style the document!
I have made changes to the document in OpenOffice, and then I have opened this style.xml file (transform .odt into .zip and then open the archive folder) to learn (to guess) the syntax I needed.
Hope this "solution" will help someone else.
Best regards
Thierry
> Le 20 oct. 2017 à 16:48, Michal Hoftich <michal.h21 at gmail.com> a écrit :
>
> Hello Thierry,
>
>
>> I am new to tex4ht and I have to convert a pdflatex document to OpenOffice.
>> Using the command "mk4ht oolatex myfile.tex" I get a correct odt file.
>> The problem is that whatever font I install in the latex file, the text in the OpenOffice file is composed in "Liberation Serif".
>> How can I change this default behaviour?
>> I have tried using lualatex, but this does not solve my problem.
>
> It seems that tex4ht only chooses default roman font provided by
> LibreOffice, and it is probably Liberation Serif on your machine. I
> guess that it should be possible to change default LibreOffice font, but
> I haven't tried that, personally.
>
> Best regards,
> Michal
More information about the tex4ht
mailing list