Book Image

LaTeX Cookbook

By : Stefan Kottwitz
Book Image

LaTeX Cookbook

By: Stefan Kottwitz

Overview of this book

LaTeX is a high-quality typesetting software and is very popular, especially among scientists. Its programming language gives you full control over every aspect of your documents, no matter how complex they are. LaTeX's huge amount of customizable templates and supporting packages cover most aspects of writing with embedded typographic expertise. With this book you will learn to leverage the capabilities of the latest document classes and explore the functionalities of the newest packages. The book starts with examples of common document types. It provides you with samples for tuning text design, using fonts, embedding images, and creating legible tables. Common document parts such as the bibliography, glossary, and index are covered, with LaTeX's modern approach.You will learn how to create excellent graphics directly within LaTeX, including diagrams and plots quickly and easily. Finally, you will discover how to use the new engines XeTeX and LuaTeX for advanced programming and calculating with LaTeX. The example-driven approach of this book is sure to increase your productivity.
Table of Contents (19 chapters)
LaTeX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

LaTeX is a high-quality typesetting software and is very popular, especially among scientists. Its programming language gives you full control over every aspect of your documents, no matter how complex they are. LaTeX's large number of customizable templates and supporting packages cover most aspects of writing with embedded typographic expertise.

With this book, you will learn to leverage the capabilities of the latest document classes and explore the functionalities of the newest packages.

This book starts with examples of common document types. It provides samples for tuning text design, using fonts, embedding images, and creating legible tables. Common parts of the document such as the bibliography, glossary, and index are covered with LaTeX's modern approach.

You will learn how to create excellent graphics directly within LaTeX; this includes creating diagrams and plots quickly and easily.

Finally, the book shows the application of LaTeX in various scientific fields.

The example-driven approach of this book is sure to increase your productivity.

What this book covers

Chapter 1, The Variety of Document Types, introduces you to the different types of documents and covers how LaTeX can be used for for any document type such as a thesis, a book, a CV, a presentation, a flyer, and a large poster.

Chapter 2, Tuning the Text, focuses on customizing text details in the documents. We will start with some very useful basics, covering some helpful things. We will end the chapter with recipes that show off what LaTeX can do beyond rectangular paragraphs.

Chapter 3, Adjusting Fonts, helps you to choose fonts globally, and demonstrates how to adjust them within the document.

Chapter 4, Working with Images, contains some recipes for including, positioning, and manipulating images within LaTeX. After discussing the quality aspects, you will get to know about the concept of floating figures for automated positioning to give well-balanced text heights on pages.

Chapter 5, Beautiful Designs, helps you in adding background images, creating beautiful ornaments, adding pretty headings, producing a calendar, and inserting symbols for computer keys and menu items.

Chapter 6, Designing Tables, helps you to create good-looking tables. Specifically, it covers creating a legible table, aligning numeric data, adding colors, shape, shading, and transparency merging and splitting cells, and reading in table data from external files.

Chapter 7, Contents, Indexes, and Bibliographies, provides recipes for quickly starting and customizing the table of contents, lists of of figures and tables, bibliographies, glossaries, and indexes.

Chapter 8, Getting the Most out of the PDF, explores the capabilities of PDF, such as metadata, PDF comments, and fillable forms. You will see how to combine PDF files, how to crop margins, and how to optimize the output for e-books.

Chapter 9, Creating Graphics, contains recipes to create impressive graphics. We will start off using modern packages for various purposes to create complete and useable graphics, such as various kinds of diagrams and charts.

Chapter 10, Advanced Mathematics, explores one of the classic strong points of LaTeX—its excellent quality in typesetting formulas. That's why LaTeX is the most used writing software in mathematics. When it comes to formulas, other sciences benefit from it as well.

Chapter 11, Science and Technology, deals with other sciences such as chemistry, physics, computer science, and technologies such as electronics. This chapter will be an overview, showing how LaTeX can be used in various fields using specific recipes.

Chapter 12, Getting Support on the Internet, starts with a guide to the most useful Internet resources for LaTeX. This chapter will show you how to get help from the TeX online communities.

What you need for this book

The software that you need here is TeX Live, version 2015 or later, or MiKTeX, version 2.9 or later. It is recommendable to also install a LaTeX editor. The introduction in Chapter 1 will explain, where to get the TeX software and editors. The Chapter 12 will guide you to further Internet resources.

An important tool is texdoc. It opens manuals and further documentation for you. texdoc is contained in TeX Live. MiKTeX provides a similar tool with the same name. texdoc is called at in Command Prompt by typing texdoc keyword. For packages and bundles, the keyword is usually just the name.

All the code examples in this book can be downloaded as described later in the section Customer support. So, you don't need to type the code, neither to do copy & paste. That's why we could split the codes into snippets to explain them step by step.

Who this book is for

If you already know the basics of LaTeX and if you'd like to get quick and efficient solutions to your problems, this is the perfect book for you. If you are an advanced reader, you can use this book's example-driven format to take your skillset to the next level. Some familiarity with the basic syntax of LaTeX and how to use the editor of your choice for compiling is required.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

To give clear instructions on how to complete a recipe, we use these sections as follows:

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Write a mathematical equation using the equation environment."

A block of code is set as follows:

\begin{document}
\frenchspacing
\raggedbottom
\selectlanguage{american}
\pagenumbering{roman}
\pagestyle{plain}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on browse files to have filler images and a sample file."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.