martedì 20 dicembre 2011

The Shunned House -- Titles and subtitles, step 3

This post is going to be a little out of context, since it's about structuring your book. Problem is, these subdivisions are going to be somewhat artificial, since "The Shunned House" is a story whose structure is only one level deep. So, I'm going to insert some artificial subdivisions in it.

Like LaTeX, and HTML, context comes with some handy commands for structuring the text. These commands produce titles in a hierarchical way, the same way h1..h4 commands do in HTML. These commands can produce numbered or unnumbered title; since we are designing an RPG, and we want to avoid an overly technical feel, I think that only level-1 titles (chapters) must be numbered, while lower-level heads should not bear numbering. Your mileage may vary, however, and you might not agree with me. That's fine -- I'm no designer, and I've laid out some publicily available games only for fun.


mercoledì 14 dicembre 2011

The Shunned House -- Managing Long Documents, Page size and margins, step 2

Since "The Shunned House" is over 60k characters long, one usually wonders if there is a way to subdivide this document in more manageable pieces. It would be neat to follow document's structure and create a separate file for every chapter, and a central document file to assemble all chapters in a single book.
It turns out that TeX -- and ConTeXt has such a mechanism. The \input <texfile> command tells TeX to search and load a TeX subdocument into the main document. With this feature, we can thus subdivide "The Shunned House" in five chapter, each beginning with \chapter{} and each ending with \stopcolumns.

domenica 11 dicembre 2011

The Shunned House -- Two Columns, Step 1

The Shunned House -- Two Columns, Step 1

Last time we began ptbuilding a ConTeXt page by enveloping the whole text between \starttext and \stoptext. We managed to get a PDF with little effort -- we had to escape an ampersand, and insert proper emphasization commands ( \em ) in lieu of _ characters. Moreover, we also added some semantic commands by inserting the \chapter command at the beginning of every, uh, chapter.
The result, however, is quite bland.
Now let's lay out every chapter text into a two-column layout, so the output start resembling something more professional.

venerdì 9 dicembre 2011

The Shunned House -- From Text To Page, step 0

Let's (really) start.
After I've posted three articles about setting up a proper ConTeXt environment, it's time to get started.
This is the first a series of posts which will show you how I transform an ASCII document into a well-formatted PDF.
What do I mean with "Well-Formatted?" I mean that we will end up with a well formatted two-column book, laid out in an A4-sheet. Two-column layout is somewhat of a standard in RPG world: I think that seven games out of ten use such layout. Columns, however, are not enough: I will show you how to integrate new fonts in the system, how to insert cliparts and add flair to your pages (like, for instance, a background on every page). What I want to get is something not unlike this layout, and this series of posts will show you how to do it.

The Shunned House

For this task, I will use H.P. Lovecraft's "The Shunned House".
Why?
The text is available from Project Gutenberg's Site free of charge. Moreover, it is in the Public Domain, so we can use it without fear of infringing any copyright. Lastly, "Call of Cthulhu" was one of the first game I played, so I have quite a good reason to choose HPL as a starting point for my tutorial.

mercoledì 7 dicembre 2011

Specimen Sheet Generator

When I started dabbling with DTP, one of the big issue I always had there have always been few programs capable to print decent specimen sheets. While there's little about roleplaying in this post, I think that serious indie game designers could really benefit from a proper specimen sheet.
So, in all of its glory, here's the ConTeXt source to create specimen sheets out of Serif, Sans and Mono fonts. As it is, this code works with ConTeXt/pdfTex, using its default fonts.
However, if you properly setup typescripts -- a subject of a next post, rest assured -- you can generate a handy pdf of 21 specimens of your favorite font set.
It's public domain and it's yours to enjoy!

lunedì 5 dicembre 2011

On choosing your weapons

Maybe you already know that ConTeXt is a set of macro that sits upon TeX and eases document authoring. It's like LaTeX, slightly different and less known. What perhaps you don't know is that w32tex comes with no less than THREE flavors of TeX:

  • pdfTex, the old stalwart
  • XeTeX, ported directly from OSX, where fonts "just work".
  • LuaTeX, a TeX engine that uses Lua as an internal programming language.

Each of these engines has its merits and its flaws, when it comes to ConTeXt usage.

  • XeTeX is, by far, the easiest to use when it comes to using fonts other than those provided with the standard TeX distro. It comes from OSX-land, and there, it leverages AAT font handling capabilities. It's been ported on linux and win32, where uses Freetype as font handler. However, when it comes to TYPEsetting, it falls -- at least under Win32 and Linux -- behind LuaTex and pdfTex. It lacks nifty microtypographic features found in the other two engines -- and if you typeset books with narrow columns, this can lead to a lot of unwanted aesthetical oddities.
  • LuaTex is the future. It's quite easy to use OTF fonts, it's got micrographic features, it can leverage advanced OTF capabilities and, if you know the language, you can program new tricks in Lua. Its drawbacks are that it's still under development -- though quite solid and stable -- and, from an indie rpg author's perspective, suffers from some serious problem when it has to lay out figures and floating boxes that spread over more than one column -- More about this in a next post.
  • pdfTex will be my weapon of choice. Sturdy, well-tested, full of features, handles full page width floats, OTF fonts and microtypography equally well. It's just more complicated to set up if you want to use other fonts than Computer Modern. However, once understood, font mechanism is not overly complicated and quite solid to boot

To recap, every code snipped I'll post will refer to the ConText/pdfTeX flavor, unless otherwise stated. I will, however, keep an eye to LuaTeX, since its potential is really enormous.

Where do I start?

So, you want to take the plunge. You googled the net for informations about TeX, ConTeXt (lousy choice, google-wise) and related tools for Windows and were overwhelmed by lots of choices and contradicting informations. You are, in a word lost, and want to know what others have done.
Well, look for no more. My first post will show my setup.
My machine is an humble netbook, equipped with a SU4100 CULV-processor and 4gigs of ram. It's quite dtp-worthy, were not for its screen: I totally hate the 1366x768 format, I think it's a big step backwards for notebook users. :-(
My OS is a Windows 7 Professional SP1. It's as good as it gets, quick, responsive, rock-solid. NEVER experienced a BSOD, and I've got some serious RDBMS on it. (I never experienced a BSOD even on my XP machines from SP2 onwards -- this means 2004 or so, FWIW).
Let's dive into details:
Windows 7 is good. Command-line wise (and for a lot of other tasks), UNIX is better, even if PowerShell has some nifty ideas. With TeX, you will work with DOS shell an awful lot. So, you better download Unix Utils for Win32. There is a lot of good stuff that will help you work with TeX. I'll have you install unxutils first because you need wget to get your TeX distribution. After you've downloaded the zip file and installed somewhere, don't forget to add the path wher.exe files lie to your system path. You need to call those utilities from anywhere within your system!
My favorite TeX distro is W32Tex. It's quite a huge set of downloads (some 400 gigs), and I reccomend that you download all of it. To automate downloading process you can open a dos box and follow these commands:
mkdir textemp
mkdir c:\tex
cd textemp
wget -m -np http://ctan.ijs.si/mirror/w32tex/current/
After you've downloaded all this stuff, go to W32Tex and follow installation directions: these are simply straightforward. You will end up with a TeX distribution containing all you need to create good-looking document, since W32Tex is updated quite frequently.
Next, you'll need a good editor: if you want an IDE, more than a simple editor, you'll want TeXnic Center. Otherwise, the choice is endless. If you have a favorite editor, you'd better stick with it. Emacs and VI are available for win32 as well. I used to be a Notepad++ guy; recently, I've fallen in love with Programmer's Notepad. Small, fast and can use python for plugin building. What's not to love? :-)
You will also need some scripting languages handy:
  • ConTeXt/pdfTeX relies upon Ruby
  • I've written an HTML-to-ConTeXt utility in Python. I also use a GUI tool to set up fonts, and while the current version is written using C#, I plan to port it in Python.
  • And if you want to use some nifty, feature-laden, OpenType fonts you'll need a Perl interpeter to run my own version of texfont, since the one provided with w32tex does work with TTF and Type1 fonts but fails with OTF fonts. The interpreter I use is Strawberry Perl
So, I think it's enough to set up your rig. Happy installing!