Latex

Cross-referencing between different files with LaTeX

Sometimes I want to refer labels I placed in external .tex files. I mean, I want o refer (using the command \ref) a \label from a .tex file I created in another project. A valid solution it to use the command \include. But I in this case I don’t want to include the .tex, I only want to be able to refer their labels. This can be done using the xr package.

Change the title of Table of Contents (ToC) in LaTeX

The steps to change the title of the table of contents (ToC) depends on if you are using the babel package or not. Without babel The title of the table of contents can be changed using the command \contentsname. Let’s see a small example: \documentclass{article} \renewcommand{\contentsname}{Index} % ToC will show "Index" instead of "Content" \begin{document} \tableofcontents \section{Section} \subsection{Subsection} \end{document} With babel When using babel package the name of the table of contents needs to be changed for the particular language used with babel.

How to add a PDF in a LaTeX document

First, we update the preamble of our LaTeX document by adding pdfpages reference: \usepackage{pdfpages} The package includes the command \includepdf that is used to include a PDF file in the current .tex file: \includepdf[pages=-]{myfile.pdf} As can be seen I’m using the option pages. By default includepdf only inserts the first page of the PDF document. By setting adding the option pages=- we ask to include all the pages of the document.