Here, you can find all code examples from the second edition of the LaTeX Cookbook. The code for the second edition is at latex-cookbook.net/first-edition.
Click a chapter title to open the page with all chapter examples. Some examples have their own page for the gallery and are also clickable.
1. Exploring Various Document Classes
- Writing a short text
- Developing a thesis
- Designing a book
- Creating a presentation
- Designing a curriculum vitae
- Writing a letter
- Producing a leaflet
- Building a large poster
2. Tuning the Text
- Improving justification and hyphenation
- Adding margin notes
- Putting text into a colorful box
- Converting numbers to words
- Visualizing the layout
- Visualizing boxes of letters and symbols
- Typesetting in a grid
- Absolute positioning of text
- Adding drop caps
- Fitting text to a shape
- Creating a pull quote
3. Adjusting Fonts
- Using standard font commands
- Choosing a document font
- Locally switching to a different font
- Printing font tables
- Importing just a single symbol of a font
- Writing bold mathematical symbols
- Getting sans-serif mathematics
- Writing double-stroke letters like on a blackboard
- Enabling the searching and copying of ligatures
- Suppressing ligatures
- Adding a contour
4. Creating Tables
- Designing a legible table
- Positioning tables
- Merging cells
- Splitting a cell diagonally
- Adding footnotes to a table
- Aligning numeric data
- Coloring a table
- Importing data from an external file
5. Working With Images
- Including images with optimal quality
- Customizing images
- Adding a frame to an image
- Cutting an image to get rounded corners
- Shaping an image like a circle
- Drawing over an image
- Aligning images
- Arranging images in a grid
- Stacking images
6. Creating Graphics
(click for full sample chapter)
- Building smart diagrams
- Constructing a flowchart
- Growing a tree
- Building a bar chart
- Drawing a pie chart
- Drawing a Venn diagram
- Putting thoughts into a mind map
- Generating a timeline
7. Creating Beautiful Designs
- Adding a background image
- Creating beautiful ornaments
- Preparing pretty headings
- Printing a calendar
- Mimicking keys and menu items
- Arranging topics like a puzzle
- Building a word cloud
8. Contents, Lists and Bibliographies
- Tuning table of contents, lists of figures and tables
- Creating a bibliography
- Adding a glossary
- Creating a list of acronyms
- Producing an index
9. Optimizing PDF Files
- Using hyperlinks
- Adding metadata
- Including copyright information
- Inserting comments
- Producing fillable forms
- Optimizing the output for ebook readers
- Removing white margins
- Combining PDF files
- Creating an animation
10. Advanced Mathematics
- Quick-start for beginners
- Fine-tuning a formula
- Automatic line-breaking in equations
- Highlighting in a formula
- Writing theorems and definitions
- Drawing a commutative diagram
- Plotting functions in two dimensions
- Plotting in three dimensions
- Drawing geometry pictures
- Doing calculations
11. Science and Technology
- Typesetting an algorithm
- Printing a code listing
- Programming with Lua
- Creating graphs
- Writing quantities with units
- Drawing Feynman diagrams
- Writing chemical formulas
- Drawing molecules
- Representing atoms
- Drawing molecular orbital diagrams and atomic orbitals
- Printing a customized periodic table of elements
- Constructing electrical circuits
12. Getting Support on the Internet
- Exploring available LaTeX resourceson the web
- Utilizing web forums effectively
- Crafting high-quality questions
- Creating minimal working examples
13. Using Artificial Intelligence with LaTeX
- Getting started with ChatGPT
- Getting answers to LaTeX questions
- Improving your content
- Generating code