I want to study the source code of article.cls so I can create macros of my own. If anybody can tell me the location of article.cls document class file, that will be highly appreciated.
- 731
2 Answers
The easiest way to find any file in the TeX Distribution (if you know its name) is to use the kpsewhich program.
From the command line type:
kpsewhich article.cls
and it should return:
/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
on a TeX Live system.
Depending on your OS, you may be able to open the file directly. On a Mac, e.g. I can type
open `kpsewhich article.cls`
and the file will open in my normal TeX editor. (The back ticks pass the output of the command within the back ticks to the open command.) The equivalent Linux command is xdg-open I believe. I have no idea if an equivalent command exists in Windows.
- 218,180
-
You could also do
vi \kpsewhich article.cls`` to open it with a great editor. It doesn't really matter with which program you want to open it. – Johannes_B Feb 14 '17 at 06:24 -
3
I have idea where all document class files reside in windows os, if your operating system windows, MikTex Compiler then check here,
C:\Users\Admin\AppData\Local\Programs\MiKTeX\tex\latex\base
Here, you can view all base document classes like
article.cls,article.sty,report.cls,report.sty,letter.cls,letter.sty
Source code will be inside article.cls. article.sty is the latest file format .cls file is loaded actually inside .sty file.
- 101
TEXMF/tex/latex/base/article.cls, whereTEXMFis the root directory of the tex live "library". – barbara beeton Feb 14 '17 at 03:14kpsewhich article.cls, it would give the file path. Possible Duplicate of What is the quickest way to check whether I already have a given package? – texenthusiast Feb 14 '17 at 03:20classes.dtxor perhaps the full typesetsource2e.pdf(texdoc source2e). – Joseph Wright Feb 14 '17 at 07:56articleclass tex always shows the full path to the class every time. – David Carlisle Feb 14 '17 at 09:03