How to use gedit-latex-plugin?

22,986

Solution 1

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

Solution 2

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!

Share:
22,986

Related videos on Youtube

wim
Author by

wim

Hi from Chicago! Python dev with interest in mathematics, music, robotics and computer vision. I hope my Q&A have been helpful for you. If one of my answers has saved your butt today and you would like a way to say thank you, then feel free to buy me a coffee! :-D [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*

Updated on September 18, 2022

Comments

  • wim
    wim over 1 year

    I have installed the packages texlive and gedit-latex-plugin. I see syntax highlighting for .tex files, but I don't get any extra stuff in my gedit menus or toolbars for latex -> pdf like I expected to see, and there isn't anything resembling a latex plugin there to enable in the edit -> preferences -> plugins dialog. What am I missing?

    enter image description here