LaTeX Cookbook - Second Edition

Book description

Explore practical LaTeX examples across various fields like mathematics, physics, chemistry, and computer science, and learn to quickly create tables, diagrams, and plots for your thesis, presentations, and articles

Key Features

  • Work with ready-to-use document templates to write articles, books, a thesis, and more
  • Refine text, fonts, formulas, and tables, and optimize PDF properties
  • Create captivating graphics directly within LaTeX in 2D and 3D
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

The second edition of LaTeX Cookbook offers improved and additional examples especially for users in science and academia, with a focus on new packages for creating graphics with LaTeX. This edition also features an additional chapter on ChatGPT use to improve content, streamline code, and automate tasks, thereby saving time. This book is a practical guide to utilizing the capabilities of modern document classes and exploring the functionalities of the newest LaTeX packages. Starting with familiar document types like articles, books, letters, posters, leaflets, and presentations, it contains detailed tutorials for refining text design, adjusting fonts, managing images, creating tables, and optimizing PDFs. It also covers elements such as the bibliography, glossary, and index. You’ll learn to create graphics directly within LaTeX, including diagrams and plots, and explore LaTeX’s application across various fields like mathematics, physics, chemistry, and computer science. The book’s website offers online compilable code, an example gallery, and supplementary information related to the book, including the author’s LaTeX forum, where you can get personal support. By the end of this book, you’ll have the skills to optimize productivity through practical demonstrations of effective LaTeX usage in diverse scenarios.

What you will learn

  • Utilize various document classes and incorporate bibliography, glossary, and index sections
  • Handle arranging and annotating images with ease
  • Create visually appealing tables and learn how to manage fonts efficiently
  • Generate diverse and colorful graphics, including diagrams, flow charts, bar charts, trees, and both 2D and 3D plots
  • Solve writing and drawing tasks across various scientific disciplines
  • Optimize PDF output, enhancing it with metadata, annotations, popups, animations, and fill-in fields
  • Leverage ChatGPT to improve content and code

Who this book is for

If you're a LaTeX user in school, academia, or industry with a foundational understanding of LaTeX basics, this book offers efficient solutions to expedite your tasks. Tailored to students, teachers, authors, and engineers, its example-driven format enables quick access to solutions. Familiarity with basic LaTeX syntax and using LaTeX with your preferred editor for compiling is recommended to make the most of this book.

Table of contents

  1. LaTeX Cookbook
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Conventions used
    6. Get in touch
    7. Share Your Thoughts
    8. Download a free PDF copy of this book
  6. Chapter 1: Exploring Various Document Classes
    1. Preparing your LaTeX tools
      1. Getting ready
      2. See also
    2. Writing a short text
      1. How to do it...
      2. How it works...
      3. See also
    3. Developing a thesis
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
      5. See also
    4. Designing a book
      1. How to do it...
      2. How it works...
      3. There’s more...
      4. See also
    5. Creating a presentation
      1. How to do it...
      2. How it works...
      3. There’s more...
      4. See also
    6. Designing a CV
      1. Getting ready
      2. How to do it...
      3. How it works...
    7. Writing a letter
      1. How to do it...
      2. How it works...
      3. There’s more...
    8. Producing a leaflet
      1. How to do it...
      2. How it works...
      3. There’s more...
    9. Building a large poster
      1. How to do it...
      2. How it works...
      3. There’s more...
  7. Chapter 2: Tuning the Text
    1. Improving justification and hyphenation
      1. How to do it...
      2. How it works...
    2. Adding margin notes
      1. How to do it...
      2. How it works...
      3. There’s more...
    3. Converting numbers to words
      1. How to do it...
      2. How it works...
      3. There’s more...
    4. Putting text into a colorful box
      1. How to do it...
      2. How it works...
      3. There’s more...
    5. Visualizing the layout
      1. How to do it...
      2. How it works...
      3. There’s more...
    6. Visualizing boxes of letters and symbols
      1. How to do it...
      2. How it works...
    7. Typesetting in a grid
      1. How to do it...
      2. How it works...
      3. There’s more...
    8. Absolute positioning of text
      1. How to do it...
      2. How it works...
      3. There’s more...
    9. Adding drop caps
      1. How to do it...
      2. How it works...
      3. There’s more...
    10. Fitting text to a shape
      1. How to do it...
      2. How it works...
      3. There’s more...
    11. Creating a pull quote
      1. How to do it...
      2. How it works...
      3. There’s more...
  8. Chapter 3: Adjusting Fonts
    1. Using standard font commands
      1. There’s more...
    2. Choosing a document font
      1. Getting ready
      2. How to do it...
      3. There’s more...
    3. Locally switching to a different font
      1. How to do it...
      2. How it works...
      3. There’s more...
    4. Printing font tables
      1. How to do it...
      2. How it works...
      3. There’s more...
    5. Importing just a single symbol of a font
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Writing bold mathematical symbols
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Getting sans-serif mathematics
      1. How to do it...
      2. How it works...
      3. There’s more...
    8. Writing double-stroke letters like on a blackboard
      1. How to do it...
      2. How it works...
      3. There’s more...
    9. Enabling the searching and copying of ligatures
      1. How to do it...
      2. How it works...
      3. There’s more...
    10. Suppressing ligatures
      1. How to do it...
      2. How it works...
    11. Adding a contour
      1. How to do it...
      2. How it works...
    12. See also
  9. Chapter 4: Creating Tables
    1. Designing a legible table
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Positioning tables
      1. How to do it...
      2. How it works...
      3. There’s more…
    3. Merging cells
      1. How to do it...
      2. How it works...
      3. There’s more...
    4. Splitting a cell diagonally
      1. How to do it...
      2. How it works...
    5. Adding footnotes to a table
      1. How to do it...
      2. How it works...
    6. Aligning numerical data
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Coloring a table
      1. How to do it...
      2. How it works...
    8. Importing data from an external file
      1. How to do it...
      2. How it works...
  10. Chapter 5: Working with Images
    1. Including images with optimal quality
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
    2. Customizing images
      1. How to do it...
    3. Adding a frame to an image
      1. How to do it...
      2. How it works...
    4. Cutting an image to get rounded corners
      1. How to do it...
      2. How it works...
      3. There’s more...
    5. Shaping an image like a circle
      1. How to do it...
      2. How it works...
      3. There’s more...
    6. Drawing over an image
      1. How to do it…
      2. How it works...
    7. Aligning images
      1. How to do it...
      2. How it works...
    8. Arranging images in a grid
      1. How to do it...
      2. How it works...
    9. Stacking images
      1. How to do it...
      2. How it works...
  11. Chapter 6: Creating Graphics
    1. Getting ready
    2. Building smart diagrams
      1. How to do it...
      2. How it works...
      3. There’s more...
    3. Constructing a flowchart
      1. How it works...
    4. Growing a tree
      1. How to do it...
      2. How it works...
      3. There’s more...
    5. Building a bar chart
      1. How to do it...
      2. How it works...
    6. Drawing a pie chart
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Drawing a Venn diagram
      1. How to do it...
      2. How it works...
    8. Putting thoughts into a mind map
      1. How to do it...
      2. How it works...
    9. Generating a timeline
      1. Getting ready
      2. How to do it...
      3. How it works...
  12. Chapter 7: Creating Beautiful Designs
    1. Adding a background image
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Creating beautiful ornaments
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
    3. Preparing pretty headings
      1. How to do it...
      2. How it works...
    4. Producing a calendar
      1. How to do it...
      2. How it works...
    5. Mimicking keys, menu items, and terminal output
      1. How to do it...
      2. How it works...
      3. There’s more...
    6. Arranging topics like a puzzle
      1. How to do it...
      2. How it works...
    7. Building a word cloud
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
  13. Chapter 8: Producing Contents, Indexes, and Bibliographies
    1. Tuning tables of contents and lists of figures and tables
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Creating a bibliography
      1. How to do it...
      2. How it works...
      3. There’s more...
    3. Adding a glossary
      1. How to do it...
      2. How it works...
    4. Creating a list of acronyms
      1. How to do it...
      2. How it works...
    5. Producing an index
      1. How to do it...
      2. How it works...
      3. There’s more...
  14. Chapter 9: Optimizing PDF Files
    1. Using hyperlinks
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Adding metadata
      1. How to do it...
      2. How it works...
      3. There’s more...
    3. Including copyright information
      1. How to do it...
      2. How it works...
      3. There’s more...
    4. Inserting comments
      1. How to do it...
      2. How it works...
    5. Producing fillable forms
      1. How to do it...
      2. How it works...
    6. Optimizing the output for e-book readers
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Removing white margins
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There’s more...
    8. Combining PDF files
      1. How to do it...
      2. How it works...
    9. Creating an animation
      1. How to do it...
      2. How it works...
  15. Chapter 10: Writing Advanced Mathematics
    1. Getting started
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Fine-tuning math formulas
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Automatic line-breaking in equations
      1. How to do it...
      2. How it works...
    4. Highlighting in a formula
      1. How to do it...
      2. How it works...
      3. There’s more...
    5. Stating definitions and theorems
      1. How to do it...
      2. How it works...
      3. There’s more...
    6. Drawing commutative diagrams
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Plotting functions in two dimensions
      1. How to do it...
      2. How it works...
      3. There’s more...
    8. Plotting in three dimensions
      1. How to do it...
      2. How it works...
      3. There’s more...
    9. Drawing geometry pictures
      1. How to do it...
      2. How it works...
      3. There’s more...
    10. Doing calculations
      1. How to do it...
      2. How it works...
    11. Further learning
  16. Chapter 11: Using LaTeX in Science and Technology
    1. Typesetting an algorithm
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Printing a code listing
      1. How to do it...
      2. How it works...
      3. There’s more...
    3. Programming with Lua
      1. How to do it...
      2. How it works...
      3. There’s more...
      4. How it works...
    4. Creating graphs
      1. How to do it...
      2. How it works...
      3. There’s more...
      4. How it works...
    5. Writing quantities with units
      1. How to do it...
      2. How it works...
    6. Drawing Feynman diagrams
      1. How to do it...
      2. How it works...
      3. There’s more...
    7. Writing chemical formulas
      1. How to do it...
      2. How it works...
      3. There’s more...
    8. Drawing molecules
      1. How to do it...
      2. How it works...
      3. There’s more...
    9. Representing atoms
      1. How to do it...
      2. How it works...
    10. Drawing molecular orbital diagrams and atomic orbitals
      1. How to do it...
      2. How it works...
      3. There’s more...
    11. Printing a customized periodic table of elements
      1. How to do it...
      2. How it works...
    12. Drawing electrical circuits
      1. How to do it...
      2. How it works...
    13. See also
  17. Chapter 12: Getting Support on the Internet
    1. Exploring available LaTeX resources on the web
      1. How to do it...
      2. There’s more...
    2. Utilizing web forums effectively
      1. How to do it...
      2. How it works...
    3. Crafting high-quality questions
      1. How to do it...
    4. Generating minimal working examples
      1. How to do it...
      2. There’s more...
  18. Chapter 13: Using Artificial Intelligence with LaTeX
    1. Getting started with ChatGPT
      1. How to do it...
      2. How it works...
      3. There’s more...
    2. Getting answers to LaTeX questions
      1. How to do it...
      2. How it works...
    3. Improving your content
      1. How to do it...
      2. How it works...
      3. There’s more...
    4. Generating code
      1. How to do it...
      2. How it works...
      3. There’s more...
  19. Index
    1. Why subscribe?
  20. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: LaTeX Cookbook - Second Edition
  • Author(s): Stefan Kottwitz
  • Release date: February 2024
  • Publisher(s): Packt Publishing
  • ISBN: 9781835080320