Template:T

From Pittsburgh Streets
The {{t}} template performs TeX-like text substitution on its argument.

Unfortunately quotation marks cannot be as simple as they are in TeX.

TeX and MediaWiki assign different meanings to a double apostrophe (''): in TeX a double apostrophe stands for a closing double quote (”), while in MediaWiki it stands for italic text. In order not to disrupt bold and italic wikitext, double and triple apostrophes are preserved without substitution.

Also, in MediaWiki, straight double quotes are used, for example, in HTML attributes and table syntax, so these characters must also be preserved without substitution.

To get a closing double quote, enter a double double quote: "".

The following substitutions are made:

Input Output Notes
----- ⸻ [three-em dash] See also {{3mdash}}.
---- ⸺ [two-em dash] See also {{2mdash}}.
--- — [em dash]
-- – [en dash]
`` “ [opening double quote]
"" ” [closing double quote] Single straight double quotes are preserved without substitution.
` ‘ [opening single quote]
' ’ [closing single quote] Double and triple apostrophes are preserved without substitution.
~   [no-break space]
^   [narrow no-break space] See also {{thin}}.

Usage examples and test cases

  • {{t|from ----- to city line}} → from ⸻ to city line
  • {{t|he swore a furious oath that he would sleep in the fort or in h----l the next night}} → he swore a furious oath that he would sleep in the fort or in h⸺l the next night
  • {{t|Here---there}} → Here—there
  • Here{{t|---}}there → Here—there
  • {{t|1816--1868}} → 1816–1868
  • {{t|Ellsworth's ``Zouaves""}} → Ellsworth’s “Zouaves”
  • {{t|According to Fleming, ``not for the Rev. `Billy.'""}} → According to Fleming, “not for the Rev. ‘Billy.’”
  • {{t|George~T. Fleming}} → George T. Fleming
  • {{t|Charleston, S.^C.}} → Charleston, S. C.
  • {{t|'''bold''' and ''italic'' and '''''bold italic'''''}}bold and italic and bold italic
  • {{t|1=<span style="color: red;">red</span>}}red
{{t|``Bally strange, indeed,"" as ``Dear Cedric"" might remark.

Gen. John Stanwix's name was given to a celebrated frontier fort, now Rome, N.^Y., the new name abstracted from a foreign city.}}

“Bally strange, indeed,” as “Dear Cedric” might remark.

Gen. John Stanwix’s name was given to a celebrated frontier fort, now Rome, N. Y., the new name abstracted from a foreign city.