Skip to:Content
|
Bottom
Cover image for The LaTeX Graphics companion
Title:
The LaTeX Graphics companion
Personal Author:
Series Title:
Addison-Wesley series on tools and techniques for computer typesetting
Series:
Addison-Wesley series on tools and techniques for computer typesetting
Edition:
Second edition
Publication Information:
Upper Saddle River, NJ : Addison-Wesley, c2008.
Physical Description:
xxxiv, 925 pages : illustrations ; 24 cm
ISBN:
9780321508928

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
33000000002731 Z253.4.L38 G66 2008 Open Access Book Gift Book
Searching...

On Order

Summary

Summary

Published Aug 2, 2007 by Addison-Wesley Professional. Part of the Tools and Techniques for Computer Typesetting series. The series editor may be contacted at frank.mittelbach@latex-project.org . The LATEX typesetting system remains a popular choice for typesetting a wide variety of documents, from papers, journal articles, and presentations, to books--especially those that include technical text or demand high-quality composition. This book is the most comprehensive guide to making illustrations in LATEX documents, and it has been completely revised and expanded to include the latest developments in LATEX graphics. The authors describe the most widely used packages and provide hundreds of solutions to the most commonly encountered LATEX illustration problems.

This book will show you how to

Incorporate graphics files into a LATEX document Program technical diagrams using several languages, including METAPOST, PSTricks, and XY-pic Use color in your LATEX projects, including presentations Create special-purpose graphics, such as high-qualitymusic scores and games diagrams Produce complex graphics for a variety of scientific and engineering disciplines New to this edition:

Updated and expanded coverage of the PSTricks and METAPOST languages Detailed explanations of major new packages for graphing and 3-D figures Comprehensive description of the xcolor package Making presentations with the beamer class The latest versions of gaming and scientific packages There are more than 1100 fully tested examples that illustrate the text and solve graphical problems and tasks--all ready to run!

All the packages and examples featured in this book are freely downloadable from the Comprehensive TEX Archive Network (CTAN).

The LATEX Graphics Companion, Second Edition , is more than ever an indispensable reference for anyone wishing to incorporate graphics into LATEX. As befits the subject, the book has been typeset with LATEX in a two-color design.


Author Notes

Michel Goossens is at present responsible for scientific text processing at CERN, the European Laboratory for Particle Physics, in Geneva, Switzerland. He is a coauthor of The LaTeX Companion, Second Edition , The LaTeX Graphics Companion, Second Edition , and The LaTeX Web Companion , and also is a past president of the TUG and GUTenberg TeX Users Groups.
Michel began working at CERN after earning a Ph.D. in physics at Brussels University. At CERN, he soon realized the importance of good documentation and, since the middle 1980s, has been deeply involved with LaTeX. At the same time he has followed closely the development of other generic markup languages and was among the first users of SGML, HTML (invented at CERN), and later XML.

Frank Mittelbach is manager and technical director of the LaTeX3 Project, in which capacity he oversaw the release of LaTeX 2e and more than 15 subsequent releases of this software. In 1989 he joined Electronic Data Systems (EDS), working in a newly formed group for document processing using TeX and other tools. In his current position, he is responsible for concepts and implementation for remote monitoring and management of distributed systems and networks. Frank is a coauthor of The LaTeX Companion, Second Edition , and The LaTeX Graphics Companion, Second Edition , as well as the editor of the book series in which they appear, Tools and Techniques for Computer Typesetting.
Frank studied mathematics and computer science at the Johannes-Gutenberg University, Mainz. His interest in the automated formatting of complex documents in general, and in LaTeX in particular, goes back to his university days and has become a major interest, perhaps a vocation, and certainly it is now his "second job." He is author or coauthor of many and varied LaTeX extension packages, such as AMS-LaTeX, doc, multicol, and NFSS: the New Font Selection Scheme. In 1990 Frank presented the paper E-TeX: Guidelines for further TeX extensions, which explained the most critical shortcomings of TeX and argued the need for its further development and for research into the many open questions of automated typesetting. This was the first time the topic of change or extension had been openly discussed within the TeX community and, after getting some early opposition, it helped to spawn several important projects, such as eTEX, Omega, and NTS. He is now interested in bringing together the fruits of these TeX extension developments to get a stable, well-maintained, and widely available successor of TeX on which a future LaTeX3 can be based.

Sebastian Rahtz is information manager for Oxford University Computing Services. He is a coauthor of The LaTeX Graphics Companion, Second Edition , and The LaTeX Web Companion .
Sebastian started life in classics, moved to archaeology, and thence to computing. During the 1980s he taught humanities and archaeological computing at Southampton University, where he also came across TeX. The infection grew strong, and he spent most of the 1990s in TeX-related matters, working latterly for Elsevier Science in production support and in LaTeX to SGML conversion. During that time he was heavily involved in the international and UK TeX Users Groups in many capacities, and worked on a variety of LaTeX packages, most notably hyperref. His allegiance today has largely moved to XML, in which capacity he is Oxford''s representative on the Board of the Text Encoding Initiative, but he retains a soft spot for the funny backslash and curly bracket language.

Denis Roegel is associate professor in computer science at the University of Nancy. He has been involved in LaTeX for the past 15 years and has a special interest in technical graphics.
Denis discovered computers in the early 1980s, and after studying mathematics and physics, he earned an engineering degree from the ecole Supèrieure d''electricitè and a Ph.D. in computer science from the Universitè Henri Poincarè in Nancy. He later was a postdoctoral fellow at the State University of New York at Stony Brook.

Herbert Vo is a teacher of mathematics, physics and computer science at a German high school and a lecturer at the Free University of Berlin. For the past three years, he has been heavily involved in maintaining PSTricks and using PostScript from within LaTeX.
Herbert studied Electrical Engineering and Power Electronics in Hannover and Berlin. His first experience with a computer was in 1970 with an IBM machine and Algol60. The first text-processing program he used, in 1982, was Wordstar on a microcomputer with an 8080 chip. From this time on, he also was heavily involved in programming for various projects with Turbo Pascal. He came back to PostScript and LaTeX at the end of the 90s.


Excerpts

Excerpts

More than a decade has passed since the publication of the first edition of The LATEX Graphics Companion , and there have been many changes and new developments since 1996. The second edition has seen a major change in the authorship: Frank, Michel and Sebastian have been joined by Denis and Herbert as authors, enriching the book with their knowledge and experience in individual subject areas. As in the first edition, this book describes techniques and tricks of extended LATEX typesetting in the area of graphics and fonts. We examine how to draw pictures with LATEX and how to incorporate graphics files into a LATEX document. We explain how to program pictures using METAFONT and METAPOST, as well as how to achieve special effects with small fragments of embedded PostScript. We look in detail at a whole range of tools for building graphics in TEX itself. TEX is the world's première markup-based typesetting system, and PostScript (on which PDF is based) is the leading language for describing the printed page. We describe how they can produce evenmore beautiful resultswhen they work together. TEX's mathematical capability, its paragraph building, its hyphenation, and its programmable extensibility can cooperate with the graphical flexibility and font-handling capabilities of PostScript and PDF to provide a rich partnership for both author and typesetter. To be able to do justice to the graphics packages that have been further developed since the first edition, we decided to omit a description of PostScript and PDF tools, and of font technologies, from the printed version of this book. This material, which was covered in Chapters 10 and 11 of the first edition, has been substantially expanded and is now freely available (see http://xml.cern.ch/lgc2 ). It covers DVI-to-PostScript drivers, the free program ghostscript to view PostScript and PDF files, tools for manipulating PostScript and PDF files, and suggestions on how to combine the latest font technologies (PostScript Type 1 and OpenType) with LATEX. This volume is not a complete consumer guide to packages. In trying to teach by example, we present hundreds of self-contained code samples of the most useful types of solutions, based on proven and well-known implementations. But, given the space available, we cannot provide a full manual for every package. Our aim is simply to show how easy it is to use a given package and to indicate whether it seems to do what is required--not to dwell on the precise details of syntax or options. Nevertheless, we have described in more detail a few selected tools that we consider especially important. We assume you know some LATEX; you cannot read this book by itself if you have never used TEX before. We recommend that you start with LATEX: A Document Preparation System, Second Edition (Addison-Wesley, 1994), or the Guide to LATEX, Fourth Edition (Addison-Wesley, 2004), and continue with The LATEX Companion, Second Edition (Addison-Wesley, 2004), to explore some of the many (non-graphical) packages available. Why LATEX, and why PostScript? This book is about LATEX, graphics, PostScript, and its child PDF. We believe that the structured approach of a system like LATEX is the best way to use TEX, and LATEX is by far the most widely used TEX format. This means that it attracts contributors who develop new packages, and thus some of what we describe works only in LATEX. We apologize in advance for our LATEX bias to those who appreciate the elegance of the original plain TEX format and its derivatives, and we promise them that most of the packages will work well with any TEX dialect: the delights of systems such as METAPOST, PSTricks, XY-pic, and MusiXTEX are open to all. We also want to explain why we talk about PostScript so much. This language has been well established for almost two decades as an extremely flexible page-description language, and it remains the tool of choice for professional typesetters. Among the features that make it so attractive are these: The quantity, quality, and flexibility of Type 1 fonts The device-independence and portability of files The quality of graphics and the quantity of drawing packages that generate it The facilities for manipulating text The mature color-printing technology The encapsulation conventions that make it easy to embed PostScript graphics The availability of screen-based implementations (e.g., ghostscript/ghostview) PostScript has spawned an enterprising child, the PDF (Portable Document Format) language, used by Adobe Acrobat and now well established as an exchange format for documents on the Web. Designed for screen display with hypertext features, PDF offers a new degree of portability and efficiency. Although not the main subject of this book, we nevertheless mention that LATEX can also produce "rich" PDF documents, and versions of TEX (e.g., pdflatex) that produce PDF directly are available. Again, we apologize to those of you who are disappointed not to read about LATEX's association with Mac's QuickDraw, or the Windows GDI, HPGL, PCL, etc., but with so many packages available, we had to make a choice. Please note that the absence of a given package or tool in this book in no way implies that we consider it less useful or of inferior quality. We do think, though, that we have included a representative set of tools and packages, and we sincerely hope that you will find here one or more subjects to entertain you. How this book is arranged This book is subdivided in two basic ways: by application area and by technique. We suggest that all readers look at Chapter 1 before going any further, because it introduces how we think about graphics and summarizes some techniques developed in later chapters. We also suggest that you read Chapter 2, which covers the LATEX standard graphics package, since the tools for including graphics files will be needed often. Chapter 2 also covers pict2e, a package that reimplements LATEX's picture environment using PostScript, and a further extension curve2e. Together these packages not only do away with most of the limitations inherent in the standard version of LATEX's picture, but also offer new and powerful commands to draw arcs and curves with mininal effort. We have tried to make it possible to read each of the other chapters separately; you may prefer to go straight to the chapters that cover your subject area or look at those that describe a particular tool. Two chapters each are dedicated to the generic systems METAPOST and PSTricks. 3 METAFONT and METAPOST: TEX's Matesshows how to exploit the power of TEX's META languages (Knuth's METAFONT and its PostScript-based extension METAPOST). After introducing the basic functions, the basic METAPOST libraries are described, as well as available TEX interfaces and miscellaneous tools and utilities. 4 METAPOST Applicationsintroduces the METAPOST toolkit, and explains how to use METAPOST's unparalleled expressive power for describing many types of graphs, diagrams, and geometric constructs. Applications in the areas of science and engineering, 3-D representations, posters, etc. conclude the overview. 5 Harnessing PostScript Inside LATEX: PSTrickswalks the reader through the various components of the PSTricks language, looking at such things as defining the coordinate system, lines and polygons, circles, ellipses and curves, arrows, labels, fill areas, and much more. 6 The Main PSTricks Packagestakes you even deeper into the world of PSTricks. Armed with the knowledge gained in Chapter 5, the reader will find here detailed descriptions of the most common PSTricks packages--in particular, pst-plot for plotting functions and data; pst-node formastering nodes and their connections; pst-tree for creating tree diagrams; pst-fill for filling and tiling areas; pst-3d for creating 3-Deffects, such as shadows and tilting; and pst-3dplot for handling 3-D functions and data sets. The chapter ends with a summary of PSTricks commands and keywords. The next four chapters discuss problems in special application areas and survey more packages: 7 The XY-pic Packageintroduces a package that goes to great lengths to define a notation for many kinds of mathematics diagrams and implements it in a generic and portable way. 8 Applications in Science, Technology, and Medicinelooks at chemical formulae and bonds, applications in bioinformatics, Feynman diagrams, timing diagrams, and electronic and optics circuits. 9 Preparing Music Scoresfirst describes the principles of the powerful MusiXTEX package. Then several preprocessors providing a more convenient interface are introduced: abc for folk tunes, PMX for entering polyphonic music, and M-Tx (an offspring of PMX) for dealing with multi-voice lyrics in scores. We also take a short look at LilyPond, a modern music typesetter written in C++, and say a few words about TEXmuse. 10 Playing Gamesis for those who use LATEX for play as well as for work. It shows you how to describe chess games and typeset chess boards (the usual and oriental variants). This chapter also describes how to handle Go, backgammon, and card games. We conclude with crosswords in various forms and Sudokus, including how to typeset, solve, and generate them. Our last chapter addresses an area of general interest: color, and some of its common uses in LATEX. 11 The World of Colorstarts with a short general introduction to color. Next comes an overview of the xcolor package and the colortbl package, that is based on xcolor. The final part discusses the beamer class for producing color slides with LATEX. Appendix A describes ways to generate PDF from LATEX. Appendix B introduces CTAN and explains how to download the LATEX packages described in this book. As mentioned earlier, material about PostScript and PDF tools, as well as information about how to use PostScript and OpenType fonts with LATEX, is available as supplementary material (see http://xml.cern.ch/lgc2 ),which covers the following subjects: PostScript Fonts and Beyonddescribes the ins and outs of using PostScript fonts with LATEX. It also looks at the latest developments on how to integrate OpenType fonts by creating TEX-specific auxiliary files (TEX metrics, virtual fonts, etc.) or by reading the font's characteristics directly in the OpenType source. PostScript and PDF Toolsstarts with a short introduction to the PostScript, PDF, and SVG languages. It then describes some freely available programs, in particular dvips and pdflatex to generate PostScript and PDF, ghostscript and ghostview to manipulate and view PostScript and PDF, plus a set of other tools that facilitate handling PostScript and PDF files and conversions. Finding all those packages and programs All of the packages and programs described in this book are freely available in public software archives; a few are in the public domain, but most are protected by copyright and available to you under an open-source license. Some programs are available only in source form or work only on certain computer platforms, and you should be prepared for a certain amount of "getting your hands dirty" in some cases. We also cannot guarantee that later versions of packages or programs will give results identical to those in our book. Many of these packages and programs remain under active development, and new or changed versions appear several times a year; we completed this book in spring 2007, and tested the examples with the versions current at that time. In Appendix B we give full details on how to access CTAN sites and how to download files using the Internet. You can also purchase the TEX Collection DVD from one of the TEX Users Groups. This DVD contains implementations of TEX for various systems, many packages and fonts, in particular it provides you with all the LATEX packages described in this book and The LATEX Companion, Second Edition . Some programs (such as the ones described in the music chapter) are not available on CTAN (or the DVD) and must be downloaded from the location indicated in the text. Excerpted from The Latex Graphics Companion by Michel Goossens, Frank Mittelbach, Sebastian Rahtz, Denis Roegel, Herbert Vob All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Table of Contents

List of Figuresp. xvii
List of Tablesp. xxi
Prefacep. xxv
Why LATEX, and why PostScript?p. xxvi
How this book is arrangedp. xxvii
Typographic conventionsp. xxix
Using the examplesp. xxxi
Finding all those packages and programsp. xxxiii
Chapter 1 Graphics with LATEXp. 1
1.1 Graphics systems and typesettingp. 2
1.2 Drawing typesp. 3
1.3 TEX's interfacesp. 6
1.4 Graphics languagesp. 10
1.5 Choosing a packagep. 21
Chapter 2 Standard LATEX Interfacesp. 23
2.1 Inclusion of graphics filesp. 23
2.2 Manipulating graphical objectsp. 36
2.3 Line graphicsp. 42
Chapter 3 METAFONT and METAPOST: TEX's Matesp. 51
3.1 The META languagep. 52
3.2 Differences between METAPOST and METAFONTp. 60
3.3 Running the META programsp. 68
3.4 Some basic METAPOST librariesp. 74
3.5 The METAOBJ packagep. 80
3.6 TEX interfaces: getting the best of both worldsp. 120
3.7 From METAPOST and to METAPOSTp. 137
3.8 The future of METAPOSTp. 138
Chapter 4 METAPOST Applicationsp. 141
4.1 A drawing toolkitp. 141
4.2 Representing data with graphsp. 157
4.3 Diagramsp. 176
4.4 Geometryp. 189
4.5 Science and engineering applicationsp. 196
4.6 3-D extensionsp. 207
Chapter 5 Harnessing PostScript Inside LATEX: PSTricksp. 213
5.1 The components of PSTricksp. 214
5.2 Setting keywords, lengths, and coordinatesp. 217
5.3 The pspicture environmentp. 220
5.4 The coordinate systemp. 223
5.5 Gridsp. 224
5.6 Lines and polygonsp. 231
5.7 Circles, ellipses, and curvesp. 240
5.8 Dots and symbolsp. 249
5.9 Filling areasp. 53
5.10 Arrowsp. 259
5.11 Labelsp. 265
5.12 Boxesp. 269
5.13 User styles and objectsp. 279
5.14 Coordinatesp. 296
5.15 The PSTricks corep. 302
Chapter 6 The Main PSTricks Packagesp. 313
6.1 pst-plot--Plotting functions and datap. 313
6.2 pst-node--Nodes and connectionsp. 334
6.3 pst-tree--Typesetting treesp. 366
6.4 pst-fill--Filling and tilingp. 383
6.5 pst-3d--Shadows, tilting, and three-dimensional representationsp. 388
6.6 pst-3d plot--3-D parallel projections of functions and datap. 400
6.7 Short overview of other PSTricks packagesp. 417
6.8 Summary of PSTricks commands and keywordsp. 459
Chapter 7 The XY-pic Packagep. 467
7.1 
Go to:Top of Page