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 want to add urls in my reference

i am using the following code in my .tex file

    \bibitem{bl}Business Logic layer, \url{http://en.wikipedia.org/wiki/Business_logic_layer}, 23 12 2011.

however, i get the following output in my console

    ! Undefined control sequence.
    l.477 \bibitem{bl}Business Logic layer, \url
                                        {http://en.wikipedia.org/wiki/Bu...

    ? 
    ! Missing $ inserted.
    <inserted text> 
            $
    l.477 ...rl{http://en.wikipedia.org/wiki/Business_
                                              logic_layer}, 23 12 2011.
    ? 
    ! Extra }, or forgotten $.
    l.477 ....wikipedia.org/wiki/Business_logic_layer}
                                              , 23 12 2011.
    ? 

    ! LaTeX Error: Command \item invalid in math mode.

whereas my .pdf file entry against this code is this.

    Business Logic layer,

http://en.wikipedia.org/wiki/Businesslogiclayer; 23122011

what is this error about and how can i set this right?

share|improve this question
2  
Have you loaded the url package? –  Seamus Jan 6 '12 at 8:58
    
Loading the hyperref should also work, i.e., make the command \url available. –  Mico Jan 6 '12 at 9:02
    
@Mico that's because hyperref loads url –  Seamus Jan 6 '12 at 9:16
    
i m a newbee with latex so trying to learn its tricks, many a times the "how to do this" is not that descriptive. thanx –  Arifah Azhar Jan 6 '12 at 9:16
add comment

1 Answer

up vote 7 down vote accepted

To use the command \url you need to load the url package by adding \usepackage{url} to your preamble.

Many packages (like hyperref) load url automatically.

share|improve this answer
    
thanx a bunch :) –  Arifah Azhar Jan 6 '12 at 9:14
add comment

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.