I am using sws2tex to convert sage notebooks to latex. I am wondering if it is possible to disable syntax highlighting?
The reason I want this is that sometimes I use the Maple and Matlab interfaces directly in the notebook, and the syntax highlighting looks wrong here. I know I can remove it manually after creating the tex file, but I would like to be able to disable it instead.
Another small question: Is it possible to disable the "attachfile"? Of course this is not so important since it requires removing 1 or 2 lines, but it could be nice though...
Kabi, this is all possible, but for now you have to do it all yourself by modifying sws2tex.py. I have done this myself at times.
As you noted, removing the "attachfile" is very simple. I usually also do
so I have the original TeX source to look at (or modify).
The easiest way to remove the syntax highlighting is to comment out all the stuff about colorizing, like so (I also do this):
Or you can do your own colorizing. It's also possible to remove this from the place where the stuff happens in the methods for cells.
It's great to hear you use this, by the way; sws2tex is not part of Sage yet, but the hope is that it would eventually be ready for inclusion, and comments like this for options are great to hear.
I have now changed several things in the sws2tex.py file including disabling syntax highlighting.
It is practical in the notebook to be able to use %hide and then %latex in the second line or only %latex, and then only have the pure latex code included in the tex file without adding the input cell with latex code in a verbatim environment. I achieve this with sws2tex by changing the following in the, class InputCell(Cell):
Another thing for people having problems with special letters like æ, ø or å in danish: One solution is to add the following as the first line in html2latex.py:
and the following to convert the letters from the html to utf-8:
With these changes the sage notebook becomes a near complete math/report environment for me. sws2tex makes it possible to produce very good paper print of your work done in the notebook, which (in my opinion) is not the case with the existing print function with jsMath directly from the notebook.
So thanks for sws2tex and keep up the good work! :-)
Asked: Sep 03 '11
Seen: 168 times
Last updated: Sep 06 '11
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.