Monday, August 26, 2013

On screen LaTeX interpreter

On screen rendering using LaTeX interpreter changed few times. There here problems regarding output image output format. First I used the PPM format, but it doesn't support transparency. So it was changed to a BMP format. After some time implementing the reader for this format and testing, result was that GhostScript don't work nice with this format. So it was changed again to PNG format.

With new format there are nice transparent rendering of LaTeX file ( constructed in Octave ) and GhostScript use subsample anti aliasing to produce nice image. This data is then read from PNG image and transferred to OpenGL buffer.

Upgraded interpreter have some new functionality. It can change color of text in octave directly and then apply this color to all text, that isn't previously colored. This exception is added because user can
use coloring of text directly in input string this way user can have multicolored text. User can change the size of font directly in Octave using 'fontsize' parameter, example bellow.

graphics_toolkit('fltk');
plot(1,1);
title('Text \color{red}{colored}','interpreter','latex','color','blue');




To change size of text user can use 'fontsize' property. Trough this property user change the resolution of output from GhostScript and this is scaled to represent direct change of font size in points.

title('Text','interpreter','latex','color','blue','fontsize',48);



And here is example of using the mathematics special characters:

title('$\oint \! \nabla f \, \dif t = 0$','interpreter','latex','fontsize',48);




As you can see it needs to be encapsulated inside dollar signs. Adding bold, italic and others type of text is an option, but as Matlab don't support this we won't support this also

As you can see there are some things that could be upgraded. First and obvious is alignment, but this isn't the priority. Next step is to check for libraries and dependencies. And to configure this new interpreter to work on all large platforms. To check how development is evolving feel free to download from my online repository.



Tuesday, August 6, 2013

New timeline - part 2

The evaluation period is over. And the second part of Google Summer of Code has started. So here is the second part of timeline for my project. 

Week 1  -  [ 05.08 ÷ 09.08] - Upgrade on-screen rendering

The proof of concept have some flaws that need to be fixed and generally Latex interpreter upgraded. First thing is to change image format from PPM to some format enabling GhostScript to store information about transparency. Focus is set to BMP format. It's part of output devices in GS and it's not compressing so it's relatively easy to extract raw data from this file format. The next thing is to shrink image and improve image quality. This part will be done with ImageMagic and GS. There are several additional nice upgrades that are not necessary, like piping dvips and GS , changing font and font size. This will be worked on depending on time.

Week 2  -  [ 12.08 ÷ 16.08 ] - Figure out how the printing is working

  Until this week there will be functional and fairly good Latex interpreter for on-screen rendering. The plan is to implement this interpreter to printing side. First step of implementation is discovering how exactly printing side works and plan how to implement Latex interpreter.

Week 3/4  -  [ 19.08 ÷ 30.08 ] - Implement printing side

  This two weeks should be used to implement and fully test Latex interpreter on printing side. For printing EPS image (vector) format will be used. Prining side is responsible for saving plots to. This will enable user to save plot with fancy Latex markups and present his results to other people.

Week 5  -  [ 02.08 ÷ 06.08 ] - Configuring interpreter functionality

  It would be nice to check if user have all required binaries to run Latex interpreter. And if not, this interpreter should be disabled and proper information printed into terminal to user. Probably explain how to solve this and what exactly he need to have on his system for this to work properly.

Week 6  -  [ 09.08 ÷ 13.08 ] - Expand to all platforms

  All development is done on Ubuntu 12.10 . Last week of coding period is right time to check how this new functionality is working on others system. After testing the code should be modified. Because programs running in background enabling interpreter have different names and behave differently on different systems.