I would like to use a class that belongs not found in my MiKTeX database. I know I might as well pick up this class and put it in some directory inside the base and update MiKTeX, but I do not want to do that. What I want is to organize it into a subdirectory within the same directory as my main tex file. However, when compiling the tex file, the class is not found. Of course, if I put the direct class in the same directory as the main file I will solve the problem, but that's not what I want. So, I ask: Is there any way to tell the compiler, inside the main file body, how to find the class?
Note: I'm using MiKTeX as an example, but I'm really having the problem in overleaf. There was a revtex upgrade from version 4.1 to 4.2. However, overleaf does not find revtex4-2.cls, which is, in fact, the class I'd like to use.
Below, I show an example of how I would like to organize the files. Note that the class is in a subdirectory.



\documentclass, for example\documentclass{mysubdirectory/myclass}or going to the parent directory\documentclass{../myclass}. You can also use the full path as in\documentclass{/home/you/some/further/directory/myclass}. Is that what you mean, or do you have a different issue? – Marijn May 24 '19 at 12:48\input@pathbefore the\documentclassbut not normally recommended) – David Carlisle May 24 '19 at 12:53.clsfile (only that file, the other files are not needed) to your main folder, but if that is not what you want then\documentclass{revtex4-2/source/revtex4-2}should work from yourmain.texfile. Maybe on Overleaf it works differently, there could be access restrictions in place or something - you could try to click on the specified the file location correctly link to see if there is some more information, or ask the Overleaf support staff. – Marijn May 24 '19 at 14:05