0

I have very specific requirements for my bibliography style but can't realize them... I'm using bibTex with an @online-entry and have to put the URL at the beginning of an entry. So it should look for example like this:
http//www.abc.com/xyz.html, Crane, G., About something, visited on 01.02.2018. This is my .tex-file:

\documentclass[12pt,a4paper, notitlepage]{article}  
\usepackage[style=authortitle, citestyle=authoryear, giveninits=true, 
uniquename=init, backend=biber]{biblatex}  
\DeclareNameAlias{sortname}{last-first}  
\bibliography{bib.bib}  
\renewbibmacro*{date}{\setunit{\addspace}\printdate}  
\renewcommand*{\newunitpunct}{\addcomma\space} 
\begin{document}  
\nocite{*}  
\printbibliography[type=online]  
\newpage  
\end{document}  

and this is bib.bib:

@online{test,
author = {Gerhard Crane},
title = {About something},
url = {http://abc.com/xyz.html},
urldate = {2018-02-01},
}

Thanks for your help!

12
  • 5
    Welcome to TeX.SE. Assuming you use BibTeX, do please tell us which bibliography style you employ at present. Since you set the biber tag, it's not entirely clear, though whether you use BibTeX or biblatex/biber. Please clarify. – Mico Feb 7 '18 at 21:14
  • 1
    Please provide code for a minimal document with bibliography which we can copy-paste-compile to reproduce the problem. If you are really using bibtex (and not just a database of BibTeX entries), then remove the biber tag. If you are using Biber, remove the bibtex tag and add biblatex. – cfr Feb 8 '18 at 1:13
  • A solution will not only depend on the package (biblatex) you use, but also on the bibliography style you use. Please show us an MWE/MWEB that we can get started more easily and can make sure that the answer works for you. What about the sorting in this case? – moewe Feb 8 '18 at 9:08
  • You might also want to explain how you want to cite these entries, again that depends on the citation/bibliography style you use. – moewe Feb 8 '18 at 9:27
  • 2
    style=authortitle, citestyle=authoryear is an interesting and possibly confusing combinations already. But how should citations to @online entries look? – moewe Feb 8 '18 at 10:03
1

We change the field formats for url and urldate a bit and move the URL to the start with begentry

\documentclass[12pt,a4paper, notitlepage]{article}  
\usepackage[style=authortitle, citestyle=authoryear, giveninits=true, 
uniquename=init, backend=biber]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{test,
author = {Gerhard Crane},
title = {About something},
url = {http://abc.com/xyz.html},
urldate = {2018-02-01},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\DeclareNameAlias{sortname}{family-given}
\renewbibmacro*{date}{\setunit{\addspace}\printdate}
\renewcommand*{\newunitpunct}{\addcomma\space}

\DeclareFieldFormat{url}{\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\space#1}
\renewbibmacro{begentry}{\ifentrytype{online}{\usebibmacro{url}\clearfield{url}\newunit\newblock}{}}

\begin{document}  
\nocite{*}
\printbibliography[type=online]
\newpage
\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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