On 11/13/2009 02:56 PM, Steven Calkins wrote:
> Hi Sergiu,
>
> I tried what you said, adding the line "macro.formula.renderer = native" to 
> WEB-INF/xwiki.properties and saving it. Then I restarted Xwiki but it didn't 
> work. It still rendered the formula in a single line. Then I tried  
> "macro.formula.renderer = mathtran", saved it, and restarted xwiki. It still 
> didn't work. Is there some part of the the TeX package still missing? I just 
> installed XWiki Enterprise 2.0.3.24848, it runs on postgres.

OK, it seems that the default renderer is the native one, so there was 
no need to change it.

I tried your example, and actually there's a problem with the formula. 
The code from your mail causes the native renderer to fail because 
there's a syntax error, specifically the first mbox contains \le, which 
is only valid in math mode. This works fine:

{{formula}}
f(x) =
  \begin{cases}
  1 & -1 \le x \le 0 \\
  \frac{1}{2} & x = 0 \\
  1 - x^2 & \mbox{otherwise}
  \end{cases}
{{/formula}}

> I was a little surprised that I had to add a line in the 
> WEB-INF/xwiki.properties file and not uncomment a line and change its value, 
> as you do in most cases. Could it be that I have an older config file or is 
> the line in WEB-INF/xwiki.properties not available yet in the newest version? 
> I used the config from the download, and changed only those values that 
> pertained to my earlier system settings.

My fault, I forgot to add this setting in the template that generates 
xwiki.cfg.

> Greetings,
>
> Steven Calkins
>
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:[email protected]] Im Auftrag von 
> Sergiu Dumitriu
> Gesendet: Freitag, 13. November 2009 12:31
> An: XWiki Users
> Betreff: Re: [xwiki-users] Latex {cases} command doesn't work in default 
> xwiki 2.0 formula macro
>
> On 11/13/2009 11:45 AM, Steven Calkins wrote:
>> Dear all,
>>
>>      The LaTeX {case} macro doesn't seem to work in Xwiki 2.0 with the
>> default LaTeX renderer.
>>
>> Try these two examples to reproduce it and compare with
>> http://en.wikipedia.org/wiki/Math_markup#Examples_2:
>> [XWIKI CODE STARTS HERE]
>>
>> === Continuation and cases===
>> This example from wikipedia doesn't seem to work:
>> {{formula fontSize="normal"}}f(x) = \begin{cases}1&   \mbox{-1 \le x<
>> 0\par} \\
>>    \frac{1}{2} \;\;\;&   \mbox{x = 0\par} \\ 1 - x^2&
>> \mbox{otherwise\par}\end{cases}{{/formula}}
>>
>> ===Case definitions===
>>
>> {{formula fontSize="normal"}}f(n) = \begin{cases} n/2,&   \mbox{if }
>> n\mbox{ is even} \\ 3n+1,&   \mbox{if } n\mbox{ is odd}
>> \end{cases}{{/formula}}
>>
>> [XWIKI CODE ENDS HERE]
>>
>> Any suggestions?
>
> The cases environment is not standard TeX, it belongs to the amsmath package. 
> This means that it is not supposed to work using the default backend. It 
> should work with the native one, which uses the amsmath package, and you 
> could try using the mathtran one. If you decide to change the backend, you'll 
> find instructions in the last paragraph on 
> http://code.xwiki.org/xwiki/bin/view/Macros/FormulaMacro#HTechnicalinformation


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to