Jump to: navigation, search

LaTeX code for Links

Click here for a plain text version of this LaTeX code.

% commands generated by html2latex


There are four sorts of links in MediaWiki: 
	\item  internal links to other pages in the wiki
	\item  external links to websites
	\item \hyperlink{Interwiki_links}{interwiki links} (links to other wikis)
	\item  inter-language links to other language versions of the same wiki

To add an internal link, enclose the name of the page you want to link to in double square brackets. When you save the page, you'll see the new link pointing to your page. If the page exists already, it is displayed in blue, empty pages are displayed in red. Selflinks to the current page are not transformed in URLs but displayed in bold.

The first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link will have a similar effect as typing a space, but is not recommended, since the underscore will also be shown in the text).

	\item \hyperlink{How_to_link}{1How to link}
	\item \hyperlink{More_advanced}{1.1More advanced}
	\item \hyperlink{How_to_avoid_auto-links}{2How to avoid auto-links}
	\item \hyperlink{Interwiki_links}{3Interwiki links}
	\item \hyperlink{See_also}{4See also}

\subsection{ How to link }
\begin{tabular}\href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{Description} & \href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{You type} & \href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{You get} \\ 
Internal link & \texttt{[[Main Page]]} & \href{/index.php/Main_Page}{Main Page} \\ 
Piped link & \texttt{[[Main Page|different text]]} & \href{/index.php/Main_Page}{different text} \\ 
External link & \texttt{} & \href{}{} \\ 
External link,

different title & \texttt{[ MediaWiki]} & \href{}{MediaWiki} \\ 
External link,

numbered & \texttt{[]} & \href{}{[1]} \\ 
Anchor link & \texttt{[[\#See also]]} & \hyperlink{See_also}{\#See also} \\ 
Anchor link at another page & \texttt{[[Help:Images\#See also]]} & \href{/index.php?title=Help:Images&action=edit&redlink=1}{Help:Images\#See also} \\ 
Category link & \texttt{[[:Category:Help]]} & \href{/index.php?title=Category:Help&action=edit&redlink=1}{Category:Help} \\ 
Internal link to image file & \texttt{[[media:example.jpg]]} & \href{/index.php?title=Special:Upload&wpDestFile=Example.jpg}{media:example.jpg} \\ 
Internal link to pdf file & \texttt{[[media:example.pdf]]} & \href{/index.php?title=Special:Upload&wpDestFile=Example.pdf}{media:example.pdf} \\ 
Interwiki link & \texttt{[[Wikipedia:MediaWiki]]} & \href{}{Wikipedia:MediaWiki} \\ 
mailto link & \texttt{[ email me]} & \href{}{email me} \\ 
redirect & \texttt{\#REDIRECT [[Main Page]]} &  $\rightarrow$ \href{/index.php/Main_Page}{Main Page}

\subsubsection{ More advanced }
\begin{tabular}\href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{Description} & \href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{You type} & \href{/index.php?title=Template:Hl3&action=edit&redlink=1}{Template:Hl3}|\textbf{You get} \\ 
Piped link,

different title & \texttt{[[Main Page|$<$span title="different title"$>$different text$<$/span$>$]]} & \href{/index.php/Main_Page}{different text} \\ 
External link,

same host unnamed & \texttt{[http://\{\{SERVERNAME\}\}/pagename]} & \href{}{[2]} \\ 
mailto named with subject line and body & \texttt{[\%20Encoded\%20Subject\&body=Body\%20Text info]} & \href{}{info}



\href{/index.php?title=Template:Admin_tip&action=edit&redlink=1}{Template:Admin tip}

\href{/index.php?title=Template:Admin_tip&action=edit&redlink=1}{Template:Admin tip}\hypertarget{How_to_avoid_auto-links}{}

\subsection{ How to avoid auto-links }

By default, when you write a URL as is, it will be transformed to an external link.

To avoid that effect, put the URL between $<$nowiki$>$ start \& end tags as in:

\subsection{ Interwiki links }

Interwiki links are links from the local wiki to another wiki. For example you can link to the Sunflower article on by typing \texttt{[[wikipedia:Sunflower]]}. This results in a link like this: \href{}{wikipedia:Sunflower}

Similar to internal page links, you can create piped links, with alternate link text. e.g. \texttt{[[wikipedia:Sunflower|big yellow flower]]}

Basically this is an abbreviation for longer URLs. A very similar link could be created as a normal external link by typing \texttt{[ Sunflower]}, but interwiki links allow you to type out an easy and compact link, almost as if you are linking to a page on your own wiki.

Some interesting things to note:
	\item  Interwiki links are displayed slightly differently to external links, without the little external link icon.
	\item  Complex page names with spaces and other characters are handled elegantly, just as they would be for an internal page link, making this more tidy than creating an external link to a full URL. For example \texttt{[[wikipedia:Sunflower County, Mississippi]]} is in some ways tidier and more elegant than the full URL\nolinebreak: \texttt{\href{}{\_County\%2C\_Mississippi}}

\subsection{ See also }
	\item \href{/index.php?title=Help:Linked_images&action=edit&redlink=1}{Linked images}


Personal tools