After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 524802 - LaTeX files highlighted as Octave instead of LaTeX
LaTeX files highlighted as Octave instead of LaTeX
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-28 14:54 UTC by Pedro Villavicencio
Modified: 2008-11-02 16:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22



Description Pedro Villavicencio 2008-03-28 14:54:29 UTC
This report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/gtksourceview2/+bug/201776

"in gedit all my existent *.tex-files are highlighted by default as "Octave" instead of "LaTeX"."

"I think I just found out what the problem is. In almost every of my .tex files I have a comment on the first lines like

line 1: % Essay by Matthias Metzger
line 2: % Date: 08-03-26
line 3:
line 4: \documentclass[]{}...

When I open these files the syntax isn't highlighted, even when I save them once more.
But when I remove the comment and save them, the syntax is highlighted.
I found two "old" files without comment at the beginning and there the highlighting works perfect."

test file:

http://launchpadlibrarian.net/12895117/test.tex
Comment 1 Yevgen Muntyan 2008-06-18 17:50:00 UTC
It's either gedit bug or gnomevfs', whichever you prefer (I'd blame gnomevfs, it must recognize *.tex files as TeX according to mime spec).
Comment 2 Stéphan Gorget 2008-08-02 14:39:47 UTC
I just want to confirm this bug. I had exactly the same bug with the version 2.22.3 of gedit. And it is related to the fact that the first line is a comment line.

Open a latex file with a comment at the first line it will be recognized as an Octave file. If I remove all the first comment lines and save it, the is automatically recognized as being a LaTeX one and the highlighting is good.
Comment 3 Yevgen Muntyan 2008-08-02 22:07:57 UTC
It's not really gtksourceview bug, but new GtkSourceView API (to be implemented) should fix it.
Comment 4 Yevgen Muntyan 2008-08-03 04:19:48 UTC
Funny thing, I can't reproduce it with glib, it correctly detects file as being text/x-tex. Perhaps xdgmime in glib follows the spec while gnomevfs doesn't or something.
Comment 5 Yevgen Muntyan 2008-08-06 01:03:33 UTC
Sorry for spamming you guys, but gtksourceview did its job, now it's up to gedit (no idea why I am performing this bugzilla acrobatics).
Comment 6 Paolo Borelli 2008-11-02 16:20:37 UTC
Since glib detects it correctly, it should be fixed now that we use gio