Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Worm Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Var
Template
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> This template is to help facilitate the displaying of variable names (in mathematics, computer source code, wikimarkup, etc.) with the [[Semantic markup|semantically correct]] {{tag|var}} tags, which also renders the variable in italics, as is customary. This method is preferred to simply italicizing for many reasons, including [[WP:Accessibility|accessibility]], [[separation of presentation and content]], [[semantic Web]], and [[WP:METADATA|metadata]]; In [[XHTML]] and [[HTML]], the {{tag|var|o}} element has semantic meaning, while simple italicization does not. "Variable" in this sense may include arbitrary or unknown names or terms, example human input, arithmetical variables in equations, etc. This template (and the underlying XHTML) are generally {{em|not}} used if MediaWiki's {{tag|math}} tags (or any other stand-alone mathematical markup) are being used. ; Example: : {{tlxb|var|username}} outputs the following HTML: : '''{{tag|var|content=username}}''' which renders as: : {{var|username}} Note that on the screen or in print, this renders as simple italicization, as does {{code|<nowiki>''username''</nowiki>}} (using pairs of apostrophes) or {{tag|i|content=username}} (using HTML), yet it carries more semantic meaning than either of these methods. At times, you may wish to use a serif font. This is especially true when attempting to render single-letter variables like "I" (upper-case "i") and "l" (lower-case "L"), since they are nearly indistinguishable (if at all). In such situations, use the {{tlx|varserif}} template instead of {{tnull|var}}, to make them more distinguishable, like these serif examples: {{varserif|I}}, {{varserif|l}}. ; More examples: <div style="background:#FFFFFF;"> {{Markup | <nowiki>The HTML code: : <code>{{tag|var|content=username}}</code> renders as: : {{var|username}}</nowiki> | The HTML code: : <code>{{tag|var|content=username}}</code> renders as: : {{var|username}} | <nowiki>The commandline should read: {{samp|%}} {{kbd|1=ssh {{var|hostname}}}}<br />(where {{var|hostname}} is the IP address or ...)<br />If it is correct, press {{key press|Enter}}.</nowiki> | The commandline should read: {{samp|%}} {{kbd|1=ssh {{var|hostname}}}}<br />(where {{var|hostname}} is the IP address or ...)<br />If it is correct, press {{key press|Enter}}. | <nowiki>in this equation, let {{var|x}}{{=}}1 and {{var|y}}{{=}}120 ...</nowiki> | in this equation, let {{var|x}}{{=}}1 and {{var|y}}{{=}}120 ... | <nowiki>{{para|accessdate|{{var|todays_date}}}}</nowiki> | {{para|accessdate|{{var|todays_date}}}} }} </div> {{Semantic markup templates}} <includeonly> <!-- CATEGORIES BELOW THIS LINE, PLEASE: --> [[Category:Mathematics templates]] [[Category:Programming typing-aid templates]] [[Category:Semantic markup templates]] [[Category:Wikipedia XHTML tag-replacing templates]] </includeonly>
Summary:
Please note that all contributions to Worm Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Worm Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)