synctex + gedit + evince

Forward and backwards search for latex source and their compiled images is a must have feature for me. I also very much like Ubuntu (and Linux in general). Wherever possible I prefer to avoid installing new software. I also like using programs that do what I want but nothing more.

For these reasons I’ve been trying to get forwards and backwards search with gedit and synctex working for some time. I’m told that both the gedit synctex and gedit latex plugins work well in gnome 3. Unfortunately Ubuntu Natty does not currently play well with gnome 3. It is more unfortunate then that neither the gedit synctex plugin nor the gedit latex plugin work on my machine. Don’t ask me why, all I get are series of python exceptions. I’ve tried just about everything, including cloning the gedit-plugin repository checking out branch gnome-2.32, manually install the plugin code and applying all relevant plugins: I still get python exceptions relating to the gedit/plugin interaction.

Believe me, I’ve wanted to fix this problem for sometime. Indeed I was so motivated that I stated learning how the dbus works so that I could write my own script to solve the problem. That was when I stumbled across this page. The files that can be downloaded via a link on the first post are written by the same fellow who wrote the evince synctex plugin. The difference here is that they only interact with the dbus. Since the python exceptions I was getting were to do with the why the gedit plugins were implemented and not to do with the dbus interaction these files have solved my problem (but see below for existing problem).

So using the external tools plugin with the following settings I now have forward and backward search working. Note that my system hangs if I attempt to change the applicability settings, thus I won’t list them below.

External Tools Code

PDFLatex tool
Name: PDFLatex
Shortcut Key: p
Save: Current Document
Input: Nothing
Output: Display in bottom pane
Code:
#!/bin/bash
pdflatex -synctex=1 -interaction nonstopmode "$GEDIT_CURRENT_DOCUMENT_NAME"

Bibtex
Name: Bibtex
Shortcut Key: b
Save: Current Document
Input: Nothing
Output: Display in bottom pane
Code:
#!/bin/sh
bibtex ${GEDIT_CURRENT_DOCUMENT_NAME%.tex}.aux

Synctex Forward
Name: Synctex Forward
Shortcut Key: f
Save: Nothing
Input: Nothing
Output: Display in bottom pane
Code:
#!/bin/sh
evince_forward_search "${GEDIT_CURRENT_DOCUMENT_PATH%.tex}.pdf" "${GEDIT_CURRENT_LINE_NUMBER}" "${GEDIT_CURRENT_DOCUMENT_PATH}"

Instructions for getting it all working

The external tools above will allow for compilation of the latex code and for forward search. Backward search must be set up by hand. Use the following command or variations there of;
evince_backward_search myfile.pdf "gedit +%l %f"
It goes without saying that evince_backward_search must be placed in a folder that is in the $PATH environment. If I could be bothered one could write a nice script to load evince with the appropriate pdf, load evince_backward_search, and then kill it on exit of evince…

Existing Issues

  1. Both evince and gedit must be run on the same desktop in Natty. If not the evince_backward_search script will load gedit once and then hang. Further Ctrl+clicks will produce no action until the previous gedit instance is closed. At this point the script will process the unactioned events.
  2. The evince_backward_search script does not exit. If you want the process killed you must do it manually. I’m not sure what I’d like here. Perhaps that the script exits once the evince process displaying the same file name exits. There must be a way to do this using the dbus, but I’m not (currently) worked up enough about it to care.
  3. The pdflatex external tool does not stop for errors (you can change this by removing -interaction nonstopmode

Updates

  1. I have discovered a problem with files whose absolute path contains spaces. The issue arises on line 75 as the url returned by the dbus is format with special characters while self.url is not. This can be fixed by replacing the string 'file://'+pdf_file with 'file://'+urllib.quote(pdf_file,safe="%/:=&?~#+!$,;'@()*[]") on line 158. Remember to import the package urllib. This solution came from the nice people of stackoverflow.
  2. 20th October 2001

    The update to Ubuntu 11.10 breaks the file evince_backward_search. Change line 124 to def on_sync_source(self, input_file, source_link,timestamp):. For some reason (I assume an update to the dbus) Ubuntu hands over 3 rather than 2 variables. The extra variable seems to be a time stamp. For those that are interested I used dfeet to have a look at this. Enjoy!

Lastly: Yes I can see that the <code> tag isn’t formatted correctly in the lists… I will have to talk to the making of this theme.

I have to write literature too?

I wish to be a successful mathematician. I want my papers to be read, enjoyed, even eagerly anticipated. I struggle, however, to write well.

Most of my posts are stream of consciousness. They are my thoughts, with only a little reflection thrown in. This I don’t mind. My blog isn’t to advertise myself, allow inclusion into a community or to make money (though those things would be nice). Each post is a reminder to myself of my thoughts on some research topic. Each post is here for me to refer to later: I will save time by having easy access. I also post them online, since these thoughts are a product of my publicly funded research. Someone’s tax paid for the time I spent reading a paper and as I am being paid for my thoughts, why not post the unpublishable in a public place.

The same is not true of my publications. Each research paper is not only a collection of proofs on some topic, it is also how I communicate with my peers. It is a conversation, a phone call, an email. Indeed it is my principle form of communication. Many of my peers will only know me through my papers. When I apply for a job my papers will be my CV. They will represent who I am and what I do. They are my envoy to the mathematics world.

I cannot afford, therefore, to publish poorly written papers. I must aim for each paper to be a jewel of exposition. Of course, the content must be there, but my papers must readable, accessible, understandable. Otherwise the content will be hidden, I will be asking too much of the reader. Ideally they should also illuminate and inspire. I will fail to achieve this lofty goal, but by aiming for it, my writing will improve.

I am currently writing paper with Adam Rennie. His attention of structure, form and the intended audience shows how feeble my previous attempts have been. In an effort to improve I’m reading Halmos’ essay on writing mathematics. Since I often read something, understand it then forget all, I’ll post a summary of the the essay soon.

A theoretical language to study numerical computation?

I’ve just finished Jörg Frauendiener’s, “On the applicability of constrained symplectic integrators in general relativity”. It’s a readable paper (the necessary background is given in the paper) about numerical integration in Hamiltonian systems. The idea here is that if we have a symplectic manifold modelling the states of some system of ODE’s, along with a hamiltonian we can give numerical integrators that respect the symplectic structure of the manifold. By this is meant that, for any point in the manifold and any time step, the numerical integrator gives a solution that approximates the state given by the hamiltonian flow up to a particular order. What exact it means that two points in a manifold can be approximated up to a sufficient order is not clear to me, but given that a point in the manifold is a function on some domain then I assume something like the L_2 norm could be used. Such numerical integrators, called symplectic integrators, have some nice properties (see Jörg’s paper for details). Apparently (when the paper was produced) there was a bit of a buzz about symplectic integrators that also respect constraints in the system. Jörg shows that the nature of the constraint system in GR is such that the current symplectic integration schemes won’t work (he argues that they can never work). The problem is linked to the old issue that the hamiltonian system + constraints for GR is such that there is no hamiltonian flow on the constraint manifold. In non-mathsy language that means that there is no “time”.

I’ve lately been interested in summation-by-parts (SBP) finite difference operators. These are matrices that replicate the integration by parts property of integration, when applied to functions over a grid. The SBP property ensures that numerically calculated solutions to DE’s converge with time as well as with space. This is useful if one is interested in long-time evolutions. The SBP property ensures this by allowing discrete analogues of analytical techniques used when constructing energy estimates. The early papers justify SBP operators on the basis of the energy estimate that can be given. Whose not to say that there isn’t a better class of finite difference operators out there, waiting for some one to stumble onto them? To start investigating this one needs some language in which all finite difference operators can be represented, classified and studied. Jörg’s paper shows that symplectic manifolds can do this, at least for the very specific case he’s interested in. Can it do it for other finite difference operators?

This question seems to be an obvious one (at least to me) and hence I expect there to be much literature about it…

What do we really know about Dark Energy?

I refer you to Ruth Durrer’s very readable (and short) paper with the same title as above. The main point of the paper is that all evidence for Dark Energy comes from the measurement of luminosity distance as a function of redshift and that energy/matter content of the universe is then inferred from this measurement by equation (3) of the paper (go check it out…). Thus the assumptions that feed into equation (3) also affect our interpretation of the dark energy content of the universe. This equation is, apparently, derived by assuming that the geometry of our universe is given by the Friedmann-Lemaître model, which I assume is a FLRW metric with a specific assumption about the expansion. WARNING: I could be very wrong about that.

In case the paper feeds my love/hate relationship with Dark energy very nicely and reads easily (even if you ignore most of the equations). Seriously: The paper gives an accessible introduction…

Hyperbolicity of BSSN

So, from what I understand it seems that strong and symmetric hyperbolicity of equations is only defined for systems with first order derivatives. The significance is that strong or symmetric hyperbolic systems of differential equations are “well posed” that is, roughly speaking, that they have unique solutions that depend continuously on the initial data (i.e. a small change in the initial data produces a small change in the solution). Of cause this is very important if one is running some numerical simulation since it ensures that no problems in the simulation can be the result of a problem with the equations (although there can be issues with the representation of the equations on the computer).

There is a formulation of Einstein’s equations, called the Baumgarte-Shapiro-Shibata-Nakamura or BSSN system. It is a system involving first order time derivatives and second order spatial derivatives and therefore it is not immediately obvious that the system should behave well in numerical simulations. But it does, the question is why?

Sarbach, Calabrese, Pullin and Tiglio solved this by showing in “Hyperbolicity of the Baumgarte-Shapiro-Shibata-Nakamura system of Einstein evolution equations” that the BSSN is equivalent to a subfamily of the Kidder-Scheel-Teukolsky (KST) formulation for the Einstein equations. Since the KST systems have first order spatial and first order time derivatives this equivalence allows one to state that the BSSN system has, in some sense, the strongly and symmetrically hyperbolic properties as the KST system. Thus for certain values of certian variables the BSSN system is well posed, that is the BSSN system is a theoretically a good system to work with. The paper thus supports a variety of numerical evidence showing this (check out the paper for references).

All that being said I stumbled across Gundlach and Martin-Garcia’s, “Symmetric hyperbolic form of systems of second-order evolution equations subject to constraints” which attempts to give a definition of strong and symmetric hyperbolicity for such systems as the BSSN system. A quick search on ISI of the citing papers doesn’t bring anything up so it seems at first glance that their paper has gone no where at least with regards to the theory (Correct me if I’m wrong!).

In any case I find all this very interesting and am constantly surprised by the depth of complexity which means that no general theory for this kind of stuff has been worked out.

Older posts «