Text FormattingWebsite address

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sumesh
Posts: 8
Joined: Tue Jun 16, 2009 5:05 am

Website address

Post by sumesh »

How to put website address in latex. Do I have to give each character such as '_' appropriately so that it does not take it as a math font? Or is there an easy way to do it?
Also, in word it appears automatically with a slightly different font and color, which looks better. One has to manually do it in latex?

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Website address

Post by frabjous »

Try loading either the url or hyperref package and then you can do, e.g.:

Code: Select all

\documentclass{article}
\usepackage{url}
\begin{document}
\url{http://www.latex-community.org}
\end{document}
The url package will just allow you to enter it without any special effort, and type-set it with a monospace font. The hyperref pacakge will turn it into a working hyperlink. Typically, it'll put it in a box, but if you want it another color instead, try:

Code: Select all

\documentclass{article}
\usepackage{hyperref}
\hypersetup{colorlinks=true, urlcolor=blue}
\begin{document}
\url{http://www.latex-community.org}
\end{document}
Post Reply