0

I start with a fresh installation of Ubuntu 22. I installed pdflatex from the command line.

Compiling this code

\documentclass{standalone}
\begin{document}
Test
\end{document}

produces the error:

pdflatex test.tex 
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2022/dev/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-21>

! LaTeX Error: File `standalone.cls' not found.

Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: cls)

What is wrong and how to fix?

Viesturs
  • 7,895
  • What did you use for installing pdflatex? From the error and your description it feels like you just have the binary for PDFLaTeX and don't have any other files which are required for LaTeX. – Niranjan May 26 '23 at 13:32
  • 2
    E.g., if you install LaTeX by issuing sudo apt-get install texlive-full, it will install binaries+package files+documentations etc.. Without knowing the command that you have used for installation it would be difficult to predict what you currently have and what you don't have. – Niranjan May 26 '23 at 13:35
  • @Niranjan sudo apt-get install texlive-full worked so it could be a concise answer. I can't remember the command I ran originally. The original command was suggested on the command line. – Viesturs May 26 '23 at 14:22
  • @Viesturs Ah, I am glad that it worked for you! – Niranjan May 26 '23 at 14:26

1 Answers1

2

LaTeX works with binaries as well as a huge set of package and class files. So it can be thought of as a bundle. Installing a binary file like pdflatex without installing the other parts of the bundle is barely of any use in most of the contexts. Hence, one way to get a useful installation (on the operating system specified by the OP) is to use the following command on a bash terminal.

sudo apt-get install texlive-full
Niranjan
  • 3,435