Last modified on 2 August 2013, at 16:45

Using Wikibooks/Print versions and PDFs

In a previous chapter we discussed how to print a Wikibook, assuming a "print version" or "PDF" or "collection" has already been set up.

But what do you do when you want to print out a complete Wikibook, but none of them have been set up yet? Be bold and do the setup yourself. Here's how.

Print VersionsEdit

Print versions are pages which contain all the pages of the book, as well as any other information that should be added to the print version. Print versions are created by creating a new page for the print version, say book name/print version, and then transcluding every page in the book, in the order in which you want them to appear. So if a book called book had the pages A, B, and C, and you wanted to have the print version contain the pages in that order, then on your table of contents page you would add

{{Print version|book/print version}}

near the top to make it display the print version box on the page. Then you would click on the link to the page and put in

{{:book/A}}
{{:book/B}}
{{:book/C}}

and it should include the pages when you click show preview or save.

Further readingEdit

PDF versionsEdit

There are a few ways that you can create PDF versions.

  1. save the print version as a HTML file and open it up in an editor which can export to PDF, then format it and export it.
  2. create the PDF from scratch, copying and pasting text in, and copying the formatting of the web page in your editor
  3. using a script to generate a PDF document from the HTML
  4. Using the Collections Extension (See below)
  5. MediaWiki to LaTeX

there are more ways to do it but I didn't put them in. When you create the PDF file you upload it using Special:Upload and then put in the filename to upload it to, with a short description. Once you have uploaded it you go back to your TOC and add

{{PDF version|filename of PDF}}

which creates the PDF version box on the page

Collections ExtensionEdit

Wikibooks now has a special extension for grouping individual pages together into a group called a collection. Once a collection has been created, there are three options available:

  1. Download a PDF version of the collection
  2. Download an ODT (OpenOffice.Org Text Document) file
  3. Publish a copy by PediaPress, and have it mailed to you.

If we replace the word "Collection" with the word "Book" in the sentences above, we can see a very clear way that this extension can be used here at Wikibooks. In addition to creating an ordinary Table of Contents and a print version, a collection can also be created that will enable PDF versions and published versions to be created quickly for your book.

There are two types of collections: Community collections and personal collections. Community Settings are created as subpages of Wikibooks:Collections. Each book should have only one (or a very limited number) of "official" community versions. The community versions can be advertised using the {{collection}} template on the book itself. Sometimes, individual users prefer a slightly different reading order to the material, or like to add additional chapters from a related book, or remove a few chapters, or any number of small modifications. In this case, the user can create their own collection in their user namespace, as a subpage of Special:MyPage/Collections. Private collections can be edited and shared with other users just like a normal wiki page.

Creating a CollectionEdit

Creating a collection is easy. There are two ways to do it:

  1. When you find a page you want to add, click "Add wiki page" on the left. This will add the current page to the current collection. Continue for all pages you like. When you are happy with your collection, you can go to Special:Collection to edit, save, download, or print your collection.
  2. You can create a collection on a regular page using regular wiki text. Here's an example:
 
  == Title ==
  === Subtitle ===
  :[[Page1]]
  :[[Page2]]
  ;Chapter 1
  :[[Page3]]
  :[[Page4]]
  ;Chapter 2
  :[[Page5]]
  :[[Page6]]

  [[Category:Collections]]

The [[Category:Collections]] at the bottom is important because it indicates to the software that the page represents an extension. To see a list of all pages in this category (and therefore all extensions) go to Category:Collections.

Here are some things that can be in a collection, and the syntax that's used to save them:

Title and Subtitle
A collection can have both a title and a subtitle. In wikitext, the title can be specified as a level-2 heading, and the subtitle can be specified as a level-3 heading. A collection may only have one of each.
Chapters and Pages
In terms of collections, a "chapter" is a large heading that precedes a group of related pages, and a "Page" is an individual page on the wiki. Chapter names can be specified with a semicolon. Pages in a chapter can be specified as a regular absolute wikilink, with a colon in front like :[[My Book/Page 1]], not a relative link like :[[/Page 1]].
Display Title
If you just use a normal link, the page will be titled "My Book/My Page" in the generated PDF and print-on-demand book. If you use a piped link, the display name of the chapter can be changed. So :[[My Book/My Page|My First Page]] will display "My First Page" as the display name in the generated book or PDF file.

Using CollectionsEdit

Once a collection is generated, either by loading pages into your collection one at a time or by loading an existing saved collection, it can be used in a number of ways:

Downloading
A collection can be downloaded in PDF or ODT format
Print on Demand
A collection can be sent to our print-on-demand partner PediaPress and a copy of the book can be mailed to you.