Examples — Popular

Examples of powerful LaTeX packages and techniques in use — a great way to learn LaTeX by example. Search or browse below.

Source Code Highlighting with Minted in LaTeX
Source Code Highlighting with Minted in LaTeX
The minted package provides automatic syntax highlighting for source code listings. It uses the excellent pygments highlighter, which provides very high quality highlighting for a wide range of languages. This example also shows how you can use minted to typeset LaTeX math embedded in your source code.
writeLaTeX
Using an image as a document header
Using an image as a document header
Using an image as a document header
Drawing coloured boxes using tcolorbox
Drawing coloured boxes using tcolorbox
The pack­age pro­vides an en­vi­ron­ment for coloured and framed text boxes with a head­ing line. Op­tion­ally, such a box may be split in an up­per and a lower part; thus the pack­age may be used for the set­ting of LaTeX ex­am­ples where one part of the box dis­plays the source code and the other part shows the out­put. Another com­mon use case is the set­ting of the­o­rems. The pack­age sup­ports sav­ing and reuse of source code and text parts.
Thomas F. Sturm (uploaded by LianTze Lim)
Table cells with diagonal lines
Table cells with diagonal lines
This example demonstrates how to produce diagonal lines in table cells using the slashbox and diagbox packages. The diagonal line produced by the slashbox package is rather jagged and unwieldy. The diagbox package does a better job in general. Try loading only one of these packages to see the difference — if diagbox is loaded at all, it overrides slashbox's behavior./p>
LianTze Lim (using sample text from slashbox.tex)
Package Example: apacite
Package Example: apacite
This example shows how to load and use the apacite package. The apacite package uses LaTeX and BibTeX to generate citations and a reference list, formatted according to the rules of the American Psychological Association.
Overleaf
Endnotes using pagenote package at the end of each chapter
Endnotes using pagenote package at the end of each chapter
An example of creating end notes at the end of each chapter of a book, using the pagenote package.
LianTze Lim
algorithmicx (algpseudocode) example
algorithmicx (algpseudocode) example
An example using the predefined algpseudocode command set from the algorithmicx package, for typesetting pseudocode or algorithms.
LianTze Lim
AlgThink_LaTeX_Test_1
AlgThink_LaTeX_Test_1
Test LaTeX file for the Rice University / Coursera Algorithmic Thinking (Part 1).
Bob R
Bibliographies with biber and biblatex
Bibliographies with biber and biblatex
How to use biblatex with bibier and hyperref package.
Frank the Bunny