維基教科書:可打印版

維基教科書,自由的教學讀本

The aim of Wikibooks is to create useful books. Sometimes people want to print a book, but it is not easy, because books at Wikibooks are divided into chapters on separate pages. However, anyone knowing how to use templates, can easily create a print version of a book, by automatically including all contents of a book onto a single page. Furthermore, with all content of a book on a single page, it is easier to create a PDF version of this book. This can be done automatically, for example using OpenOffice.org or the "Print to file" feature of your browser. (either to a pdf or PostScript file - the ps is easily converted to pdf later).

Not every book needs a print version — lots of books here are useful only online. But if you feel one might need to get a book printed — be bold and create it. See Category:有可打印版本的書 for a list of books that already have a single page version for continuous reading. Many of these may also be available as PDF Files.

How to create print version[編輯]

Generally, it is a good solution to learn from example. See Python Programming/Print version and read these quick guidelines.

Preparing book[編輯]

No navigational templates used in a book should be printed. Check this using "Print preview" function of your browser. To prevent block of text from being printed, cover it with <div class="noprint"> ... </div>. Use class="notice" or class="notice metadata" for cleanup templates like {{stub}}, {{cleanup}}; or <noinclude> ... </noinclude>. Similarly, if you want some content to be displayed only in print version but not at normal reading, use <includeonly> ... </includeonly>. Note that text inside this tag won't be visible in page preview during editing, so you may want to copy it to Wikibooks:Sandbox, edit it there and copy back.

Creating separate page for print version[編輯]

In brief:

  1. Create page Book/Print version and link to it from TOC
  2. Insert {{print version notice|Book|Book/Print_version}} template to its top
  3. Copy the TOC as an ordered list
  4. Insert every chapter like a template, preceded by chapter title. Remember about chapter with list of authors.
    = Chapter name =
    {{:Book/Chapter name}}
  5. Insert text of GNU Free Documentation License by adding:
    = GNU Free Documentation License =
    {{:GNU Free Documentation License}}

Do not cut-and-paste any text from book to its print version (except TOC).

Linking from the book[編輯]

Make a visible link to the print version from the book's cover or table of contents. You can simply insert the {{可打印版本}} template in the printed version's parent directory to create a box like the one shown. If you make your own links, it's a good practise to have a direct link to the edit page for the print version so that people who want to change something in the print version won't have to wait until the whole book is loaded to click the "edit" button.

Lengthy print versions[編輯]

Sometimes print versions become too lengthy — in such cases, you should divide it into parts: Book/Print version/Part 1, Book/Print version/Part 2.

Copyright problems[編輯]

Using fair use images in a book may mean that it can't be printed in many countries that don't have a fair use copyright law, and even in countries that do, books printed with fair use images may have restrictions placed upon them. For example, there may be restrictions upon commercial sale of the book (for profit or not). Because of this, always avoid fair use images if it is possible and try to replace them by free ones (you might try to search Wikimedia Commons).

If you have to include fair use images, consider excluding them from print versions of the book. You can for example cover images with noprint markup, as it was explained above.

Use of printed books[編輯]

You can freely use, copy and sell printed books — you don't have to get authors' agreements or share profit with them (see details). Remember that Wikibooks has copyrighted content, and the copyright is owned by the contributors, not the Wikimedia Foundation. The reason you can freely copy and use this content is because it is all available under the terms of the GNU Free Documentation License. Please read that license carefully if you plan on distributing Wikibooks content for the terms of use.

If you want to have the content available under different terms, you have to contact all of the contributors to the Wikibook for permission, which may present some problems if you can't get ahold of some of them. A very few Wikibooks are also available under a dual-licensing arrangement subject to different terms as well. This should be clearly marked and noted on the front page of the Wikibook.

We are thinking of professional print of some wikibooks. See Wikibooks:Wikibook Press.

PDF版本[編輯]

It's easy to create a rudimentary PDF file from a print version. You can use freely available software like OpenOffice.org or PDFCreator, although some complex formatting may be better preserved by proprietary software, such as Microsoft Word or Adobe Acrobat.

Unfortunately the "print versions" do not contain proper pagination. Pagination, paginated tables of contents and indexes are added by editing the print version with a word processor and creating a PDF File. Save the print version to your own computer as "web page complete" and use the HTML-compatible word processor of your choice to paginate the book. In Microsoft Word, this can automatically be done for you by selecting Insert > Field > Index and Tables > TOC. The word-processed document can then be converted to PDF using OpenOffice.org or PDFCreator.

Tips: cut the book into numerous small HTML files using 'Wordpad' as a text editor if it will not convert to your word processor format. This allows you to locate offending sections etc. Small books can be copied to the clipboard and then pasted into your word processor. (see Talk for more tips).

Also a ready to publish "print version" takes as much effort as creating the book in the first place. There is an entire field out there, including Typesetting and Desktop Publishing, that deals with the subject. And there are dedicated programs like Adobe InDesign, Scribus, and LaTeX/TeX that are specifically made for the task of typesetting. Microsoft Word is suitable for the task, but anyone who plans on doing it in the long term will appreciate the advanced features like kerning, ligatures, word stretching and automatic quality justification algorithms that these programs offer. For example, LaTeX automatically generates Table of Contents and Indicies for you.

PDF files can be uploaded to Wikibooks just like images. But remember: don't link to PDF like this: [[Image:file.pdf]]. This causes the entire PDF to be downloaded when loading the page. Use [[:Image:file.pdf]] — this will link to the PDF's description page — or [[Media:file.pdf]] for a direct download link. Remember to tag the file as GFDL and include the edition number in the comment. Also remember not to use a simple URL link to download the PDF, because the PDF will be shown in unused images list. Instead, use Media: link (for instance: [[Media:special_relativity.pdf]]).

See: Wikibooks:PDF版本

Tips on PDF versions[編輯]

Some lingo first of all. 12 points to a pica, 6 pica to an inch. Points usually measure vertical distance, pica usually measure horizontal distance. For example, the height of fonts are measured in points. Size 12 Roman font is about 12 points high. The width of columns are usually measured in pica.

  • Golden Rule: Rules in layout and art ain't rules. If it looks good, then do it. Think of these as guidelines if you don't know where to start.
  • Keep things consistent. Use templates in GUI based programs like Word or InDesign, or use macros in LaTeX to keep pages as a whole consistent.
    • Keep consistent spacing between lines. Usually 120% of the size of the font is used for paragraph reading. For example, size 12 font is spaced by ~14 points. Size 14 font would be spaced by ~16 points. Headlines, nameplates, and so forth don't follow this rule. Only body-text.
    • When there is a picture, make sure the space between the words and the start of the picture is consistent. If it is inlined with the text, make sure all 3 or 4 sides of the picture are consistently spaced from the text. If the picture has its own space, say, centered with a caption, make sure the caption is consistently placed, along with the spaces away from the text above the picture as well as below.
  • Don't do full justification unless it looks good! When you do full justification with an inadequate program, you easily can get "rivers" of whitespace that is distracting for the reader. Programs with better justification algorithms, like LaTeX or InDesign may still mess up if the columns are too narrow. The best solution is usually to change the wording of the paragraph, but switching to ragged right or increasing the column width helps as well.
  • Hyphenation should only occur in full justification (both left side and right side lined up). Hyphenation in ragged right looks strange, and thoughts and words can get lost as the reader looks for the next line.
  • Don't bold too many things. Bold can get in the way of your text in ways that softer italic emphasis doesn't. It is fine to bold headlines or other attention grabbers, but in the body text, try with soft italics first.
  • If doing a complicated layout, try the 5 column layout (don't actually use 5 columns. Maybe merge the right 3, and merge the 2 left side columns for notes. Or merge 3 columns to inline a picture in the middle of the page), or the artists rule of 3 to create a layout.
  • Know the difference between the hyphen, endash, and emdash. Emdash is the longest, and is used in as a punctuation mark. Endash is used as "to" between numbers. Hyphens are usually the shortest and connect words between lines and compound words.
  • Finally: Read the PDF when you are done! Frequent trouble spots are tables, pictures, and the text around large headings. Keep an eye out for widows and orphans, or words on their own lines, or on the next page when a paragraph ends. Don't be afraid to change the words of a paragraph to fit the layout, in fact, it has to be done frequently.
  • Hagindaz created a template: PDF template.sxw for OpenOffice for creating PDF versions. Example of OpenOffice.org document.

Tools[編輯]

  • WikiType is a web-based tool that passes over the book tree and generates a PDF in either full or e-book size (including table of contents)
  • Wiki2LaTeX converter (Java application)
  • Derbeth's Print Version Creator is a small web-based tool taking table of contents of a wikibook and producing text file with wikicode of print version of a book

Proposals for print versions[編輯]

You can write your suggestions below.

  • Make a Wikitext to DocBook converter. Process the DocBook to a PDF. See DocBook XML export on Meta.
    • DocBook then can be converted to LaTeX to produce printouts with an even higher quality. --uk:vityok

It may be better to remove the Title/Print, and only display the Title at the top of the page when printing in the print view. Just from my own experience with PDFCreator, you can't remove the /Print, so the title looks unprofessional. Cjermain (talk) 17:15, 27 December 2007 (UTC)