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

Package dependencies in style file included by class file not recognized #1053

Closed
mvscheven opened this issue Oct 30, 2019 · 6 comments · Fixed by #1123
Closed

Package dependencies in style file included by class file not recognized #1053

mvscheven opened this issue Oct 30, 2019 · 6 comments · Fixed by #1123
Assignees
Labels
bug Deficiencies in TeXiFy behaviour.
Milestone

Comments

@mvscheven
Copy link

Hello,

in my LaTeX project I am including my own style-files in which all required style-files (e.q. amsmath) are included. For the LaTeX build process this works fine, but in the editor the align environment is marked in red with the remark "Environment requires amsmath package".

This problem appears for packages included in other style-files (nested) or included in the class declaration.

Best regards,
Malte

@PHPirates
Copy link
Collaborator

Can you provide a minimal working example which shows the problem? Because this works for me:

main.tex:

\documentclass{article}
\usepackage{mystyle}
\begin{document}
    \begin{align*}
        \pi
    \end{align*}
\end{document}

mystyle.sty:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PACKAGE_NAME}[2019/10/30 malte's Package]

\RequirePackage{amsmath}

@mvscheven
Copy link
Author

mvscheven commented Oct 31, 2019

I believe there to be similar but different problems:

1. include in custom class file:

main.tex:

\documentclass{class}
\begin{document}
  \begin{align*}
    \pi
  \end{align*}
\end{document}

class.cls:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{class}[2019/10/31]
\LoadClass{article}
\RequirePackage{style}
\endinput

style.sty:

\ProvidesPackage{style}[2019/10/31]
\RequirePackage{amsmath}
\endinput

For the LaTeX build process this works fine, but in the editor the align environment is marked in red with the remark "Environment requires amsmath package".

@mvscheven
Copy link
Author

2. include in custom style file:

main.tex:

\documentclass{article}
\usepackage{style}
\begin{document}
    \begin{align*}
        \pi
    \end{align*}
\end{document}

style.sty:

\ProvidesPackage{style}[2019/10/31]
\RequirePackage{amsmath}
\endinput

As you state this works fine, but only if the custom style file is in the project directory! If the custom style file "style.sty" is in a different directory in the TEXINPUTS path, the nested include is not recognised.

Best regards,
Malte

@PHPirates
Copy link
Collaborator

  1. Thanks for the example, indeed that's a bug.
  2. Ah, but then it's like a package you install from ctan, and those ones we do not index at the moment (it would take way too much time at least). That's for further in the future.

@PHPirates PHPirates added the bug Deficiencies in TeXiFy behaviour. label Oct 31, 2019
@PHPirates PHPirates changed the title Nested Style-files Package dependencies in style file included by class file not recognized Oct 31, 2019
@mvscheven
Copy link
Author

ad 2: It is similar. Packages from ctan installed by MikTex, TexLive,... are in a system directory. The paths in TEXINPUTS only contain additional directories and in many cases only a very limited number of style files.

@PHPirates
Copy link
Collaborator

PHPirates commented Oct 31, 2019

and in many cases only a very limited number of style files.

Good point, had not realised that. Will think about it, if it's easy to add.

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

Successfully merging a pull request may close this issue.

2 participants