1. 5 Cups of Ubuntu
Join Date
Nov 2007
Location
Greece
Beans
25
Distro
Ubuntu Development Release

## Gedit LaTeX

I want to make the transition and use gedit as my main latex editor, but I am having a problem that prevents me from doing it.

I am using the Cobalt theme in gedit

when I use the "\label" command, the background color changes (not only in cobalt, it changes in all themes) to FFFFCF thus rendering the text unreadable (FFFFFF)

I tried editing the cobalt.xml GtkSourceView but found no style utilizing the FFFFCF color code. Further googling revealed that the FFFFCF code is used in the "warning-background-color" parameter. Is there a workaround to fix this issue without having to recompile gedit from source?

I find it strange that noone has ever had the same error that I have encountered.

2. 5 Cups of Ubuntu
Join Date
Nov 2007
Location
Greece
Beans
25
Distro
Ubuntu Development Release

## Re: Gedit LaTeX

Found the solution after a bit of more searching!

sudo gedit /usr/share/glib-2.0/schemas/org.gnome.gedit.plugins.latex.gschema.xml

then find the warning-background-color and change the color to your liking

3. 5 Cups of Ubuntu
Join Date
Nov 2007
Location
Greece
Beans
25
Distro
Ubuntu Development Release

## Re: Gedit LaTeX

Correction:
This solution appeared to work fine until I turned on the Latex Plugin in gedit.
Now the background changes to ffffcf in \label and changes back when I turn off the plugin.
Very frustrating bug...
I searched the .py files in /usr/share/gedit/plugins/latex and /usr/lib/gedit/plugins/latex and found no mention of ffffcf so it must be somewhere else...
Any suggestions?

4. ## Re: Gedit LaTeX

Originally Posted by eloydark
Correction:
This solution appeared to work fine until I turned on the Latex Plugin in gedit.
Now the background changes to ffffcf in \label and changes back when I turn off the plugin.
Very frustrating bug...
I searched the .py files in /usr/share/gedit/plugins/latex and /usr/lib/gedit/plugins/latex and found no mention of ffffcf so it must be somewhere else...
Any suggestions?
I'm trying the same thing. This can be changed on the file

Code:
/usr/lib/gedit/plugins/latex/latex/editor.py
Somewhere there is the lines

Code:
        self.register_marker_type("latex-error", self._preferences.get("error-background-color"))
self.register_marker_type("latex-warning", self._preferences.get("warning-background-color"))
the part
Code:
self._preferences.get("warning-background-color")
specifies the color to use.

But I think there's a deeper issue here. Why is it marking the labels and refs as warnings? Is it warning us for some bad LaTeX practice or is it parsing something badly and thinks we are doing something wrong?

5. ## Re: Gedit LaTeX

I have opened 2 bug reports against the plugin:

To solve your problem, I'd recommend to do what I suggested on the first bug report, to comment line 89 of the latex/latex/validator.py which goes like:

Code:
issue_handler.issue(Issue("Label <b>%s</b> is never used" % escape(label.value), label.start, label.end, label.file, Issue.SEVERITY_WARNING))
This line says that non referenced labels should be highlighted as warnings. I disagree (specially because I reference them on unusual ways) and don't think it should so I just commented the line. Works fine now