How to use gedit-latex-plugin?

gedit-latex in ubuntu repos works only with gedit-2.x, however ubuntu 11.10 comes with more recent gedit-3.x. Try to use this one https://launchpad.net/ubuntu/oneiric/i386/gedit-latex-plugin/3.3.1-1~oneiric1


I had the same problem. It has to do with the fact that ubuntu 11.10 comes with a newer version of gedit, which doesn't support the gedit-latex-plugin (version 0.2.0) that is currently in the ubuntu repositories.

A new version of gedit-latex-plugin is currently under development here (in lauchpad)

Here are some options:

  • You could try to run the present unstable version of the plugin. This was constantly segfaulting on my machine, so I moved on...

  • You could try a standalone editor, for instance latexila is a great editor. It doesn't, however, support the use of snippets (which is a deal-breaker for me). If snippets aren't that important to you, try it out:

    sudo apt-get install latexila
    
  • I ended up using the external tools plugin for gedit. There's a nice post about this option here. A quick how to:

    1. Within gedit, go to edit > preferences > plugins and scroll down to the external tools plugin and make sure its box is ticked.

    2. Close the Preferences dialog and go to tools > manage external tools

    3. Each tool is a just shell script. You can use several variables as explained here. For example, my Latex-to-PDF tool looks like:

      #!/bin/sh
      
      filename=$GEDIT_CURRENT_DOCUMENT_NAME
      shortname=`echo $filename | sed 's/\(.*\)\.tex$/\1/'`
      
      latex -interaction batchmode -src $filename
      bibtex $shortname
      makeindex $shortname
      latex -interaction batchmode -src $filename
      latex -synctex=1 -interaction batchmode -src $filename
      dvips -t a4 $shortname.dvi
      ps2pdf -sPAPERSIZE=a4 -dOptimize=true -dEmbedAllFonts=true $shortname.ps
      evince $shortname.pdf
      

      A drawback is that this does not support larger "projects", it only compiles the file that is currently being edited.

Tip Check out this post on SyncTex for forward and backward search between gedit and evince, it's great!