Cross-References, Links, and Custom Commands — label, ref, url, newcommand
A complete guide to cross-references and links on Folio. Covers \label/\ref for theorem and equation references, \url/\href for links, \footnote for footnotes, \newcommand for macros, and list environments in detail.
1. Labels and Cross-References
Use \label and \ref to reference elements within an article.
1.1. Referencing Theorem Environments
\begin{theorem}[Intermediate Value Theorem]
\label{thm:ivt}
...
\end{theorem}
By Theorem \ref{thm:ivt}...
1.2. Referencing Equations
Label an equation environment and reference it with \eqref:
\begin{equation}
\label{eq:euler}
e^{i\theta} = \cos\theta + i\sin\theta
\end{equation}
Equation \eqref{eq:euler} is known as Euler's formula.
Result:
Equation (1) is known as Euler's formula. Substituting yields Euler's identity .
1.3. Referencing Figures and Tables
\begin{figure}
\centering
\begin{mermaid}
graph LR
A["label"] --> B["ref"]
A --> C["eqref"]
A --> D["cref"]
\end{mermaid}
\caption{Folio's cross-reference commands}
\label{fig:ref-commands}
\end{figure}
Figure \ref{fig:ref-commands} shows the cross-reference commands.
Result:
graph LR
A["label"] --> B["ref"]
A --> C["eqref"]
A --> D["cref"]Figure 1 shows the cross-reference commands.
1.4. \cref Command
\cref automatically detects the type of referenced element (theorem, equation, figure, etc.) and prepends the name:
\cref{thm:ivt} % → "Theorem 1" etc.
\cref{eq:euler} % → "Equation (1)" etc.
2. Links
2.1. URL Links
\url displays the URL as-is and makes it a hyperlink:
\url{https://interconnectd.app}
Result: https://interconnectd.app
2.2. Text Links
\href customizes the link text:
\href{https://interconnectd.app}{Folio's Website}
Result: Folio's Website
2.3. Inter-Article Links
To link to another Folio article, use the article's URL path:
\href{/articles/articleId}{Article Title}
/articles/ are recognized as internal links and navigate via SPA transitions.
3. Footnotes
Create footnotes with \footnote:
Euler\footnote{Leonhard Euler, 1707--1783} was a Swiss mathematician.
Result: Euler1 was a Swiss mathematician.
Footnotes are automatically numbered and collected at the bottom of the article. Math can be used inside:
The Gaussian integral2 is an important definite integral.
4. Citations
On Folio, register references in the dashboard, and they appear in \cite{} autocomplete across all articles. While BibTeX files are not used, the \cite, \citep, and \citet commands work as expected.
\cite{einstein1905} % → [1] or (Einstein, 1905) etc.
\citep{knuth1997} % → Parenthetical citation
\citet{dijkstra1959} % → Textual citation
Citation style (numeric / author-year / alpha) can be selected in Settings. The reference list is auto-generated at the end of the article.
5. Custom Commands in Detail
On Folio, registering \newcommand and other macro definitions in the Settings preamble editor applies them to all articles automatically. No per-article preamble needed. Of course, commands used only in a specific article can be written directly in that article.
5.1. Basic \newcommand
% No arguments
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\N}{\mathbb{N}}
% One argument
\newcommand{\abs}[1]{\left| #1 \right|}
\newcommand{\norm}[1]{\left\| #1 \right\|}
% Two arguments
\newcommand{\inner}[2]{\left\langle #1, #2 \right\rangle}
\newcommand{\set}[2]{\left\{ #1 \mid #2 \right\}}
After registration, \abs{x} expands to , and \set{x \in \mathbb{R}}{\abs{x} < 1} expands to .
5.2. \DeclareMathOperator
Define standard mathematical function names:
\DeclareMathOperator{\tr}{tr} % Trace
\DeclareMathOperator{\rank}{rank} % Rank
\DeclareMathOperator{\Hom}{Hom} % Homomorphism set
\DeclareMathOperator{\End}{End} % Endomorphisms
\DeclareMathOperator{\Aut}{Aut} % Automorphisms
\DeclareMathOperator{\Im}{Im} % Image
\DeclareMathOperator{\Ker}{Ker} % Kernel
This gives proper roman font: and .
5.3. \def Command
For simple macros, \def also works:
\def\eps{\varepsilon}
After registration, \eps expands to . Example: For any ...
6. List Environments in Detail
6.1. Nested Lists
Lists can be nested:
\begin{enumerate}
\item Group theory fundamentals
\begin{itemize}
\item Group axioms
\item Subgroups
\item Normal subgroups
\end{itemize}
\item Linear algebra fundamentals
\begin{itemize}
\item Vector spaces
\item Linear maps
\item Eigenvalues and eigenvectors
\end{itemize}
\end{enumerate}
Result:
Group theory fundamentals
Group axioms
Subgroups
Normal subgroups
Linear algebra fundamentals
Vector spaces
Linear maps
Eigenvalues and eigenvectors
6.2. description Environment
An environment suited for terminology explanations:
\begin{description}
\item[\texttt{theorem}] An environment for mathematical theorems.
\item[\texttt{definition}] An environment for mathematical definitions.
\item[\texttt{proof}] An environment for proofs.
\end{description}
Result:
theorem- An environment for mathematical theorems. The body is displayed in italic.
definition- An environment for mathematical definitions. The body is displayed in roman.
proof- An environment for proofs. A QED symbol is appended automatically.
7. Alignment and Layout
7.1. centering
\begin{center}
Centered text
\end{center}
7.2. Box Commands
Use \fbox to enclose text in a box:
\fbox{Boxed text}
Result:
Boxed text
8. Summary
In this article, we covered cross-references (\label/\ref), links (\url/\href), footnotes (\footnote), custom commands (\newcommand/\DeclareMathOperator), list environments, and layout commands on Folio.
This concludes the "Folio Basics" series. For a quick-reference overview of all features, see the "Folio LaTeX Reference" article.
Mathematics "between the lines" — exploring the intuition textbooks leave out, written in LaTeX on Folio.