1

What is the proper way to set document class by providing the path to the custom class file? Something like this:

\documentclass{../myclass/myclass}

This kind of works but I'm getting an error that my myclass.cls is not exporting ../myclass/myclass but myclass.

I'm working on three projects for which I need a custom class and I want them to share it as well. I'm also working on that custom class and am changing it so I want it to be in the same directory as those three projects.

Here's my dir structure:

Main Project Folder

+ MyClass
-- myclass.cls
+ Project 01
-+ Code
-+ Images
-- Project 01.tex
-- ...
+ Project 02
--+ Code
--+ Images
-- Project 01.tex
-- ...
+ Project 03
--+ Code
--+ Images
-- Project 01.tex
-- ...
11
  • 3
    you should just use \documentclass{myclass} the argument is a name not a file path, then arrange that the class file is in the input path. Apr 1, 2020 at 21:07
  • @DG' no. This is how to add new include path for LaTex machinery, instead of how to specify a document class by path file. Also, answer is 8 years old, and I've seen one 9 yr old answer which is related to my question, but I'd expect there has been some progress in such a long time. When I move my project directory to a different location I don't want to think about changing all the paths etc...
    – Maštarija
    Apr 1, 2020 at 22:00
  • @DavidCarlisle I want to do it without modifying input path. If I want to share this with someone, I want them to be able to just open the tex file in my project and be able to build a PDF out of it without some ceremony and extra steps (assuming they have LaTex already on their system).
    – Maštarija
    Apr 1, 2020 at 22:02
  • 2
    why is that impractical? it works for millions of other users. The warning is there explicitly to discourage having paths in the document so that documents are portable, It is an intentionally added feature not a problem to be solved. Apr 1, 2020 at 22:14
  • 2
    the other way of course is to declare the name of the class to be ../MyClass/myclass in the \ProvidesClass declaration, then the names will match and the warning will go. Apr 1, 2020 at 22:17

0

Browse other questions tagged .