
A Simple Book Design in ConTEXt Steve Grathwohl Duke University Press, Durham, NC, USA [email protected] Abstract As a test of book design implementation in ConTEXt, I report on a design for A Voyage to Arcturus by David Lindsay, including page setups, chapter heads, headers, and typescripts for fonts. text was quite corrupt, and it took a while to make 1 Motivation the necessary edits to bring it to an acceptable stan- Whenever I learn a new TEX system, I try to im- dard. plement a design for a significant number of pages. The design I had in mind for the book was based Many years ago, when I was learning LATEX (2.09), I on a mathematics text I read in college. The unify- wrote a rawls.sty to mimic Harvard Press’s design ing theme was a vertical rule separating visual ele- for John Rawls’s A Theory of Justice [3], a design ments of the chapter headings and page headers. that featured a number of interesting features: not only were there parts, chapters, and sections, but 3 Fonts the sections were numbered consecutively through- out the book, orthogonally to the chapters. So the I decided to use a Bembo clone (called Bergamo) for first section of Chapter 3, say, might be numbered the text and an Optima clone (called Opus) for the section 16. Page headers had rules under the head- chapter headings and header texts. Both are from er texts. I mention all this because in those pre- the FontSite 500 collection [4]. To use these fonts LATEX2ε days, it was far from trivial to make sub- with ConTEXt, I write some typescripts. stantive changes to the default styles. I remember studying Don Knuth’s (plain) code for his Computer \starttypescript [serif] [bergamo] [ec] Journal article on Literate Programming and think- \definefontsynonym [Bergamo-Roman] ing what a nightmare it would be to implement in [5borjx8t] [encoding=ec] LATEX; but that was 1988. Matters have certainly \definefontsynonym [Bergamo-Bold] improved since then. [5bobjx8t] [encoding=ec] When I first encountered ConTEXt I was imme- \definefontsynonym [Bergamo-Italic] diately impressed by the setups mechanism of key/ [5borix8t] [encoding=ec] value pairs approach to a design interface. I began \definefontsynonym [Bergamo-Bold-Italic] using ConTEXt for typesetting internal documenta- [5bobix8t] [encoding=ec] tion here at the Duke Press (coded in DocBook XML \definefontsynonym [Bergamo-Caps] and processed using Simon Pepping’s Docbook In [5borcj8t] [encoding=ec] ConTeXt [2]). But I had in mind all along trying \definefontsynonym [Bergamo-Bold-Caps] out ConTEXt in a larger project. I wanted to see [5bobcj8t] [encoding=ec] how easy it would be to render a book design com- \stoptypescript pared to LATEX. I suspected it would be much easier; I was right. Observant readers who know the Berry naming conventions will see that Bergamo contains both full ‘f’ ligatures and old-style numerals. 2 The Text In the following I declare that maths be in When I discovered that a very strange book I had scaled Palatino (even though in this project there first read as a youth, A Voyage to Arcturus by David are no maths). I find that Palatino for maths blends Lindsay [1], had been deposited in Project Guten- well with Bergamo, and I wanted to go ahead and berg, I knew I had my text. In the event, the OCR set this up for future projects. 52 TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference A Simple Book Design in ConTEXt \starttypescript [Bergamo] % the % after ] and } suppresses space \definetypeface [Bergamo] [rm] [serif] [bergamo] [default] [encoding=ec] \def\mychap#1#2% \definetypeface [Bergamo] [ss] [sans] {\hbox to \hsize \bgroup [opus] [default] [encoding=ec] \hfill \definetypeface [Bergamo] [tt] [mono] \setupframed [modern] [default] [offset=0.5em,frame=off]% \definetypeface [Bergamo] [mm] [math] \tbox [palatino] [default] [encoding=ec, {\framed rscale=.90] [width=2cm,align=left] \stoptypescript {\ss #1}}% % now instructions for #2, The code for Opus is similar. I store these % anything but ragged right with typescripts in type-fontsite.tex and invoke them. % no hyphenation looks bad Note that I use hanging punctuation and open up \tbox the lines to improve readability. {\framed [width=.5\textwidth, % Set up hanging punctuation, pure style; align=flushright, % Declare Berry naming conventions, ec leftframe=on] % encoding {\hyphenpenalty 10000 \ss #2}}% \egroup} \usetypescript[serif] [hanging] [pure] \usetypescript[berry] [ec] I want dropped caps for my chapter openers, and small caps afterwards for a certain number of % Load Bergamo and Opus fonts, words that I choose. (It is also possible to set this up so the entire first line is in small caps automatically; % declare sizes and leading. but I prefer to choose my own breaks.) The dropped % Looks better with lines opened a bit. cap will be in Opus, be 3 \baselineskips tall, be dropped one line, and have 2 points of padding. \usetypescriptfile[type-fontsite] \usetypescript[Bergamo] \def\Drop {\DroppedCaps \setupbodyfont[Bergamo,10pt] {} {Sans} {3\baselineskip} \setupinterlinespace[line=1.35em] {2pt} {1\baselineskip} {2}} \setupalign[hanging] \def\chap#1/#2/{\Drop #1{\sc#2}} so I can say 4 Chapter Heads, Page Headers and Footers \chapter{The S\’eance} I set up the heads with these options \chap O/n a march evening/, at eight \setuphead o’clock, Backhouse, the [chapter] [page=yes, You can see the result in Figure 1. before={\blank[force,4*line]}, To unify the design, I make the headlines mir- after={\blank[4*line]}, ror the chapter openers, with a vertical rule sep- command=\mychap] arating verso the page number and book title and recto the chapter title and page number, all in Opus. Note the command option. This allows me to First I declare doublesided pages and turn off auto design my own chapter head appearance. \mychap page-number placement. Then I specify a different looks like this (#1 refers to the chapter number, and scheme for chapter opening pages. #2 refers to the chapter title): TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference 53 Steve Grathwohl % Remove auto page numbering placement; \setuplist % I’ll do it manually. [chapter] [alternative=a, \setuppagenumbering margin=.2\textwidth, [alternative=doublesided, numbercommand=\NumCom] location=] \def\NumCom#1{\hbox to 2em{\hfill #1}} % Set up header texts, recto and verso 5 Setting Up the Pages \setupheadertexts [] [\setups{text:header:1}] Last (actually first) I set up the pages and a switch [\setups{text:header:2}] [] for page imposition. Pay attention to the comment- ed lines for crop marks, etc. \startsetups text:header:1 \getmarking[chapter][current] % Set the sizes. \quad\vrule\quad \pagenumber \definepapersize \stopsetups [arc] [height=220mm, \startsetups text:header:2 width=145mm] \pagenumber \quad\vrule\quad \setuppapersize A Voyage to Arcturus [arc] \stopsetups [letter] % Define heads for chapter opening pages % Set up arrangements for printing as % booklet. Toggle as needed. \definetext [chapterstart] % \setuparranging[2UP,rotated,doublesided] [footer] [pagenumber] \setuplayout [margin=0pt, \setuphead width=middle] [chapter] [header=empty, \setuplayout footer=chapterstart] [topspace=2\baselineskip, height=middle] \setupheader [style=\ss] % Layout modifications to headers, etc A page spread can be seen in Figure 2. \setuplayout Now I specify the Table of Contents: [header=2\baselineskip, footer=2\baselineskip, % Set up table of contents format. location=middle] % Move whole operation to the right % to better center the TOC, and make % Crop marks. % sure chap numbers align properly % % (flushright) in their own box % \setuplayout[marking=on] \definelist \setupindenting [chapter] [medium] 54 TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference A Simple Book Design in ConTEXt % I guess Bush would call this suitable cover page for it. Other versions will fol- % ‘freedomspacing’ low when ready. But be warned—many have found Lindsay’s \setuplanguage philosophy detestable (a worship of suffering is one [en] characteristic of it). The English writer C. S. Lewis [spacing=broad] % french spacing certainly found it so, even if the book did influence his wonderful space novels. Finally, for output targeted for a computer screen instead of print, I can say Acknowledgments. Thanks are due to Hans Hagen for improving my humble code in places and for writ- \setuppapersize[S6][S6] ing the ConTEXt TUGboat style. \setupinteraction[state=start] References I can’t argue emphatically enough for this ap- proach to books and articles destined for a com- [1] Lindsay, David, A Voyage to Arcturus, Lon- puter screen. The advantages to making one’s way don, Methuen, 1920. Text available at Project through the text by just the touch of the space bar Gutenberg: http://www.gutenberg.net are, to me, self evident. /etext/1329. Other, corrupt editions can be found on amazon.com. [2] Pepping, Simon, DocbookInConTeXt, avail- 6 Future Work able at http://www.leverkruid.nl/context Clearly, implementing a simple design in ConTEXt /index.html. is quite straightforward. In fact, the advantages of [3] Rawls, John, A Theory of Justice, Revised using ConTEXt become more obvious the more com- edition, Belknap Press, Cambridge, MA, 1999. plicated the document design. I hope that this arti- [4] FontSite. http://www.fontsite.com.TEX cle might motivate others to give ConTEXt a try for font metrics and LATEX support files by their own typesetting projects. Christopher League are available at http: Eventually I plan to code the book in XML //contrapunctus.net/league/haques along with supporting files for browser display and /fs500tex/. direct typesetting with ConTEXt. For the moment, I will post the screen version at http://www.duke. edu/~grath/arcS6.pdf, after a friend designs a TUGboat, Volume 25 (2004), No. 1 — Proceedings of the Practical TEX 2004 Conference 55 Steve Grathwohl 1 The Séance O n a march evening, at eight o’clock, Backhouse, the medium—a fast-rising star in the psychic world—was ushered into the study at Prolands, the Hampstead residence of Montague Faull.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-