673

I'm looking to cite a number of web pages using bibtex and I was wondering if there was a specific template of the form @<template name here> for doing that. If you could use the following website as an example that would be great

http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm

  • 2
    As an extra thing here - I just found that if you are want to attribute the site name as author (for example if I wanted to say that the author of this page was 'Stack Overflow' it's best to put 'Stack Overflow' as the `key' field, rather than the 'author' field. Because then latex formats as 'Stack Overflow' and not 'S. Overflow'. (might only apply with Harvard style) – Joe Oct 07 '12 at 12:19
  • 2
    a nice resource covering, inter alia, natbib and biblatex (with screenshot-snippets of the PDF) is here: http://nschloe.blogspot.de/2009/06/bibtex-how-to-cite-website_21.html – nutty about natty May 01 '13 at 08:17
  • 1
    Re @Joe's comment: You can force BibTeX to treat the author name as something that cannot be abbreviated, by enclosing it in an extra pair of curly braces: author = {{Jemison Laboratory}},. Works for natbib, at least. – Mars May 18 '16 at 16:50
  • The most convenient way is to use cite maker website, take for example, bibme. It will be most preferred one also for you I guess. – Nihad Huseynov Apr 19 '22 at 13:48

8 Answers8

811

A simple way of doing it in BibTeX is with a @misc entry:

@misc{WinNT,
  title = {{MS Windows NT} Kernel Description},
  howpublished = {\url{http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm}},
  note = {Accessed: 2010-09-30}
}

You should also perhaps include an author if you know it. And remember to load a package such as hyperref or url.


If you are using BibLaTeX there is an @online entry type:

@online{WinNT,
  author = {MultiMedia LLC},
  title = {{MS Windows NT} Kernel Description},
  year = 1999,
  url = {http://web.archive.org/web/20080207010024/http://www.808multimedia.com/winnt/kernel.htm},
  urldate = {2010-09-30}
}
Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
  • 31
    +1 for the way to include the access date (very important!). There's an alternative way that uses howpublished to include the \url{} and [Acccessed: 30 September 2009], but that might not be style-independent. It's a little frustrating that BibTeX didn't officially keep up with web pages as an entry. – Fuhrmanator Aug 27 '12 at 15:35
  • 15
    There is a urldate field for biblatex, that acts as an accessed date field. – naught101 Oct 15 '12 at 02:22
  • 2
    Not sure if it's related to my specific configuration, but Biber kept complaining about the urldate field until I changed it to {2010-09-30}. – Pieter Mar 26 '13 at 14:28
  • 5
    Thanks! For web sites that are dated, I prefer to use the month and year fields, but for sites that are undated, putting the date of access in the note field is a good way to go. – Nagel Oct 30 '14 at 13:15
  • Some bibtex styles, e.g. Gost, also provide @online entry type. – Igor Kotelnikov Dec 27 '15 at 13:36
  • Is there a way to force @misc appear at the end? Because empty authors go first. – Paschalis Jan 06 '16 at 11:09
  • 2
    @Paschalis I would suggest writing the name of the site/organization as the "author", and the name of the page/article as the "title". – Juan A. Navarro Jan 06 '16 at 18:52
  • Note that, it is also helpful to provide the year information. Otherwise the citation is not going to be shown as numbers inside square brackets but as letters. year = {2008} – anilbey Aug 08 '17 at 10:25
  • What should I used as the year field? Is it when the website was first made available? For example, I have to cite some programming tool website, but I don't have any information about the year. – Rafael Eyng May 21 '19 at 22:54
  • 1
    For specifying that specific packages need to be used – timbo Aug 02 '19 at 21:04
  • 3
    Great answer, @misc entry and howpublished with \url{} field seems the way to go. Check out the website bibtex.online to convert BibTeX to other formats such as APA, MLA or Chicago – David Oct 09 '19 at 17:45
  • What does that {MS Windows NT} mean? Why is it bracketed? – Minh Nghĩa Mar 21 '20 at 06:35
  • 2
    It's bracketed to tell BibTeX to not modify the case (uppercase/lowercase) of letters in the text within the brackets. For things outside of the brackets, and depending on the context, BibTeX might decide to write e.g. "Kernel Description" or "kernel description"; but "MS Windows NT" will always be cased as specified. – Juan A. Navarro Mar 21 '20 at 18:30
84

I always use the defaults suggested by Wikipedia (see "BibTeX entry" at the bottom), available if you click on "cite this page".

MaxSem
  • 103
Habi
  • 7,694
  • 7
    Neat trick. I had to change url to howpublished to make it work. How do I get that view for other wikipedia pages? – krupan Jan 08 '13 at 19:08
  • 1
    @krupan I have no idea what you mean by "other wikipedia pages". What pages do you want to cite? – Habi Jan 10 '13 at 12:07
  • 3
    @krupan in the left of every page you can found a link Cite this page, it complete the link that @habi provides with the current wikipedia page. – Arturo Volpe Jan 22 '15 at 19:55
  • @krupan Did Arturo answer your question? It might be of use to our other "TeXers" – Nathan majicvr.com Nov 02 '19 at 04:58
  • For some reason I don't see a "cite this page" link to click on – krupan Nov 03 '19 at 17:37
  • @krupan: It's in the left sidebar of every Wikipedia page, found unter 'Tools'. Here's a screenshot: https://cl.ly/6091a9 – Habi Nov 04 '19 at 19:38
  • 1
    I see it now, thank you. It's not there on mobile (even when I request the desktop site). – krupan Nov 05 '19 at 20:37
  • The citation-generation link seems to have moved at some point to the Tools entry in the menu bar at the top of the page. There's an entry for Cite this page. – radical7 Apr 24 '23 at 16:06
24

The JabRef reference manager suggests to use the "electronic" type. So I do it like this:

@electronic{Rub1,
 author = {Rubino, Daniel},
 editor = {{Windows Phone Central}},
 title = {IE9 for Windows Phone 7: Adobe Flash, demos and development},
 url = {http://www.wpcentral.com/ie9-windows-phone-7-adobe-flash-demos-and-development-videos},
 urldate = {14.01.2013},
 originalyear = {18.02.2011}
}

In the BibTeX export of Citavi there is als the type "www". Depending on your editor you have to define the styles "electronic" and "www", so "misc" seems to be probably the safest.

But then you should use \bibliographystyle{alphadin} and do it like this:

@misc{Rub1,
 author = {Rubino, Daniel},
 editor = {{Windows Phone Central}},
 title = {IE9 for Windows Phone 7: Adobe Flash, demos and development},
 url = {http://www.wpcentral.com/ie9-windows-phone-7-adobe-flash-demos-and-development-videos},
 lastchecked = {14.01.2013},
 originalyear = {18.02.2011}
}
Benny Code
  • 3,042
  • Nice! "@electronic" made the URL visible when using the CSL file at http://www.zotero.org/styles/ieee . – Robert Pollak Jun 18 '18 at 11:16
  • if I use alphadin then there is no bib key in references. strange – Nils Zenker Jun 07 '19 at 12:20
  • Should urldate be the current dat? or can I obtain its original created date from the url? @Benny Neugebauer – alper Oct 29 '19 at 13:08
  • I'm lazy. Does JabRef have a tool that will automatically generate a citation when pointed at a StackExchange post like this one? Citing SE posts can be burdensome because of the often large number of contributors. – Shawn Eary Oct 22 '21 at 15:56
11

I found a very good tutorial on http://www.polymtl.ca/biblio/utiliser/guide_bibtex.pdf (French; the link is now dead, available at the Wayback Machine)

With this, i have modified the ieeetr.bst file to integrate the ignored tags url and urldate to all the types of entries (style was imposed for the report at the end of study).

The file was renamed (mystyle) and placed in the same local folder as the ref.bib file. Called with

\bibliographystyle{mystyle}
\bibliography{ref}

(1) add the new entries :

ENTRY
  { address
...
    url
    urldate
  }
  {}
  { label }

(2) add this function

FUNCTION {format.url}
{ url empty$
    { "" }
    {   
        ". \emph{Disponible}~\url{" * url * "}" *
        urldate empty$
         { "there is url but no urldate in " cite$ * warning$ }
         { 
            "~(\emph{consult\'e le} " * urldate * ")" *
         }
         if$
    }
  if$
}

(3) for all types, call the function with format.url "" output ! Example for @incollection:

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  format.title "title" output.check
  blank.sep
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.number.series output
      format.chapter.pages output
      format.addr.pub "publisher" output.check
      format.edition output
      format.date "year" output.check
    }
    { format.incoll.inproc.crossref output.nonnull
      format.chapter.pages output
    }      
  if$
  format.url "" output 
  new.block
  note output
  fin.entry
}

I hope it can help you

Neinstein
  • 103
madit
  • 753
10

Hm, it would seem that it isn't possible to cite webpages directly, but there does seem to be a workaround using the general purpose @misc field.

https://texfaq.org/FAQ-citeURL

David Carlisle
  • 757,742
7

If you are creating your own bst file and you want it to incorporate web references, I use this function:

FUNCTION {internet}
{ output.bibitem
  format.titleclass output
  format.authors " " * "author" output.check
  title empty$
    {""}
    { title "t" change.case$ * ".\,\ " *}
  if$
  format.address output
  publisher empty$
    {
      institution empty$
        { }
        { institution "; " * output}
      if$
    }
    { publisher "; " * output}
  if$
  year empty$
    { " [date unknown; " }
    { year
      month empty$
        { " [\ignorespaces " * }
        { "~" * month * " [\ignorespaces " *}
      if$
    }
  if$
  revised empty$
    { "" * }
    { "revised~" * revised * "; " *}
    if$
  accessed empty$
    { "" * }
    { "accessed~"  * accessed * "]. " *}
    if$
  website *
  doi empty$
    {}
    { add.period$ " " * doi * }
  if$
  output
  add.period$
  format.referenceclass output
  fin.entry.noperiod
}

This with bib file entries like

@INTERNET{www11b,
    AUTHOR    = "Schultheis, J. D.",
    TITLE     = "Fun with Reference Citations",
    ADDRESS   = "Baltimore (MD)",
    PUBLISHER = "Random House",
    YEAR      = "2013", 
    MONTH     = sep # " 10",
    ACCESSED  = "2014 " # sep # " 26",
    WEBSITE   =
             "http://en.wikipedia.org/wiki/Trajectory\_of\_a\_projectile",
    DOI       = "\url{doi:10.10.1038/nphys1170}"     }

@INTERNET{www11a,
    TITLE    = "Flight Equations with Drag",
    WEBSITE  = "http://www.grc.nasa.gov/WWW/k-12/airplane/flteqs.html",
    ACCESSED = "2011 " # oct     }

@INTERNET{www11c,
    AUTHOR   = "Grissom, Gus",
    INSTITUTION = "Glenn Research Center, National Aeronautics
                   and Space Administration",
    TITLE    = "Flight Equations with Drag",
    ADDRESS  = "Cleveland (OH)",
    YEAR     = "1999",
    MONTH    = dec # "12",
    REVISED  = "2014 " # jun # " 12",
    ACCESSED = "2014 " # oct # " 7",
    WEBSITE  = "http://www.grc.nasa.gov/WWW/k-12/airplane/flteqs.html"}

@INTERNET{manktelow2010history,
    TITLE     = "History of taxonomy",
    AUTHOR    = "Manktelow, Mariette",
    WEBSITE   = "\url{http://www.atbi.eu/summerschool/files/%
                summerschool/Manktelow\_Syllabus.pdf}",
    ACCESSED  = "2014 Aug~26",
    ADDRESS   = "Uppsala (Sweden)",
    PUBLISHER = "Uppsala University Dept. of Systematic Biology",
    YEAR      = "2010"     }

@INTERNET{smith2014metcalf,
    TITLE    = "Assault on california power station raises alarm on
                potential for terrorism",
    AUTHOR   = "Rebecca Smith",
    WEBSITE  = "\url{http://online.wsj.com/news/articles/%
                SB10001424052702304851104579359141941621778}",
    ACCESSED = "2014 Aug 26",
    PUBLISHER= "The Wall Street Journal",
    MONTH    = feb,
    YEAR     = {2014}     }

I get this result:

enter image description here

2

Try this, please:

@misc{AdamsManual1,
  author = {MSC.\hspace{2pt}Software\hspace{2pt}Corporation},
  title = {{Adams Manual: Tire Models, using the Fiala handling force model}},
  howpublished = {\url{https://www.mscsoftware.com/product/adams; https://www.coursehero.com/file/13499609/tire-models/}},
  year = 2005,
  note = {Accessed: 2021-03-20}
}

The output:

Screenshot of the output of the above code.

The Amplitwist
  • 71
  • 1
  • 18
0

Thanks from me, I could use this Question thread to solve my problems with URL citations. I think, my solution adds a bit flexibility.

This part extends the answer from @madit:

For online publications there is not only an URL, but also a DOI (See Wiki: https://en.wikipedia.org/wiki/Digital_object_identifier, example: https://doi.org/10.1002/andp.19163540702) for a specific source, for example in journals (i.e. Nature, Science, ...) and also academic eBooks.

So it is often desired to cite with a DOI instead of an URL with a date of access.

So in the same folder as main.tex are the style file bibstyle.bst and the bibliography source file myRefs.bib.

In main.tex, the bibliography is created by:

\bibliographystyle{bibstyle}
\bibliography{myRefs}

In bibstyle.bst multiple adjustments need to be made:

  1. At the beginning, new possible entries (doi, url, urldate) need to be created:
ENTRY
  { address
    ...
    doi
    ...
    url
    urldate
    ...
  }
  {}
  { label }

  1. Then, a new function needs to be created, that formats the new entries into a part of the final citation. Here, I worked from the code of @madit, but I included the preferred option for the DOI and I changed the return for no URL or DOI from { "" } to 'skip$. Unless the last adjustment is made, it may throw an error along the lines of ---the literal stack isn't empty for entry MyCitation. The reason is basically because LaTeX may not handle an emtpy string well instead of no return, when building the citation text. Additionally for the DOI output, I linked it via the official doi website (https://doi.org/) to guarantee that the link works and that it is displayed correctly via \detokenize even with characters like _ or \ in \texttt mode. So this results in:
FUNCTION {format.url}
{ doi empty$
    { url empty$
        'skip$
        {
            ". URL:~\url{" * url * "}" *
            urldate empty$
             { "there is url but no urldate in " cite$ * warning$ }
             { 
                "~(Accessed on: " * urldate * ")" *
             }
             if$
        }if$
    }
    {". DOI:~\href{https://doi.org/" * doi * "}{\texttt{\detokenize{" * doi * "}}}" *
    }if$
}
  1. The last step is to include
  format.url "" output 
  new.block

before

  note output
  fin.entry
}

in all different source type functions, for example:

FUNCTION {booklet}
{ output.bibitem
  format.authors output
  format.title "title" output.check
  howpublished "howpublished" bibinfo.check output
  address "address" bibinfo.check output
  format.date output
  format.url "" output 
  new.block
  format.note output
  fin.entry
}

The advantage using this solution is: The bibliography handles URLs and DOIs automatically without using url = {\url{...}}, or url = {\href{...}{...}},. I hope this helps.

Note: To adjust the link-colors, I used in main.tex:

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}% sets the style for links
fagr
  • 1