Here you can find all code examples from the first edition of the LaTeX Cookbook. The code for the second edition is at latex-cookbook.net/second-edition.
Click a section to open the example, click a chapter heading to see all examples of that chapter.
1. The Variety of Document Types
- Writing a short text
- Writing a thesis
- Designing a book
- Creating a presentation
- Designing a curriculum vitae
- Writing a letter
- Building a large poster
2. Tuning the Text
- Easier input of accented characters and Unicode symbols
- Improving justification and hyphenation
- Starting a paragraph with an over-sized letter
- Converting numbers to words
- Putting text into a colorful box
- Visualizing the layout
- Visualizing boxes of letters and symbols
- Typesetting in a grid
- Absolute positioning of text
- Fitting text to a shape
- Creating a pull quote
3. Adjusting Fonts
- Choosing a document font
- Locally switching to a different font
- 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 searching and copying of ligatures
- Suppressing ligatures
- Adding a contour
4. Working With Images
- Including images with optimal quality
- Aligning images
- Adding a frame to an image
- Cutting an image to get rounded corners
- Shaping an image like a circle
- Drawing over an image
- Arranging images in a grid
5. Beautiful Designs
- Adding a background image
- Beautiful ornaments
- Pretty headings
- Printing a calendar
- Mimicking keys and menu items
6. Designing Tables
- Creating a legible table
- Merging cells
- Splitting a cell diagonally
- Adding footnotes to a table
- Aligning numeric data
- Coloring a table
- Adding shape, shading and transparency
- Reading in data from an external file
7. Contents, Lists and Bibliographies
- Tuning table of contents, lists of figures and tables
- Creating a bibliography
- Adding a glossary
- Creating a list of acronyms
- Generating an index
8. Getting the Most out of the PDF
- Adding hyperlinks
- Adding metadata
- Adding copyright information
- Inserting comments
- Producing fillable forms
- Optimizing the output for ebook readers
- Removing white margins
- Combining PDF files
9. 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
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 code listings
- Application in graph theory
- Using scientific units
- Writing chemical formulae
- Drawing molecules
- Constructing electrical circuits
12. Getting Support on the Internet
- Exploring online LaTeX resources
- Using web forums
- Stating a really good question
- Creating a minimal example