Document Structure
Another huge step to make your work more organized and professional!
Last updated
Another huge step to make your work more organized and professional!
Last updated
supports the creation of a document structure and also enables customization of sectioning and numbering. In , there are 7 levels of depth for defining sections depending on the document class:
-1
\part
0
\chapter
1
\section
2
\subsection
3
\subsubsection
4
\paragraph
5
\subparagraph
To create the table of contents , use the command \tableofcontents
. Sections, subsections and chapters are included in the table of contents. By default, it will look like this:
However, if you want to change the title from "Contents" to something you prefer, you can use \renewcommand*\contentsname{Something you like}
.
Some noteworthy commands:
\label{something}
- label your element
\ref{something}
- refer your element, it should print the numerical order of your element, also add a hyperlink to it.
\pageref{something}
- refer to the page number where your element is placed.
The label is set once you've put \label
after \section
.
To refer equation, your equation must be placed in equation
environment, and have \label
command.
When writing a document that contains some field-specific concepts it might be convenient to add a glossary. A glossary is a list of terms in a particular domain of knowledge with definitions for those terms.
Let's start with an example to explain how glossary works:
In order to make glossary, you need a package called glossaries
, let's jump to the code:
\makeglossaries
- instantiate the package - must be placed in the preamble
\newglossaryentry{x}
- create a glossary entry, with x
being the name that can be referenced later using \gls
. It takes 2 parameter, name
and description
.
\printglossaries
, render the list of words and definitions typed in each entry, with the title "Glossary". This command can be placed at any place in the document.
A list of abbreviations and symbols is common in many scientific documents. These types of lists can be created with by means on the nomencl
package.
Let's look at an example:
and how it's displayed:
As in the example, here is some important command to create a nomenclature:
\makenomenclature
- put in the preamble to instantiate the package
\nomenclature{}{}
- Used to define the nomenclature entries themselves. Takes two arguments, the symbol and the corresponding description.
\printnomenclatures
- print the nomenclature itself
When importing the nomencl
package, there are a few options we can use:
intoc
- include the nomenclature in table of contents
language
- as far as I concern, vietnamese
is not supported
If you want to change the default title "Nomenclature", you can use this command:
\renewcommand{\nomname}{List of Symbols}
provides a simple yet powerful way to include hyperlinks in your documents, allowing you to seamlessly navigate between different sections, external websites, or even specific locations within your document.
By importing hyperref
, the first thing you notice is that all cross-referenced elements now become hyperlinks.
In order to create hyperlinks leading to the Internet, you can use the following syntax: \url{https://example.com}
or \href{https://example.com}{A webpage}
Previously, you have known that all cross-referenced elements become links once hyperref
is imported, so we can use \label
anywhere in the document and refer later those labels to create links. However, hyperref
has 2 commands to create user-defined links - which is better than using \label
:
\hyperlink{thesentence}{any sentence}
- This command prints the text "any sentence" as a clickable element that redirects to the element whose identifier is "thesentence".
\hypertarget{thesentence}{this sentence}
- Create an identifier for your element. The first parameter is the name of the identifier, in this case thesentence
, the second parameter is the text you want to print.
Let's take a look at this example:
In this case, when you click on "any sentence", the document will bring you to the sentence "For instance this sentence".
In previous examples, I have made all hyperlinks blue as it enhances visibility and attracts attention. This is the syntax for doing it:
\hypersetup{ ... }
- This will set the options to configure the behaviour of the links within the document. Every parameter must be comma-separated and the syntax must be in the format parameter=value.
colorlinks=true
- Links will be coloured, the default colour is red.
linkcolor=blue
- Internal links, those generated by cross-referenced elements, are displayed in blue.
urlcolor=cyan
- Links to web sites are set to cyan colour.
urlstyle{same}
- Default settings print links in mono-style spaced fonts, this command changes that and displays the links in the same style as the rest of the text.
Below is some PDF-specific options:
pdftitle={Titlehere}
- Is the title of the PDF output file, to be displayed in the title bar of the window.
pdfpagemode=FullScreen
- The document will be displayed in fullscreen mode (not sure if this works)
If you'd like to delve deeper into the topic, feel free to explore the following links for additional information:
For cross-referencing figures and pictures, please check .
hyperref
should be imported last in your preamble. Check for reference.