Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to change the font size of the URLs in my latex document. I did:

\begin{document}
...
\usepackage{url}

Figure 1: \scriptsize{\url{my url}}\\
Figure 2: \scriptsize{\url{my url}}
...

The problem is that these commands make the font size of the "Figure 2" also in \scriptsize and I don't want that.

Can someone help me?

share|improve this question
4  
Welcome to TeX.sx! The font changing commands don't take an argument, but are "declarations": {\scriptsize\url{...}} should do. –  egreg Jan 2 '13 at 21:35

1 Answer 1

up vote 7 down vote accepted

According to url, a quick fix would be to redefine \UrlFont, perhaps as follows

\renewcommand{\UrlFont}{\scriptsize}

However, the documentation also says that it would be better to define your own url-style (which would be a bit more involved).

\documentclass{article}
\usepackage{url}

\renewcommand{\UrlFont}{\scriptsize}

\begin{document}

Figure 1: \url{my url}

Figure 2: \url{my url}
\end{document}
share|improve this answer
    
This will change the size of all URLs in the document –  egreg Jan 2 '13 at 21:52
    
@egreg indeed, that was my intention :) the OP said that he would like to change the size of 'the urls' –  cmhughes Jan 2 '13 at 21:55
3  
Although not economical, you could use \newcommand{\URL}[1][\scriptsize]{\renewcommand{\UrlFont}{#1}\url}, which allows you to use \URL[\normalsize]{...} for fun. –  Werner Jan 2 '13 at 22:15
    
For me the best solution was to use \let\OldUrlFont\UrlFont \renewcommand{\UrlFont}{\small\OldUrlFont} instead, which allows to keep the URL format and just adds your prefered font size. –  matheburg Mar 25 at 12:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.