html2lyx


Copyright (C) May 2003 - Martin Olveyra molv@users.sourceforge.net

html2lyx v.1.01 This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Go back

Tiny Python application that exports an html file to lyx format.

Download:

Includes documentation.

June 27, 2003

Requirements:

Usage:

The main features of html2lyx that makes it very usefull to export to lyx format is its ability to manage bold and italic text styles, and, the most important thing, its conversion of footnotes. In general, the html texts with footnotes has a code similar to the following:

<body>

<h1>El principio metafísico del Estado</h1>
(...)
<p>(...).
<p>(...). Este deber de obediencia u <i>obligación política</i>, que inspiró a La Boétie y asombraba a Hume<a href="#nota22">[22] </a>, está estrechamente ligado a una <i>teoría de la legitimidad del poder </i>. (...)
<p>(...).
<p>(...).

<h3>Notas al pie.</h3>
<p><a name="nota1">[1] (...)
(...)
<p><a name="nota21">[21] (...)
<p><a name="nota22">[22] La Boétie, Etienne de, <i>El discurso de la servidumbre voluntaria.</i> Hume, David, Des premiers principes du gouvernement.
<p><a name="nota23">[23] (...)
(...)

</body>

Which in a browser looks like:

El principio metafísico del Estado

(...).

(...). Este deber de obediencia u obligación política, que inspiró a La Boétie y asombraba a Hume[22] , está estrechamente ligado a una teoría de la legitimidad del poder . (...)

(...).

(...).

Notas al pie.

[1] (...) (...)

[21] (...)

[22] La Boétie, Etienne de, El discurso de la servidumbre voluntaria. Hume, David, Des premiers principes du gouvernement.

[23] (...)
(...)

Then, in order to html2lyx be able to locate the footnotes section so to generate the correct lyx code, the source html must be modified in such a way that the tags <footnotes> and </footnotes> enclose such section, from the first to the last footnote. In this case, the html source file would be modified in the following way (in blue for the sake of clarity):

<body>

<h1>El principio metafísico del Estado</h1>
(...)
<p>(...).
<p>(...). Este deber de obediencia u <i>obligación política</i>, que inspiró a La Boétie y asombraba a Hume<a href="#nota22">[22] </a>, está estrechamente ligado a una <i>teoría de la legitimidad del poder </i>. (...)
<p>(...).
<p>(...).

<h3>Notas al pie.</h3>
<footnotes>
<p><a name="nota1">[1] (...)
(...)
<p><a name="nota21">[21] (...)
<p><a name="nota22">[22] La Boétie, Etienne de, <i>El discurso de la servidumbre voluntaria.</i> Hume, David, Des premiers principes du gouvernement.
<p><a name="nota23">[23] (...)
(...)
</footnotes>

</body>

Once the html source file has been modified, we run the program:

html2lyx archivo.html > archivo.lyx

Then only rest to make some extra modifications in the lyx file.


Last update: June 27, 2003.