Statistics Explained

Tutorial:Creating PDF version

A Statistics Explained article can always be printed either as a simple print version or as a basic PDF (which can be saved and sent on via mail). This tutorial describes how to insert special print tags so the article can be displayed, saved and printed as an enhanced PDF rather than as a basic one (a simple print version, however, remains always possible after this). The enhanced PDF version has been layouted for a more user-friendly and professional presentation, by the optimal sizing and positioning of its images and by displaying additional text blocks not visible in the web version or, on the contrary, by leaving out sections from the web version less suitable for a printed PDF version.

Displaying images

A major difference between a simple and enhanced PDF is that in a simple PDF images are displayed on the position in which they appear in the wikitext and in one standardised size for all (from small pie chart to big one-page table), while in an enhanced PDF they can be displayed on any position (independent from their place in the wikitext and consequently where they are shown in the page view), with an individually adaptable size and if necessary rotated to landscape instead of the usual portrait view. Below the tags and the parameters for doing so are described.

In order to obtain an acceptable page view for articles with an enhanced PDF version, it is important to group all image links together on top of the article, before the introduction!

Positioning

To position a specific image in a PDF it first has to be uniquely identified (tag <image></image> with parameter imgid) and then the location must be indicated at which it will be displayed in the PDF, in relation to the text (tag <imageput></imageput>):

  • the image tag <image></image> encapsulates an image link of an article, to which parameters for identification and display can be added;
  • with the image identification parameter imgid='image identifier' a unique name image identifier (e.g. figure1) is assigned to a particular image; it is recommended to use as name simply 'table1', 'figure2', 'map3' etc., in line with the caption below the image (nothing more is needed, because the name only has to be unique within a particular article and PDF generation);
  • the image location tag <imageput></imageput> can then be used in combination with the imgid identifier to display this particular image at any chosen location within the generated PDF (possibly requiring some trial and error in the final layouting stage, see below); in wikitext this looks like <imageput imgid='image identifier'></imageput>, with the first part between < > specifying the 'beginning' of the location for table1, and the second one between </ > the closing 'end' of this location. Note that no extra break tags or empty lines should be added before or after the line with this image location tag which in itself already a 'blank' line creating a new paragraph; this would result in extra empty lines in the page view, to be avoided.

Examples

  • identifier (combined with other parameters, see further down):
<image imgid='table1' zoom='80'>[[Image:ENPS_Youth_Population by age class.PNG|thumb|right|350px|Table 1: Population by age class (1 000 persons) - ''Source:'' for the EU-28, Eurostat {{Stable link|title=|code=demo_pjan}}; for the MED countries, Eurostat {{Stable link|title=|code=med_ps112}}]]</image>
  • positioning:
<imageput imgid='table1'></imageput>

Size and orientation

The size and the orientation of an image at a specific location in a PDF can be customised via another set of parameters (fullwidth, zoom, fullpage and rotation), to be inserted within the image tag, right after the identifier tag imgid, separated by a blank:

  • fullwidth='on' displays the image at the maximum width, using the full width of the page (but without automatically rotating it, no auto rotation);
  • zoom='n' ( 0 > n > 100 ) zooms the picture to n % of the page width (see example above, with display at 80 %);
  • fullpage='on' displays the image on one full page, rotating it automatically if necessary to better fit the page;
  • rotation='on' displays the image rotated by 90°.

Examples

  • <image imgid='figure1' fullpage='on'> [[Image:Resource_productivity_2000-2007.jpg|thumb|right|350px|Figure 1: Resource productivity]]</image>
displays Figure 1 on a full page in the PDF, non-rotated
  • <image imgid='figure1' zoom='55'>[[Image:Resource_productivity_2000-2007.jpg|thumb|right|350px|Figure 1: Resource productivity]]</image>
displays Figure 1 with a size reduced to 55 %

Selectively displaying text in web version or PDF version

Via the tags noprint and onlyprint it is possible to have a selected part of an article only displayed in the web version and not in the PDF version for printing; or the opposite, only in the PDF version for printing and not in the web page view.

  • Text available in web version but not in PDF:
<noprint></noprint>: content between tags is not converted into PDF
  • Text available in PDF but not in web version:
<onlyprint></onlyprint>: content between tags is converted into PDF but not displayed on the web page

Page layout

Finally, the additional tags pdfpagebreak and pdflinebreak are available to optimise the page layout in the PDF version:

<pdfpagebreak/> creates a page break in the PDF where it is added;

<pdflinebreak/> creates a hyphenation (splitting a word) in the word where it is added.

Specific tags for an enhanced pdf version

The following tags are required for inserting the right colour of the theme at the begining of the article:

  • <pdftheme>theme number</pdftheme>

The theme number of the article is to be inserted (1 to 9, with 1 = 'General and regional statistics'; 2 = 'Economy and finance'; 3 = 'Population and social conditions'; 4 = 'Industry, trade and services'; 5 = 'Agriculture and fisheries'; 6 = 'International trade'; 7 = 'Transport'; 8 = 'Environment and energy'; 9 = 'Science and technology');

Example for theme 1 (General and regional statistics)