On Fri, Sep 22, 2006 at 11:40:48AM +0200, Jean-Marc Lasgouttes wrote:
> >>>>> "Helge" == Helge Hafting <[EMAIL PROTECTED]> writes:
> 
> Helge> Hm. For each paragraph type, the .layout could specify whether
> Helge> an "optional argument" is allowed. And perhaps even "how many".
> Helge> If so, one should be able to use the optional argument inset
> Helge> currently only used for short titles.
> 
> THis is what we do already... but not for environments!
> 
> JMarc

The attached patch would put the infrastructure in place for doing it
for environments too. Seems to work. 

BTW LaTeX output is broken (outputs numbers) in trunk.

Should I check this in?

- Martin

Index: output_latex.C
===================================================================
--- output_latex.C      (revision 14992)
+++ output_latex.C      (working copy)
@@ -81,6 +81,10 @@
 }
 
 
+int latexOptArgInsets(Buffer const & buf, Paragraph const & par,
+                     ostream & os, OutputParams const & runparams, int number);
+
+
 ParagraphList::const_iterator
 TeXEnvironment(Buffer const & buf,
               ParagraphList const & paragraphs,
@@ -129,6 +133,14 @@
 
        if (style->isEnvironment()) {
                os << "\\begin{" << style->latexname() << '}';
+               if (style->optionalargs > 0) {
+                       int ret = latexOptArgInsets(buf, *pit, os, runparams,
+                                                   style->optionalargs);
+                       while (ret > 0) {
+                               texrow.newline();
+                               --ret;
+                       }
+               }
                if (style->latextype == LATEX_LIST_ENVIRONMENT) {
                        os << "{" << pit->params().labelWidthString() << "}\n";
                } else if (style->labeltype == LABEL_BIBLIO) {

Attachment: pgpBinvjsZHnE.pgp
Description: PGP signature

Reply via email to