Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX source is not being highlighted #199

Open
3 tasks done
dionyziz opened this issue Oct 15, 2018 · 7 comments
Open
3 tasks done

LaTeX source is not being highlighted #199

dionyziz opened this issue Oct 15, 2018 · 7 comments

Comments

@dionyziz
Copy link

dionyziz commented Oct 15, 2018

Prerequisites

  • Put an X in this box if you have done the following:
    • Ensured the issue has not already been raised
    • Ensured the issue is caused by this package

I ensured that the issue is caused by this package because I disabled all other non-core packages.

Description

Steps to reproduce & Minimum working example

  1. Open a LaTeX file
  2. Look at the source code

Example minimal LaTeX:

\ref{alg}

And really any other LaTeX source.

Expected behaviour

The LaTeX source code should be highlighted.

Actual behaviour

The LaTeX source code is not highlighted.

Additional information

I don't have any configuration pertaining to language-latex. Not sure what is causing this. This is on Atom 1.28.2 x64 on Ubuntu with language-latex 1.2.0.

@luisjira
Copy link

I am experiencing the same behaviour on Atom 1.24.0 x64 on Ubuntu with language-latex 1.2.0

@Aerijo
Copy link
Collaborator

Aerijo commented Oct 25, 2018

@dionyziz @hotfx

  • In the bottom right area of the status bar, what is the declared language? (It should say LaTeX, but I'm expecting it to say Plain Text if the text looks blank)

  • Can you select LaTeX in the grammar selection menu (Grammar selector: show in command palette)?

  • If you open dev tools (Window: Toggle dev tools in command palette), what does running the following return?

atom.packages.getActivePackage('language-latex')

@luisjira
Copy link

luisjira commented Oct 25, 2018

Thanks, the Grammar selector did the trick for me.

Running the command outputs a package.

@Aerijo
Copy link
Collaborator

Aerijo commented Oct 25, 2018

@hotfx Ahh, no, that was just to see if it was being loaded (if it wasn't, it would have returned undefined).

As for the cause, I'm not sure. It could be some faulty cache somewhere.

  • Does it happen to all .tex files, or just a particular group?
  • If you make a new one called foo.tex and save it, is it applied?
  • When you override with the grammar selector, does closing the file and opening it again work as it should?

Also try restarting Atom. Sometimes that can fix weird bugs. There's also a "nuclear option" to open Atom using atom --clear-window-state, but be careful because this will wipe all unsaved changes. I don't know if it will fix it, but it might.

@luisjira
Copy link

luisjira commented Oct 25, 2018

  • After setting it with the grammar selector it works with foo.tex as well.
  • Opening and closing works as expected after the override

I definitely tried restarting Atom before I knew about the grammar selector and it did not work then.

After reinstalling the language-latex package, the error occurred again and was fixed by running atom --clear-window-state

@dionyziz
Copy link
Author

  • The bottom right area says "Plain text"
  • It happens to all the files I have tried, across 3 different projects that I tested
  • Selecting the LaTeX grammar or changing the bottom right declared language to LaTeX fixes the highlighting issue. However, I have to do this manually every time I open a new file.
  • If I close and reopen a file for which I've changed the grammar to LaTeX, it remains highlighted correctly.
  • Running atom.packages.getActivePackage('language-latex') returns the package.
  • Making a new file applies the LaTeX language and highlights correctly.

@dionyziz
Copy link
Author

atom --clear-window-state fixed the issue. Do you know why it appeared? Can we prevent it from appearing again in the future to other users?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants