Help:Printing: Difference between revisions

Content deleted Content added
Gadget850 (talk | contribs)
Cleaned up
 
(40 intermediate revisions by 23 users not shown)
Line 1:
{{redirect|WP:PRINT|guidance on sources in print|Wikipedia:Offline sources}}
{{Redirect|WP:PRINTABLE|the guidelines on printworthy page titles|Wikipedia:Printability}}
{{Use dmy dates|date=October 2014}}
{{Wikipedia how to}}
{{nutshell|To print a Wikipedia page, select File → Print from your web browser, or click on the browser print icon.}}
 
In general, printing a Wikipedia page[[wp:article|article]] is as simple as selecting ''printPrintable version'' from yourthe webtools menu on the sidebar or at the top-right. Your browser probably has its own print preview feature.
 
The [[MediaWiki]] software that Wikipedia runs on uses [[Cascading Style Sheets]] in order to specify the style and layout ofthat theis suitable to a printableprinted version of athe page. In modern browsers, the print function of the browser should automatically use the rules in the style sheets when you print an article, therefore the ''print'' command of your web browser is allalso you normally need to useuseful.
 
Certain page elements normally do not print; these include [[wp:self|self references]] like section edit links, navigation boxes, message boxes and metadata.<ref>The rationale for not printing navigation boxes is that these items contain [[wp:wikilinks|wikilinks]] that are of no use to print readers. (See [http[User talk:Ruud Koot//en.wikipedia.org/w/index.php2010#Do you recall the reason?title=User_talk:Ruud_Koot&oldid=341560230#Do_you_recall_the_reason.3F]]) There are two problems with this rationale: First, other wikilink content does print, ''for example'' [[wp:ALSO|See also]] and [[Wikipedia:WikiProject Succession Box Standardization#Overview|succession boxes]]. Second, navigation boxes do contain useful information regarding the relationship of the article to the subjects of related articles.</ref>
 
==Printable version==
The default Vector skin has a selection in the lefttools sidebarmenu forat ''Print/export''—the selectingtop-right this will showfor ''printablePrintable version''. All other skins show ''printable version'' directly in the sidebar. This printable version is often misunderstood, as it is not exactly a print preview. It does not show page numbers, headers and footers applied by your browser. For a proper print preview, use the one supplied by your browser.
 
Print page is not needed for any modern browser, as these browsers will parse the <code>media="print"</code> CSS styles included in the markup of Wikipedia pages. The print rules are applied automatically when the page is printed or previewed from the browser.
Scripts such as [[User:TheDJ/Sharebox|Sharebox]] may change the ___location or function of the print link.
 
Printable version isdoes not needed for any modern browser, as these browsers will parse theapply <code>@media=" print"</code> CSS styles included in the markup of Wikipedia pages. The print rules arefrom applieduser automaticallystyle when the page is printed or previewed fromsheets, thesee browserbelow.
 
Older browsers do not automatically apply print rules when using the browser print feature. These browsers include these versions and older:<ref>{{cite web |title=CSS print media browser conformance |url=http://www.codestyle.org/css/media/print-BrowserSummary.shtml |work=Code Style |accessdate=11 November 2009}}</ref>
* Internet Explorer 3.0 for Windows
* Internet Explorer 4.01 for Mac
* Netscape Navigator 4.73
* Firefox 5 and lower
 
Printable version does not apply <code>@media print</code> rules from user style sheets— see below.
 
The print stylesheets are called by link elements on every Wikipedia page such as:
 
<code><link rel="stylesheet" href="/skins-1.5/common/commonPrint.css?207xx" type="text/css" media="print" /></code>
 
Older browsers do not support <code><link media= "print"></code>, thus they will ignore this statement and will not automatically apply the printing rules. For these browsers, the printable version is useful. These browsers include these versions and older:<ref>{{cite web |url=http://w3development.de/css/assigning_external_css/link.html |title=Assigning external CSS > link |accessdate=9 April 2009}}</ref>
* Internet Explorer 6
* Netscape Navigator 4
 
==Plain text==
The Printable version does not contain embedded links or other HTML markup, thus it can be used as a source to cleanly copy and paste into other documents.
 
==CSS==
TheMediaWiki baseprovides MediaWikia print style sheet is at [http://en.wikipedia.org/skins-1.5/common/commonPrint.cssspecific http://en.wikipedia.org/skins-1.5/common/commonPrint.css]styling. This style sheet can be edited only by the developers.
 
The Wikipedia specific print style sheet is at [[MediaWiki:Print.css]]. This style sheet can supplement and override the base; it can only be edited by admins[[Wikipedia:Interface administrators|interface administrators]].
 
===Classes===
Line 44 ⟶ 27:
 
===@media print===
CSS media types define the rules for different types of presentation media. The normal display uses <code>@media screen</code> rules; printing rules can be defined with defined <code>@media print</code>.
 
==Controlling print==
 
===Elements===
When creating a new element that should not print, the noprint class can be applied; for example:<syntaxhighlight lang="html">
<pre><span class="noprint">foo</span></pre>
 
</syntaxhighlight>Here, the content ''foo'' would display, but not print. You can also use {{tl|noprint}}, a template wrapper for the <code>noprint</code> class. Some other templates, such as {{tl|unprintworthy-inline}}, also include the <code>noprint</code> class.
<pre><span class="noprint">foo</span></pre>
 
Here, the content ''foo'' would display, but not print. You can also use {{tl|noprint}}, a template wrapper for the <code>noprint</code> class. Some other templates, such as {{tl|unprintworthy-inline}}, also include the <code>noprint</code> class.
 
Conversey, for an element that should print but not show on the display, use the <code>printonly</code> class:
 
<pre><span class="printonly">foo</span></pre>
 
This is normally applied to linked citation numbers and document IDs.
 
To use or display elements {{em|only}} in [[Help:Books|PDF or book print rendering]], you can use the templates {{tl|Hide in print}} and {{tl|Only in print}}.
 
===Personal customization===
Line 67 ⟶ 40:
 
;Print URLs for references in citation templates:
<sourcesyntaxhighlight lang="CSS">/* print URLs for references */
# content cite a.external.text:after {display: inline;}</sourcesyntaxhighlight>
* Note: URLs will always print for references that do not use citation templates
 
;Do not print references:
<sourcesyntaxhighlight lang="CSS">/* do not print references */
@media print {
ol.references, a.references-small {display: none;}
}</sourcesyntaxhighlight>
 
;Change the print font size:
<sourcesyntaxhighlight lang="CSS">/* save ink and paper with very small fonts */
@media print {
#footer,
Line 92 ⟶ 65:
font-weight: normal;
}
}</sourcesyntaxhighlight>
 
;Remove: space above title, remove "From Wikipedia, the free encyclopedia", URL, categories, modification text and license text
<sourcesyntaxhighlight lang="CSS">/* Remove non-essential elements */
@media print {
.firstHeading { margin-top: 0; padding-top: 0; }
Line 102 ⟶ 75:
#catlinks, .catlinks { display: none; }
#footer { display: none; }
}</syntaxhighlight>
}</source>
 
==Problems==
===Blank pages in Internet Explorer===
{{shortcut|WP:IEPRINTFIX}}
When printing with Internet Explorer 7, some pages may be blank except for the header and footer; this can be seen in the browser print preview. The style sheets have rules to adjust the line height for improved readability with superscript and subscript text, including references. IE apparently has problems with the <code>line-height</code> CSS property. This issue appears to be resolved in Internet Explorer 8.
 
Rules to resolve this problem were added to Common.js. If the problem is still experienced, browse to [[MediaWiki:Common.js]] and follow the instructions at the top of the page to bypass your browser cache.
 
{{hidden
| css = border:1px solid black; width: 80%;
| header = Old fix
| content =
This is the old way to resolve this issue, now deprecated by the change to MediaWiki:Common.js.
* Ensure you have an account and are logged in
* Edit your [[Special:MyPage/skin.css]] and add:
 
<source lang="CSS">@media print {
sup, sub, p, .documentDescription { line-height: normal; }
}</source>
* [[Wikipedia:bypass your cache|Bypass your cache]] per the instructions at the top of your CSS page
}}
 
==Linking==
Line 137 ⟶ 89:
==See also==
* [[Help:Cascading Style Sheets]]
* [[Help:Books]]
* [[User:TheDJ/Print options]]— a script that gives you greater control of how Wikipedia pages are printed.
 
Line 146 ⟶ 97:
* {{cite web|url=http://www.w3.org/TR/CSS21/media.html#at-media-rule|title=Media types|work=Cascading Style Sheets Level 2 Revision 1 (CSS&nbsp;2.1) Specification|publisher=World Wide Web Consortium (W3C)|accessdate=8 April 2009}}
 
{{Wikipedia technical help|collapsed}}
[[Category:Wikipedia interface help|Printable version]]
[[Category:Wikipedia sidebar help|Printable version]]