← Back to team overview

zim-wiki team mailing list archive

Re: LaTeX export and some questions

 

On Tue, Mar 2, 2010 at 6:25 PM, Johannes Reinhardt
<jreinhardt@xxxxxxxxxxxxxxxxxx> wrote:
> I've run into a problem, where I am not sure what the best soltion is.
> The sectioning levels depend on the documentclass (article, report,
> book, presentation, ...). For example, there are no chapters in
> articles. To make the dumper do the right thing, (i.e provide the five
> correct sectioning levels for the documentclass), I see several
> possibilities:
>        * A custom dumper class for each documentclass. This pollutes
>          the output format menu with lots of LaTeX-variant.
>        * The dumper class has to know which documentclass the chosen
>          template is. So the exporter has to tell the dumper which
>          template is targeted. Also either the template has to be
>          parsed or some convention for the template name has to be
>          established so that the documentclass for a template
>          can be determined.
>        * The dumper writes sectioning indirect commands (like \hone,
>          \htwo, \hthree, ...), and these are mapped to the right
>          sectioning commands within the template with \newcommand.
>          This is ugly, as the resulting LaTeX Code is obfuscated.
>        * Sacrifice the flexibility and lock LaTeX export to a certain
>          documentclass.


I think the best solution is to have the template set a parameter
which is communicated to the dumper. I can help implementing this in
the template module. If the parameter is not set you just choose a
(arbitrary) default.

So this would be a variant of your 2nd suggestion.

Regards,

Jaap



References