Urls In Latex Bibliography

How to cite a URL in BibTeX
Mark Senn
February 11, 2015

How to cite a URL in BibTeX

To cite a URL in BibTeX, put

\usepackage{url} % By default the URLs are put in typewriter type in the body and the % bibliography of the document when using the \url command. If you are % using many long URLs you may want to uncommennt the next line so they % are typeset a little smaller. % \renewcommand{\UrlFont}{\small\tt} between your and command. You may want to uncomment the command, see the the instructions above.

Use, for example,

\cite{Senn:2009} to cite the URL in the text.

Your .bib file should contain, for example,

@manual{Senn:2009, title = "Using {\LaTeX} for Your Thesis", author = "Mark Senn", url = "http://engineering.purdue.edu/~mark/puthesis", year = "2009 (accessed February 3, 2014)" }

Or, if your bibliographystyle does not support the url field (you'll get errors when BiBTeX runs or the output will be wrong), use

@manual{Senn:2009, title = "Using {\LaTeX} for Your Thesis", author = "Mark Senn", note = "\url{http://engineering.purdue.edu/~mark/puthesis}", year = "2009 (accessed February 3, 2014)" }

Email me (see link on second line of this document) if you have questions or problems.

References:

Thanks to Derrick Kearney for sending correct url.sty link.

Revised: February 11, 2015
Created: July 6, 2006

Postby Colin93 » Mon May 30, 2016 9:40 am

Hi Johannes_B

U're right. I need to provide you a better example of what I do...

Here's my main .tex code. Pls click on pdf Viewer as u'll have an error when u run this code. You can nevertheless see the pdf output.

  1. \documentclass[a4paper,12pt]{book}
  2. %You can include all sorts of packages to get additional
  3. %\usepackage[lofdepth,lotdepth]{subfig}
  4. \usepackage{amsfonts,amsthm,amssymb}
  5. \usepackage[utf8]{inputenc}
  6. \usepackage[hyperindex]{hyperref}
  7. \usepackage{nomencl,etoolbox,siunitx,ragged2e}
  8. %You can also define your own mathematics shorthands
  9. \newcommand{\diff}{\mbox{\,d}}
  10. \newcommand{\grad}{\mbox{$\nabla$}}
  11. \newcommand{\divg}{\mbox{$\nabla\cdot\,$}}
  12. \newcommand{\rot}{\mbox{$\nabla\times$}}
  13. \newcommand{\pdiff}{\mbox{$\,\partial$}}
  14. %Please do not mess-up with margins
  15. %\setlength{\textwidth}{15.7cm}
  16. %\setlength{\textheight}{22.3cm}
  17. %\setlength{\topmargin}{0cm}
  18. %\setlength{\oddsidemargin}{.22cm}
  19. %\setlength{\marginparsep}{2mm}
  20. %\setlength{\marginparwidth}{10mm}
  21. %\setlength{\parindent}{0mm}
  22. %\setlength{\parskip}{1.7mm}
  23. %Finally, set fancy headers and footers - you need to make
  24. %minor adjustments to this. But no need to understand all the
  25. %details. Please don't change the style unless explicitly asked to.
  26. %\addtolength{\headwidth}{\marginparsep}
  27. %\addtolength{\headwidth}{\marginparwidth}
  28. \renewcommand{\chaptermark}[1]%
  29. \renewcommand{\sectionmark}[1]%
  30. {\markright{\thesection\ #1}}
  31. \lhead[\fancyplain{}{\bfseries\thepage}]%
  32. {\fancyplain{}{\bfseries\rightmark}}
  33. \rhead[\fancyplain{}{\bfseries\leftmark}]%
  34. {\fancyplain{}{\bfseries\thepage}}
  35. \newcommand{\clearemptydoublepage}{\newpage{\pagestyle{plain}\cleardoublepage}}
  36. \definecolor{mygreen}{rgb}{0,0.6,0}
  37. \definecolor{myred}{rgb}{0.45,0.0,0}
  38. \definecolor{mygray}{rgb}{0.2,0.2,0.2}
  39. \definecolor{mywhite}{rgb}{0.8,0.8,0.8}
  40. \definecolor{mymauve}{rgb}{0.58,0,0.82}
  41. \definecolor{myblue}{rgb}{0.0,0.0,0.48}
  42. \definecolor{myorange}{rgb}{1.0,0.93,0.87}
  43. \lstdefinestyle{CFcode} {
  44. commentstyle=\color{myblue}, % comment style
  45. deletekeywords={this}, % if you want to delete keywords from the given
  46. frame=double, % adds a frame around the code
  47. language=C++, % the language of the code
  48. morekeywords={*,MathFunctions},
  49. keywords=[2]{for,if,else},
  50. keywords=[3]{CFuint,CFreal,RealVector,RealMatrix},
  51. \lstdefinestyle{CFcase} {
  52. commentstyle=\color{myblue}, % comment style
  53. deletekeywords={this}, % if you want to delete keywords from the given
  54. frame=none, % adds a frame around the code
  55. language=bash, % the language of the code
  56. deletekeywords={true,false}
  57. \lstdefinestyle{terminal} {
  58. backgroundcolor=\color{mywhite},
  59. frame=none, % adds a frame around the code
  60. language=sh, % the language of the code
  61. backgroundcolor=\color{myorange},
  62. basicstyle=\footnotesize\ttfamily,
  63. captionpos=b, % sets the caption-position to bottom
  64. commentstyle=\color{myblue}, % comment style
  65. deletekeywords={this}, % if you want to delete keywords from the given language
  66. escapeinside={\%*}{*)}, % if you want to add LaTeX within your code
  67. frame=double, % adds a frame around the code
  68. keywordstyle=\color{mygreen}, % keyword style
  69. keywordstyle=[2]\color{orange},
  70. keywordstyle=[3]\color{red},
  71. language=C++, % the language of the code
  72. morekeywords={*,MathFunctions},
  73. keywords=[2]{for,if,else},
  74. keywords=[3]{CFuint,CFreal,RealVector,RealMatrix},
  75. numbersep=5pt, % how far the line-numbers are from the code
  76. numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
  77. showstringspaces=false, % underline spaces within strings only
  78. showtabs=false, % show tabs within strings adding particular underscores
  79. stringstyle=\color{myred}, % string literal style
  80. tabsize=2, % sets default tabsize to 2 spaces
  81. \newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
  82. \newcommand{\blap}[1]{\vbox to 0pt{#1\vss}}
  83. \newcommand\AtUpperLeftCorner[3]{%
  84. \put(\LenToUnit{#1},\LenToUnit{\dimexpr\paperheight-#2}){\blap{#3}}%
  85. \newcommand\AtUpperRightCorner[3]{%
  86. \put(\LenToUnit{\dimexpr\paperwidth-#1},\LenToUnit{\dimexpr\paperheight-#2}){\blap{\llap{#3}}}%
  87. %\title{\small{Internship Report submitted in fulfilment for the requirement for the Degree of Master's in Fuid Mechanics : Aerodynamics and Aerocoustics at Université Pierre et Marie Curie, Paris} \\\vspace{0.5cm}\LARGE{ Numerical Simulation of a flow in a propulsive system of an MAV}}
  88. %\author{By \textsc{Nathasha SAMARAKONE} \\ Paris, March -- August 2016}
  89. \AtUpperLeftCorner{1.5cm}{2cm}{\includegraphics[scale=0.1]{FIGURES/appa/logo_onera.jpg}}
  90. \AtUpperRightCorner{1.5cm}{1.5cm}{\includegraphics[scale=0.14]{FIGURES/appa/logo_upmc.png}}

0 Replies to “Urls In Latex Bibliography”

Lascia un Commento

L'indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *