Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When a LaTeX document containing 2 footnotes — footnote #1 is plain ASCII, but footnote #2 has diacritics or other extended characters — is converted to odt (OpenDocument Format), the number in footnote #1 is smaller than the number in footnote #2.

  • Do you get the same output?
  • How can I make the numbers be of the same size?

For example:

\documentclass{article}
\begin{document}
First sentence.\footnote{First footnote.}
Second sentence.\footnote{S{\' e}cond footnote.}
\end{document}

This is the output from pdftex:

Imgur

And this is the output from $ mk4ht oolatex

output

TeX Live (2012), mk4ht (v1.1), OpenOffice.org (3.4.1)

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

It seems like openoffice bug to me. If you unzip the odt file and open content.xml file, you can see:

...
<text:note text:note-class="footnote" text:id="fn1x0"><text:note-citation>1</text:note-citation><text:note-body> <text:p text:style-name="Footnote"><text:span text:style-name="ecrm-0800">First footnote.</text:span></text:p></text:note-body></text:note>
....
<text:note text:note-class="footnote" text:id="fn2x0"><text:note-citation>2</text:note-citation><text:note-body> <text:p text:style-name="Footnote"><text:span text:style-name="ecrm-0800">S</text:span><text:span text:style-name="ecrm-0800">&#xE9;</text:span><text:span text:style-name="ecrm-0800">cond footnote.</text:span></text:p></text:note-body></text:note>
...

Only difference between the two footnotes is that there are some extra <text:span ...> elements in the second footnote. This is caused by how tex4ht handles accented letters. It seems that openoffice chooses footnote mark size according do biggest element in footnote text, but in this case all elements are the same size, so there should be no reason why the footnote mark is bigger.

To get rid of these <text:span> elements, we must redefine footnote handling in oolatex. Create dummy package myfootnote.sty and use this package in your preamble. This file can be empty, it's purpose is only to call file myfootnote.4ht when running with tex4ht. Now contents of myfootnote.4ht:

\:CheckOption{ooffice}\if:Option
\Configure{automatic-styles}
   {\csname a:footnote-style\endcsname}
\NewConfigure{footnote-style}{1}
\Configure{footnote-style}{%
<style:style style:name="Footnote-text" style:family="text">
<style:text-properties fo:font-size="10.0pt" />
</style:style>
}
\AtBeginDocument{%
\Configure{footnotetext}
   {\Tag{fn\FNnum x\minipageNum
-tx}{}%
    \ifTag{fn\FNnum x\minipageNum
}
   {\expandafter\ifx\csname (fn\FNnum x\minipageNum
)\endcsname\def
       \:warning{Multiple footnote texts for mark \FNnum}%
    \fi
   } {}%
%
    \SaveEndP \NoFonts  \let\@textsuperscript\hbox
    \HCode{<\text:footnote\Hnewline\text:note:class
             text:id="}fn\FNnum x\minipageNum
%
               \HCode{"><\text:footnote-citation>}%
    \IgnorePar \special{t4ht@(}%
   }
   {\EndNoFonts \RecallEndP
    \HCode{</\text:footnote-citation><\text:footnote-body>
    <text:p\Hnewline text:style-name="Footnote"><text:span text:style-name="Footnote-text">}\NoFonts%
    \SaveHtmlPar \Configure{HtmlPar}
   {\EndP \HCode{<text:p text:style-name="Footnote"><text:span text:style-name="Footnote-text">}}
   {\EndP \HCode{<text:p text:style-name="Footnote"><text:span text:style-name="Footnote-text">}}
   {\HCode{</text:span></text:p>}}
   {\HCode{</text:span></text:p>}}%
\ShowPar \special{t4ht@)}%
   }
   {\RecallHtmlPar \EndNoFonts\HCode{</text:span></text:p></\text:footnote-body></\text:footnote>}%
   \expandafter\global\expandafter
   \let\csname (fn\FNnum x\minipageNum
)\endcsname\def
%
   }
}
\fi

with \:CheckOption{ooffice} we ensure that this code is included only if document is running with oolatex, not with htlatex. Then we create openoffice style Footnote-text, which is included with \Configure{automatic-styles} into main document. Then there is \Configure{footnotetext}. We must include it in \AtBeginDocument, otherwise it is replaced with default values. Contents are copied from the file ooffice.4ht, we only added some tags and \NoFonts and \EndNoFonts macros, which suppresses creation of <text:span> elements for characters with diacritics.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.