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.

There is a couple of commands that just do what we want: \startcolumns and \stopcolumns. Being a start/stop-something group, we gather from this that all text included between these commands will be typeset in columns. In its simplest form, \startcolumns takes this form:

\startcolumns[n=2]

where n is an actual parameter meaning the number of columns (in this case, a plain vanilla two-column section).
In its more general form, \startcolumns can be called with a lot more parameters, handling the presence of a rule between columns, line height, column background, and the like. In this example, we will limit to the simplest form to simply set up the number of columns.
So, let's wait no more and add lay out "The Shunned House" chapters in columns this way:
  1. Look for \chapter commands.
  2. After every chapter command, add a line with \startcolumns command this way

    \startcolumns[n=2]
    
  3. Starting from second \chapter command, add a \stopcolumns command just before it:

    \stopcolumns
    \chapter{}
    

  4. Just before the \stoptext command, add a final \stopcolumns
  5. Save the file with this name: "TheShunnedHouse_2.tex" and compile it using this command:

    texexec The_Shunned_House.tex
    
  6. You will get a PDF named TheShunnedHouse_2.pdf. Open it and enjoy the text laid out in two columns,

It's just a little step forward our desired result. However, there are a lot of things lacking:

  • Proper page margins
  • Clipart on header, footer and external margin
  • Proper fonts'size, fonts themselves.
  • Too much "seriousness", we're needing some flair.
This is the result. Project files can be downloaded from here


Nessun commento:

Posta un commento