2

When I use the \today macro, I cannot get, in my .html, the display in various languages when I compile the following file from michal-h21 @michal.h21 and sty file of alternative4ht: all my dates are in english!

I compile with make4ht -ul filename . My pdf is fine with lualatex....

\documentclass{article}

\usepackage{alternative4ht}
\altusepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\newfontfamily\greekfont{Linux Libertine O}
\newfontfamily\russianfont{Linux Libertine O}
\newfontfamily\hindifont{Siddhanta}
\altusepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{czech}
\setotherlanguage{greek}
\setotherlanguage{russian}
\setotherlanguage{hindi}

\begin{document}
\par\today\par\hrule\par
\begin{czech}
\par\today\par\hrule\par
Praha je hlavní a současně největší město České republiky a 15. největší město Evropské unie. Leží mírně na sever od středu Čech na řece Vltavě, uvnitř Středočeského kraje, jehož je správním centrem, ale jako samostatný kraj není jeho součástí. Je sídlem velké
\end{czech}

\textgreek{
\par\today\par\hrule\par
Πράγα (τσέχικα: Praha), είναι η πρωτεύουσα και μεγαλύτερη πόλη της Τσεχίας. Χτισμένη στον ποταμό Μολδάβα (Vlt}

\begin{russian}
\par\today\par\hrule\par
га (чеш. Praha [ˈpraɦa]) — город и столица Чехии; административный центр Среднечешского края и двух его районов —
\end{russian}

\begin{hindi}
\par\today\par\hrule\par
 प्राग युरोप के चेकोस्लोवाकिया देश की राजधानी है। 
\end{hindi}
\par\today\par\hrule\par





\end{document}
1

I've just added basic support for language definition files loading, please update helpers4ht. This is the current result:

enter image description here

  • I tried you solution, but if you set \setmainlanguage{french}, I get (/texlive/texmf-dist/tex/latex/polyglossia/gloss-french.ldf ! LuaTeX error [\directlua]:1: attempt to index global 'polyglossia' (a nil value) stack traceback: [\directlua]:1: in main chunk. l.14 \directlua{polyglossia.load_frpt()}.I put enter to carry and it compiles well with the french date in the html. I do not have errors when I set \setmainlanguage{czech} or even \setmainlanguage{german}.... – Koala Dec 31 '15 at 8:43
  • On a side note, for greek, and only for greek, I get the error, even before updating the package, Runaway argument? { ! Paragraph ended before \printlang was complete. <to be read again> \par l.25 ...· στον ποταμό Μολδάβα (Vlt} ? ! Too many }'s. \textgreek ...guage {greek}\printlang {#1}\egroup l.25 ...· στον ποταμό Μολδάβα (Vlt} when I compile. DO you know where this comes from ? – Koala Dec 31 '15 at 8:44
  • @Koala I've added fixes for French and \textgreek. note that while it works to use \text<lang> even for texts containing paragraphs, it produces invalid HTML. it is better to use \begin{lang} for text with paragraphs. – michal.h21 Dec 31 '15 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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