Comment 13 for bug 957924

Revision history for this message
androith (androith) wrote :

I found this bug "upstream" in gnome's bugzilla (https://bugzilla.gnome.org/show_bug.cgi?id=676570), and here is a solution.

The crash is connected to the file ~/.config/gedit/latex/tools.xml. If you remove this file, Latex plugin loads correctly and doesn't crash when you enter preferences. However, that file is where you store custom compilation commands!

1. Copy the default tools.xml over the local one:
cp /usr/share/gedit/plugins/latex/tools.xml ~/.config/gedit/latex/tools.xml

2. Edit ~/.config/gedit/latex/tools.xml and remove the arrow characters.
(I replaced all "->" characters with the word "to" so that "TEX -> PDF" now reads "TEX to PDF" . The bug comments at gnome's tracker seem to suggest this is a problem.)

3. Edit the same file (~/.config/gedit/latex/tools.xml) and change the compilation command to what you want.

Please note that if you have an error in that file, the crash will still occur. (For example, choosing ASFASF as the postProcessor for something will still crash the application.)

Here's my file which works (synctex, pdflatex and errors are nice):
$ cat ~/.config/gedit/latex/tools.xml
<tools>
  <tool description="Create a PDF from LaTeX source" extensions=".tex" id="1" label="LaTeX to PDF">
    <job mustSucceed="True" postProcessor="GenericPostProcessor">pdflatex -synctex=1 "$filename"</job>
    <job mustSucceed="True" postProcessor="GenericPostProcessor">gvfs-open "$shortname.pdf"</job>
  </tool>
  <tool description="Create a PostScript from LaTeX source" extensions=".tex" id="3" label="LaTeX to PS">
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --ps "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.ps"</job>
  </tool>
  <tool description="Create a DVI from LaTeX source" extensions=".tex" id="4" label="LaTeX to DVI">
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.dvi"</job>
  </tool>
  <tool description="Create a DVI with source specials from LaTeX source" extensions=".tex" id="5" label="LaTeX to DVI (Source Specials)">
    <job mustSucceed="true" postProcessor="LaTeXPostProcessor">latex -interaction batchmode -src "$filename"</job>
    <job mustSucceed="true" postProcessor="LaTeXPostProcessor">latex -interaction batchmode -src "$filename"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">xdvi -unique -s 6 -bg white -editor gedit "$shortname.dvi"</job>
  </tool>
  <tool description="Process R Sweave file and create a PDF from the resulting LaTeX source" extensions=".Rnw" id="6" label="R Sweave to PDF">
    <job mustSucceed="true" postProcessor="GenericPostProcessor">R CMD Sweave "$shortname.Rnw"</job>
    <job mustSucceed="true" postProcessor="RubberPostProcessor">rubber --inplace --maxerr -1 --short --force --warn all --pdf "$shortname.tex"</job>
    <job mustSucceed="true" postProcessor="GenericPostProcessor">gvfs-open "$shortname.pdf"</job>
  </tool>
  <tool description="Remove LaTeX build files" extensions=".tex" id="7" label="Cleanup LaTeX Build Files">
    <job mustSucceed="False" postProcessor="GenericPostProcessor">rm -f "$directory"/*.aux "$directory"/*.log "$directory"/*.toc "$directory"/*.bbl "$directory"/*.blg</job>
  </tool>
  <tool description="Convert BibTeX to XML" extensions=".bib" id="8" label="BibTeX to XML">
    <job mustSucceed="true" postProcessor="GenericPostProcessor">bibtex2xml "$filename"</job>
  </tool>
</tools>