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

File 'article.cls' not found when using PyCharm on a Mac #1785

Closed
konstantinmiller opened this issue Feb 24, 2021 · 6 comments · Fixed by #1791
Closed

File 'article.cls' not found when using PyCharm on a Mac #1785

konstantinmiller opened this issue Feb 24, 2021 · 6 comments · Fixed by #1791
Assignees
Labels
bug Deficiencies in TeXiFy behaviour. macOS Issues specific to macOS (@cl445 or @efrancis may be able to help)
Milestone

Comments

@konstantinmiller
Copy link

Hello there,

Thank you for creating the plugin! I love it that I can write LaTeX documents right inside PyCharm!

I'm using PyCharm Pro 2020.3, and TeXiFy 0.7.3. I'm on a Mac, using BasicTeX.

I'm getting an error from the inspection. It underlines article in \documentclass[11pt]{report} stating that article.cls cannot be found. However, if I use pdflatex from BasicTeX to compile the file, it works just fine, and the pdf file is created correctly. Is that a bug or am I missing some configuration that I need to do?

@konstantinmiller konstantinmiller added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Feb 24, 2021
@PHPirates
Copy link
Collaborator

Assuming that kpsewhich article.sty returns a valid path (please check), I think this is a known problem, which only occurs when using PyCharm on a Mac.
Did you have to provide the path to pdflatex manually in the run configuration? I assume you did. It's because TeXiFy can somehow not run just any command. I have no idea why, and there's no TeXiFy developer with a Mac so I can't really help you there.

We can of course implement a workaround for PyCharm, perhaps a simplified version of the SDK system we use in IntelliJ. Basically it allows you to provide the path to BasicTeX, and then TeXiFy figures out the rest.

I think BasicTeX is just a fancy name for a small TeX Live installation, so if you have IntelliJ you would select a TeX Live SDK when creating a new project. Can you provide the output of which pdflatex and which kpsewhich?

@PHPirates PHPirates changed the title File 'article.cls' not found File 'article.cls' not found when using PyCharm on a Mac Feb 24, 2021
@PHPirates PHPirates added macOS Issues specific to macOS (@cl445 or @efrancis may be able to help) and removed untriaged Issue type still needs to be triaged or verified. labels Feb 24, 2021
@HannahSchellekens
Copy link
Member

HannahSchellekens commented Feb 24, 2021

I had a (maybe?) similar issue last week with \LoadClass{article}, see TEX-109. Don't know if it's related. It is on windows...

Edit: 109 not 108

@konstantinmiller
Copy link
Author

which pdflatex gives /Library/TeX/texbin/pdflatex
which kpsewhich gives /Library/TeX/texbin/kpsewhich
kpsewhich article.sty gives /usr/local/texlive/2020basic/texmf-dist/tex/latex/base/article.sty which is a valid path

Yes, I specified the path to pdflatex manually in the run configuration.

Yes, exactly, BasicTeX is a smaller version of MacTeX. I don't have "TeX Live SDK" as an option when I create a new project.

Would that solve the problem if I installed MacTeX instead of BasicTeX?

@PHPirates
Copy link
Collaborator

PHPirates commented Feb 25, 2021

  • Thanks for the paths, will add them to the default 'paths to try'.

I don't have "TeX Live SDK" as an option when I create a new project.

In IntelliJ, with TeXiFy 0.7.3? Should look something like this:
image
(though on Mac I guess it can't suggest SDKs and you need to add it manually).

Would that solve the problem if I installed MacTeX instead of BasicTeX?

No, distribution doesn't matter.

Anyway, I was thinking of the following possible fix for PyCharm, as I'm not going to implement a full SDK settings UI as we have for IntelliJ:

  • I can implement something which guesses the path to kpsewhich based on the path in the run config which points to pdflatex, hoping that the executables are in the same folder.

@mgroth0
Copy link

mgroth0 commented Mar 18, 2021

Hi, I found this issue because I have probably the same exact problem. I'm trying to use TeXiFy on Mac with Intellij.
which pdflatex = /Library/TeX/texbin/pdflatex
which kpsewhich = /Library/TeX/texbin/kpsewhich
kpsewhich article.sty = /usr/local/texlive/2020/texmf-dist/tex/latex/base/article.sty

Screen Shot 2021-03-18 at 12 29 58 PM

The only problem here seems to be article.cls not being found.

I've also tried adding a TeXLive SDK at /usr/local/texlive/2020. I then added the folder containing this TeX file as a TeX module. This did not fix the issue.

@PHPirates
Copy link
Collaborator

PHPirates commented Mar 18, 2021

[Moved comment to #1815]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour. macOS Issues specific to macOS (@cl445 or @efrancis may be able to help)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants