What can LaTeX do without loading packages?

Here some examples:

\documentclass{book}

\begin{document}
\tableofcontents
\listoftables
\listoffigures

\chapter{What we can do without packages}
\section{With \texttt{book} we can create table of contents \& Co.}
Taking advantange only of what is defined in a \texttt{documentclass}, for 
example, \texttt{book}, we can produce a table of contents, a list of tables,
and a list of figures. 

\section{We can write formulae}
But with \texttt{amsmath} or \texttt{mathtool} it is easy to make them 
beautiful.
\[
E = mc^{2}
\]

\section{We can list something}
We can create bullet list:
\begin{itemize}
\item Something about ducks
\item Something about lions
\end{itemize}
Enumerated list:
\begin{enumerate}
\item Something about ducks
\item Something about lions
\end{enumerate}
Descriptive list:
\begin{description}
\item [Ducks] very funny birds
\item [Lions] very funny animals, too!
\end{description}
But with \texttt{enumitem} you can easily customize them.

\section{We can create tables}
We can create Table~\ref{tab:mytab}, but with \texttt{booktabs} it'd look 
more beautiful and  professional, and with \texttt{caption} we can easily
costomize its caption and improve its position.
\begin{table}
\centering
\caption{A table\label{tab:mytab}}
\begin{tabular}{cc}
\hline
Ducks & Lions \\
\hline
Lions & Ducks \\
\hline
\end{tabular}
\end{table}

\section{We can draw images}
We can draw a duck, see Figure~\ref{fig:duck}, but with Ti\emph{k}Z or 
\texttt{pstricks} it is easier. 
\begin{figure}
    \centering
    \begin{picture}(100,100)
    \put(50,50){\oval(50,20){}}
    \put(70,65){\circle{20}}
    \put(35,50){\line(1,0){30}}
    \put(70,65){\circle*{2}}
    \put(75,67){\line(6,-1){10}}
    \put(75,63){\line(6,1){10}}
    \end{picture}
    \caption{Duck by David Carlisle\label{fig:duck}}
\end{figure}

\chapter{What we cannot do without packages}
Virtually, you can do everything without packages,
they only simplify your life!

But why do you want to redo what others have already done for you?
\end{document}

enter image description here enter image description here enter image description here enter image description here enter image description here


As mentioned in the comments you don't need to load the code of a package with \usepackage. You can copy it to your preamble:

\documentclass{article}
\makeatletter
... lots of code lines from various packages
\maketother
\begin{document}

But imho this doesn't really answer your question. You probably want to know if you really need this additional code lines.

The LaTeX kernel is a kernel, it is like the operating system on your PC. So it doesn't contain code for everything. Due to historical reasons quite a number of things that should be in the kernel are currently in external packages e.g. color support, graphics, language support, support for input encodings, amsmath code, keyval, basic drawing commands -- hopefully they will wander in the kernel in future version.

But for special things you always will have to load external code (and the class you are loading with \documentclass is already such an external code), e.g. if you want to draw a duck sitting on chessboard:

\documentclass{article}%
\usepackage{tikzducks}
\usepackage{xskak}

\begin{document}

\begin{tikzpicture}
\newchessgame
\node at (1,1) {\chessboard[showmover=false]};
\duck
\end{tikzpicture}
\end{document}

enter image description here


Answering your second question actually also answers your first:

Additionally, could you give me an example of a task that LaTeX cannot do unless a package is loaded?

There is literally nothing that requires a package. Packages are simply code loaded into LaTeX, the same code would do the same thing if you simply inserted it at the start of your source. If you were familiar enough with LaTeX you could write everything yourself by hand; it'd just take a very long time! What packages do is provide you with easy interfaces that enable you to leverage other peoples' time and skill to make your document look better. They're not new functionality; they are existing functionality packaged to be more usable.

(Aside: there is a slight exception to this, in the existence of packages like glossaries which also include an external tool which must be run as well as LaTeX but I would argue that the external part of these tools is not itself a LaTeX package since it must be separately invoked).

So, given that everything packages do, you can do without packages, you can see that the answer to your first question is: everything, it's just much harder that way.

Tags:

Packages