Hi All,
Using my fingers and RegEx, I hardly manage to convert simple HTML file to TeX file, something like : find : <h1>([^<]+)</h1> replace : \section{$1} find : <h2>([^<]+)</h2> replace : \subsection{$1} find : <ul> replace : \begin{itemize} find : <blockquote>([^<]+)</blockquote> replace : \begin{quotation}\n$1\n\end{quotation} and so on...
Has someone here written a macro that does that job? It would be very helpfull :)
Thanks,
On 11. nov 2004, at 22:09, José Campos wrote:
Hi All, Using my fingers and RegEx, I hardly manage to convert simple HTML
file to TeX file, something like : find : <h1>([^<]+)</h1> replace : \section{$1} find : <h2>([^<]+)</h2> replace : \subsection{$1} find : <ul> replace : \begin{itemize} find : <blockquote>([^<]+)</blockquote> replace : \begin{quotation}\n$1\n\end{quotation} and so on... Has someone here written a macro that does that job? It would be very helpfull :)
This is where it starts getting easier if we had a macro language/applescript, with big macros like this. Alternatively, calling an external shell script which used e.g. sed or something like that to do all the replacing could be useful I think.
On 12. Nov 2004, at 5:00, Sune Foldager wrote:
Using my fingers and RegEx, I hardly manage to convert simple HTML
file to TeX file, something like :
Are you aware of tex4ht? It does a rather good HTML conversion.
This is where it starts getting easier if we had a macro language/applescript, with big macros like this.
Clearly you haven't had to write anything in applescript! ;)
Alternatively, calling an external shell script which used e.g. sed or something like that to do all the replacing could be useful I think.
Yes, for lots of non-interactive stuff scripting TextMate is inferior to using a real scripting language (but you can always call the script from TM of course).
Kind regards Allan