Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
LaTeX Cookbook

You're reading from   LaTeX Cookbook Over 100 practical, ready-to-use LaTeX recipes for instant solutions

Arrow left icon
Product type Paperback
Published in Feb 2024
Publisher Packt
ISBN-13 9781835080320
Length 424 pages
Edition 2nd Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Stefan Kottwitz Stefan Kottwitz
Author Profile Icon Stefan Kottwitz
Stefan Kottwitz
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Chapter 1: Exploring Various Document Classes FREE CHAPTER 2. Chapter 2: Tuning the Text 3. Chapter 3: Adjusting Fonts 4. Chapter 4: Creating Tables 5. Chapter 5: Working with Images 6. Chapter 6: Creating Graphics 7. Chapter 7: Creating Beautiful Designs 8. Chapter 8: Producing Contents, Indexes, and Bibliographies 9. Chapter 9: Optimizing PDF Files 10. Chapter 10: Writing Advanced Mathematics 11. Chapter 11: Using LaTeX in Science and Technology 12. Chapter 12: Getting Support on the Internet 13. Chapter 13: Using Artificial Intelligence with LaTeX 14. Index 15. Other Books You May Enjoy

Preparing your LaTeX tools

LaTeX has been around for many years. Over time, developers and authors contributed numerous extensions to its code base.

Such an extension could be one of the following:

  • Document class: A base file that is the frame of your document. It provides various formatting styles and usually comes with meaningful default settings, which can be changed via options when loading it. It often provides commands for authors to modify settings.
  • Package: A style file with a specific purpose that you can load in addition to the document class. Packages can be combined. Most of the time, we load many of them by executing the \usepackage command.
  • Bundle: A set of closely related packages or classes. In our next recipe, Writing a short text, we will get to know some bundles.
  • Template: A document with dummy text that you can take as a starting point and fill in your headings, texts, formulas, and images. We will look at templates in another recipe, Developing a thesis.

Those add-ons are incredibly valuable. They are one reason for the enduring success of LaTeX. We all agree that learning LaTeX can be challenging with its steep learning curve. However, if you don’t reinvent the wheel and start with a good template or class and a quality set of packages, you can quickly achieve great results.

The purpose of this book is to assist you in this regard.

Getting ready

To be able to work with LaTeX, you need to have the following installed on your computer:

  • TeX and LaTeX software, called a TeX distribution
  • A LaTeX editor, though you could use any text editor
  • A PDF viewer for seeing the final output

If you already have those installed, great! In that case, you can skip the following paragraphs and immediately proceed to the first recipe.

A PDF reader is probably already installed on your computer, such as Adobe Reader or the Preview app on the Mac. Furthermore, most editors come with an integrated PDF previewer. So, let’s have a look at TeX software and editors.

TeX and LaTeX distributions

There are TeX and LaTeX software collections ready to use and easy to install. Their websites provide install and update information. You may choose the download site for your system:

  • TeX Live: On https://tug.org/texlive, you can find download information and installation instructions for the cross-platform TeX distribution, which runs on Windows, Linux, Mac OS X, and other Unixes. It is supported by the TeX Users Group (TUG).
  • MacTeX: This is based on TeX Live and has been significantly customized for Mac OS X. Essential information is available at https://tug.org/mactex.
  • MiKTeX: A download and documentation for the Windows-specific distribution can be found at https://miktex.org.

If you own a Mac, I suggest selecting MacTeX. Otherwise, I recommend using TeX Live because the TUG provides excellent development and support.

Describing the setup is outside the scope of this book. For TeX Live, you can find a step-by-step explanation with screenshots in the LaTeX Beginner’s Guide by Packt Publishing. Generally, you can find detailed setup instructions when you visit the aforementioned internet addresses.

Finally, on Linux systems, such as Ubuntu, Debian, Red Hat, Fedora, and SUSE versions, a TeX Live-based software package is usually available via the operating system repositories. While it’s usually not as up to date as an installation via the TeX Live website or a TeX Live DVD, it’s straightforward to install using the Linux package manager you deploy to install any software there.

I strongly recommend choosing a complete LaTeX installation containing all available software, packages, and fonts. At the time of writing, it typically requires around 8 GB of disk space, but it guarantees you won’t encounter any missing packages or dependencies later.

LaTeX editors

There are many LaTeX editors, from small and quick to feature-rich editors. The TeX distributions already provide the fine editor TeXworks, which I use myself. You set it up with TeX or a package manager on Linux, and it can be downloaded from https://tug.org/texworks.

You can find a collection of LaTeX editors and additional software at https://latex.net/software. You may look for alternative editors running on your operating system there.

Using LaTeX online

A complete online cloud solution for LaTeX saves you from installing LaTeX software yourself. The most advanced one is called Overleaf and comes with an online LaTeX editor that runs in a web browser, so you can use it even on tablets and smartphones for storing, editing, and compiling even large LaTeX projects. You can find it at https://www.overleaf.com. While registration is necessary, basic access to the platform is free. Some advanced features require purchasing a subscription, but it’s worth noting that many universities and institutions partner with Overleaf and provide enhanced licenses for their students and employees.

The LaTeX Beginner’s Guide explores Overleaf in more detail; you can find this section online at https://latexguide.org/overleaf.

If you need help setting up and using LaTeX or an editor, you can visit a LaTeX web forum such as https://latex.org. In Chapter 12, Getting Support on the Internet, you can find their addresses and how to use them. You can also meet me there and ask me and our fellow forum users any LaTeX-related questions.

Once you have done the installation or online setup, you can start with a LaTeX recipe from the following sections.

See also

Many LaTeX tutorials available on the internet can help you with the first steps. I recommend looking at the following:

  • https://learnlatex.org covers the most essential LaTeX basics in short lessons in 10 languages. It is very modern and comes with an online compiler for its examples.
  • https://texdoc.org/pkg/lshort is the web link for The not so short introduction to LaTeX2e, a famous introductory text. It has been translated into more than 20 languages, available at https://ctan.org/pkg/lshort.
  • https://www.overleaf.com/learn takes you to the Overleaf knowledge base with various guides and many articles about LaTeX.
  • https://en.wikibooks.org/wiki/LaTeX takes you to the LaTeX Wikibook, a collaboratively created extensive guide.
  • https://www.dickimaw-books.com/latex/novices contains the free introductory book LaTeX for Complete Novices by Nicola L. C. Talbot. It is somewhat dated but OK for the first steps.
  • https://latex2e.org hosts the Unofficial reference manual for LaTeX, an excellent resource whenever you need to know how to use specific LaTeX commands, environments, arguments, and syntax in general.
  • https://latexguide.org is the website for the LaTeX Beginner’s Guide, with a sample chapter, all code examples by chapter, reviews, and additional information in case you’re considering buying a modern book on paper or in electronic format.

If you still need to learn LaTeX, read one of the guides, and you will then be well prepared to get the best out of this book.

You have been reading a chapter from
LaTeX Cookbook - Second Edition
Published in: Feb 2024
Publisher: Packt
ISBN-13: 9781835080320
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image