Visit the forum instructions to learn how to post to the forum, enable email notifications, subscribe to a category to receive emails when there are new discussions (like a mailing list), bookmark discussions and to see other tips to get the most out of our forum!
[Wiki] [Wishlist] Nice way to display fractions
• September 2011
I would like to suggest/request/propose the addition of an appropriate extension on the wiki to format and display fractions nicely, since we are (for now) stuck using imperial measurements, and the manufacturing instructions (with their accompanying blueprints/diagrams) are intended as the big product of OSE.

http://en.wikibooks.org/wiki/LaTeX/Mathematics shows I think decent fraction formatting (I like the diagonal style; they disrupt line spacing less than pure vertical fractions).

If it was installed, not everyone would have to use it, but "tweak freaks" like myself could easily use the formatting when someone types "13/16" to format it with the extension.

Thank you for considering my idea!

• September 2011

Andrew had requested this a while back, and so I enabled TeX (see installation and usage instructions at http://www.mediawiki.org/wiki/Manual:Math)

$P_2 = P_1 \left ( \frac{V_1}{V_2} \right ) ^\gamma = P_1 r^\gamma$

It looks like there's a better way to display inline fractions and measurement units (including SI) by installing a LaTeX package:

But I think MathJax could be an even better option.

• September 2011
Ah, sorry for my ignorance it had already been installed.  Thank you!

• September 2011
It was installed, but diagonal fractions are not displayed, so I need to do something in order to get it working correctly...

• September 2011
I've installed MathJax on our wiki, which should provide better-looking (and scalable) math rendering.

I'm still trying to find a simple way to get diagonal fractions to work with MathJax though...

• September 2011
The LaTex package I pointed in the page mentioned something called xfrac for slanted fractions with its sfrac command (if that means anything).  Its about a quarter down the page.

• September 2011
Looks like we need to implement the nicefrac package in Javascript in order to make it available to MathJax (see http://groups.google.com/group/mathjax-users/browse_thread/thread/ec685d7b5c578f31?pli=1)

I adapted this suggestion to work with MathJax:

\def\sfrac#1#2{%
\raise.5ex\small#1%
\kern-.1em/\kern-.15em%
\lower.25ex\small#2}

So we can use this simplistic sfrac macro until we can get the xfrac package to work.
Example:

$P_2 = P_1 \left ( \sfrac{V_1}{V_2} \right ) ^\gamma = P_1 r^\gamma$

• September 2011
Thanks for working on it, elifarley, I greatly appreciate it.  I'm fussing a lot through the wiki articles on CEB construction (well, actually, several folk are now), and will try to implement the better-looking fractions as I work through them.

• September 2011
hey guys, will people be able to copy and paste the text from the wiki? or will it be a picture? i think that should be a consideration. thanks.

• September 2011
Just right-click on the rendered formula, choose your preferred output format (TeX or MathML) and click on "Show Source".

A popup window will open, and you'll be able to copy the source text.

• September 2011
Hmm, its not looking right.  Am I doing something wrong?

• September 2011

• September 2011
It still looks a bit awkward to me, I think because the numbers are in two different fonts (since LaTeX uses its own font).  I'm also used to inch marks (") being close to the numbers.  I suppose we could do the entire instruction articles in LaTeX on the wiki, but it might reduce how readily the articles are for those who haven't learned LaTeX.

• March 2012

Alex Shure wrote:

The [itex] tag isn't working in the OSE wiki :(

Failed to parse (PNG conversion failed; check for correct installation of latex, dvips, gs, and convert)

Here you can see an example of a page which uses math, the LaTeX isn't displayed, but an error is shown: http://opensourceecology.org/wiki/Germany/Wind_Turbine

• March 2012

• March 2012
There are a few commands missing in our managed Linux VPS.
Currently, only the commands 'convert' and 'gs' are installed.
We also need latex, dvips and dvipng, so I asked our provider to install them. Here's their reply:

Because there are lots of dependencies for  the package latex we're afraid that we

aren't able to install it. Sorry for that.

Should you require further assistance, please do not hesitate to contact me.

We could also re-enable MathJax (see comments above), but enabling it makes any wiki page using the $sign look strange (@Nikolayhg will remember that). You can see a snapshot of an affected page and read a more detailed description of the problem at: http://www.mediawiki.org/wiki/Extension_talk:MathJax#.24_sign_prevents_some_wiki_code_from_being_parsed So, we either find a way to enable MathJax without messing up with wiki page layout, or compile and install Latex on a user directory - and I think fixing the display of$ and enabling MathJax is the best option.

Any help is appreciated.

• March 2012
Alex Shure wrote:

Hi Eli

If you don't have shell access nor the capacity for a latex renderer, maybe someone involved in ose has it?
If not, go for this solution:

http://www.mediawiki.org/wiki/LaTeX_on_a_shared_host

Scroll down..

• March 2012
Alex Shure wrote:

This could also be of interest, using google chart as a latex graphic renderer: http://www.mediawiki.org/wiki/LaTeX_with_google_chart

• March 2012
The google chart latex renderer generates the most beautiful latex code so far,

^ this image was generates on the fly via google. No local server load and no dependencies. Including nice anti-aliasing and spacing.

• March 2012
I've enabled the first solution - can you test it please?

• March 2012
[itex] outputs the same error, nothing changed.

Meanwhile I switched to <m> and got a decent output.

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!