
De acordo com as Diretrizes de publicação do Kindle da Amazon, preciso adicionar xmlns:mbp="http://www.kreutzfeldt.de/mmc/mbp"
a <html>
tag em meu arquivo html.
Eu tentei muitas variantes do seguinte:
\documentclass{article}
\input{tex4ht.sty}
\Preamble{xhtml}
\begin{document}
\Configure{PROLOG}{HTML+,HTML,@HTML}
% \Configure{HTML+}{\HCode{plus-html test}}
% \Configure{@HTML}{\HCode{at-html test}}
% \Configure{HTML}{\HCode{naked-html test}}
\Configure{*XML-STYLESHEET}{\HCode{xmlss test}}
\Configure{@HEAD}{\HCode{head test} }
\HCode{<meta name="parameter" content="content">}
\Configure{TITLE+}{This is my title}
\EndPreamble
Content
\end{document}
A maioria deles consegue inserir algo na <head>
seção, mas nada entra na <html>
tag. \Configure{PROLOG}
não parece fazer muita diferença. Quando não comento a \Configure{HTML}
linha, recebo um erro:
! Argument of \Configure has an extra }.
<inserted text>
\par
l.16 \end{document}
Obviamente, posso inserir isso manualmente, mas parece que o tex4ht está configurado para fazer isso. <rant>
de todos os recursos mal documentados do tex4ht, o que tem a ver \Configure{PROLOG}
parece ser o pior que encontrei até agora.</rant>
Responder1
\Configure{HTML}
tem dois parâmetros, você tem apenas um no seu exemplo, então esta pode ser a origem do erro. Observe que existe \Configure{@HTML}
para inserir código em arquivos <html ...>
. xml:lang
com o código de idioma correto é inserido por padrão, então você mesmo precisará fornecê-lo. E por último, você não precisa usar \Configure{PROLOG}
.
.cfg
Arquivo simples :
\Preamble{xhtml}
\Configure{@HTML}{xml:lang="en" xmlns:mbp="http://www.kreutzfeldt.de/mmc/mbp" \Hnewline}
\begin{document}
\EndPreamble
resulta em:
<html xml:lang="cs" xml:lang="en" xmlns:mbp="http://www.kreutzfeldt.de/mmc/mbp"
xmlns="http://www.w3.org/1999/xhtml"
>
Responder2
As \Configure
instruções devem ser colocadas antes \begin{document}
para tex4ht
processá-las corretamente, por exemplo, algo assim:
\documentclass{article}
\input{tex4ht.sty}
\Preamble{xhtml}
\Configure{HTML}
{\HCode{<html xmlns="http://www.w3.org/1999/xhtml" xmlns:mbp="http://www.kreutzfeldt.de/mmc/mbp">}}
{\HCode{</html>}}
\Configure{@HEAD}{\HCode{<meta name="parameter" content="content">}}
\Configure{TITLE+}{This is my title}
\begin{document}
\EndPreamble
Content
\end{document}