Show math symbols in gitit - tex

I would like to display minor math symbols in gitit wiki.
For example, I can display ⇑ by
$\Uparrow$
However, other commands of minor symbols, like \barwedge, \notin, \nleq, are not displayed.
Checking the HTML source code, I found that those commands are not converted.
Do I need to install something additionally?
As far as I know, gitit uses texmath in backend.
My gitit wiki is configured to use MathML.

Related

How to get the rails.vim-command :Rview working with .js.erb-views?

I want Rview to jump to .js.erb-views as well.
It always says "Can't find file "app/views/examples/foo".
The help says:
rails-template-types
Commands like :Rview use a hardwired list of
extensions (erb, rjs, etc.) when searching for files. In order to
facilitate working with non-standard template types, several popular
extensions are featured in this list, including haml, liquid, and mab
(markaby). These extensions will disappear once a related
configuration option is added to rails.vim.
Since the view ends with .erb, i would suggest it should work.
Any Ideas?
This is strange, I just checked in my vim and it works fine. I use Janus, but I think that the standard vim + rails.vim should work well.
Maybe you need to update rails.vim?
And you can tell the sequence of your actions: the current file, typed commands, etc.

What is the best way to print a Gtk.Widget to the printer?

I have a couple of (mostly) text widgets that I would like to render to a printer through a standard "Print..." menu option. One widget is a Mono.TextEditor document, and the other is a Gtk.TextView.
I'm looking for a pretty basic print for now, which might wrap long lines, and add page numbers. Do I need to code all of this myself somehow?
If you have pointers, that would be great, especially if they were in C#.
For line wrap and justification, one can use pango Layout
options, as described for Python at pygtk/class-pangolayout or for C at pango/pango-Layout-Objects. See functions pango_layout_set_wrap() and pango_layout_set_justify().
Also see the example-code routines begin_print, do_page_setup, and do_print in file pygtk-demo/demos/print_editor.py, if you have installed pygtk on your system. (On my system, the full path to directory of Python Gtk demo files currently is /usr/share/doc/pygtk2-2.17.0/examples/pygtk-demo/demos)
For printer setup dialog, see gtk-High-level-Printing-API for C, or class-gtkprintoperation for Python.

How to Print Rails Source Code?

I'd like to read the Rails 3 source code on printed paper (and preferably in color).
For example, xv6 did a nice job printing their code. It even has line numbers and an index. The only thing I would like to add is syntax highlighting.
Anyone know how any of this is possible?
Here are two possibilities I found:
1. The Listings Package (could this also generate other formats besides PDF, like HTML?)
ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf o
2. Highlight (does it do indexing?)
http://www.andre-simon.de/
We could even add a rake task, print, that generates an up-to-date PDF.
I recomend you use highlight to turn the code into LaTeX and then use Listings to make it into a PDF, then print!

Don't make me manually abort a LaTeX compile when there's an error

As suggested here, latexmk is a handy way to continually compile your document whenever the source changes. But often when you're working on a document you'll end up with errors and then latex will panic and wait for user input before continuing. That can get very annoying, especially recently when I hacked up something to compile latex directly from an etherpad document, which saves continuously as you type.
Is there a setting for latex or latexmk to make it just abort with an error message if it can't compile? Or, if necessary, how would I set up some kind of Expect script to auto-dismiss LaTeX's complaints?
(I had thought pdflatex's option -halt-on-error would do the trick but apparently not.)
Bonus question: Skim on Mac OSX is a nice pdf viewer that autorefreshes when the pdf changes (unlike Preview), except that whenever there's a latex error it makes you reconfirm that you want autorefreshing. Texniscope doesn't have this problem, but I had to ditch Texniscope for other reasons. Is there a way to make Skim always autorefresh, or is there another viewer that gets this right?
ADDED: Mini-tutorial on latexmk based on the answer to this question:
Get latexmk here: http://www.phys.psu.edu/~collins/software/latexmk-jcc/
Add the following to your ~/.latexmkrc file:
$pdflatex = 'pdflatex -interaction=nonstopmode';
(For OS X with Skim)
$pdf_previewer = "open -a /Applications/Skim.app";
While editing your source file, foo.tex, run the following in a terminal:
latexmk -pvc -pdf foo.tex
Use Skim or another realtime pdf viewer to view foo.pdf. For Skim, just look at the “Sync” tab in Skim’s preferences and set it up for your editor.
Voila! Hitting save on foo.tex will now cause foo.pdf to refresh without touching a thing.
With MikTeX, pdflatex has this command-line option:
-interaction=MODE Set the interaction mode; MODE must be one
of: batchmode, nonstopmode, scrollmode,
errorstopmode.
Edit suggested by #9999years:
Those values are equivalent to a set of LaTeX \commands that provide the same functionality.
From TeX usage tips:
The modes make TeX behave in the following way:
errorstopmode stops on all errors, whether they are about errors in the
source code or non-existent files.
scrollmode doesn't stop on errors in the source but requests input when a
more serious error like like a missing file occurs.
In the somewhat misnamed nonstopmode, TeX does not request input after
serious errors but stops altogether.
batchmode prevents all output in addition to that (intended for use in
automated scripts). In all cases, all errors are written to the log file
(yourtexfile.log).
You can also put \nonstopmode or \batchmode at the very beginning of your tex file; then it'll work with any TeX version, not just pdflatex. For more info on these and related commands see the very good reference on (raw) TeX commands by David Bausum. Especially the command from the debugging family could be of interest here.
Another possible hack is simply to use:
yes x | latexmk source.tex
You could always create an alias for 'yes x | latexmk' if you're going to use this option lots. The main advantage of this that I can see above the other suggestions is that it is very quick for when you occasionally want latexmk to behave like this.
Mehmet
There is also a \batchmode command may do the work.

Adding MS-Word-like comments in LaTeX

I need a way to add text comments in "Word style" to a Latex document. I don't mean to comment the source code of the document. What I want is a way to add corrections, suggestions, etc. to the document, so that they don't interrupt the text flow, but that would still make it easy for everyone to know, which part of the sentence they are related to. They should also "disappear" when compiling the document for printing.
At first, I thought about writing a new command, that would just forward the input to \marginpar{}, and when compiling for printing would just make the definition empty. The problem is you have no guarantee where the comments will appear and you will not be able to distinguish them from the other marginpars.
Any idea?
todonotes is another package that makes nice looking callouts. You can see a number of examples in the documentation.
Since LaTeX is a text format, if you want to show someone the differences in a way that they can use them (and cherry pick from them) use the standard diff tool (e.g., diff -u orig.tex new.tex > docdiffs). This is the best way to annotate something like LaTeX documents, and can be easily used by anyone involved in the production of a document from LaTeX sources. You can then use standard LaTeX comments in your patch to explain the changes, and they can be very easily integrated. If the document lives in a version control system of some sort, just use the VCS to generate a patch file that can be reviewed.
I have used changes.sty, which gives basic change colouring:
\added{new text}
\deleted{old text}
\replaced{new text}{old text}
All of these take an optional parameter with the initials of the author who did this change. This results in different colours used, and these initials are displayed superscripted after the changed text.
\replaced[MI]{new text}{old text}
You can hide the change marks by giving the option final to the changes package.
This is very basic, and comments are not supported, but it might help.
My little home-rolled "fixme" tool uses \marginpar where possible and goes inline in places (like captions) where that is hard to arrange. This works out because I don't often use margin paragraphs for other things. This does mean you can't finalize the layout until everything is fixed, but I don't feel much pain from that...
Other than that I heartily agree with Michael about using standard tools and version control.
See also:
Tips for collaboratively editing a LaTeX document (which addresses you main question...)
https://stackoverflow.com/questions/193298/best-practices-in-latex
and a self-plug:
How do I get Emacs to fill sentences, but not paragraphs?
You could also try the trackchanges package.
You can use the changebar package to highlight areas of text that have been affected.
If you don't want to do the markup manually (which can be tedious and interrupt the flow of editing) the neat latexdiff utility will take a diff of your document and produce a version of it with markup added to visually display the changes between the two versions in the typeset output.
This would be my preferred solution, although I haven't tested it out on large, multi-file documents.
The best package I know is Easy Review that provides the commenting functionality into LaTeX environment. For example, you can use the following simple commands such as \add{NEW TEXT}, \remove{OLD TEXT}, \replace{OLD TEXT}{NEW TEXT}, \comment{TEXT}{COMMENT}, \highlight{TEXT}, and \alert{TEXT}.
Some examples can be found here.
The todonotes package looks great, but if that proves too cumbersome to use, a simple solution is just to use footnotes (e.g. in red to separate them from regular footnotes).
Package trackchanges.sty works exactly the way changes.sty. See #Svante's reply.
It has easy to remember commands and you can change how edits will appear after compiling the document. You can also hide the edits for printing.

Resources