GNOME Bugzilla – Bug 524802
LaTeX files highlighted as Octave instead of LaTeX
Last modified: 2008-11-02 16:20:37 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
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).
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.
It's not really gtksourceview bug, but new GtkSourceView API (to be implemented) should fix it.
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.
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).
Since glib detects it correctly, it should be fixed now that we use gio