1

I am using addedum for adding [Accesssed Date], not sure is the correct way as there is I want to remove the . there.

My Output: enter image description here

I want this:

enter image description here

My setting for URL:

\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}

I am using:

@online{WinNT,
%   author = {Conflict Memory Displacement},
   author = {{Conflict Memory Displacement}},
   title = {Conflict Memory Displacement: Responding to the refugee crisis in the UK and Italy},
   year = 2016,
   url = {http://conflictmemorydisplacement.com/},
%   urldate = {28 July 2016}
   addendum = "[Accessed 28 July 2016]",
  }

My full MWE (I did not have any setting for @online and do not want to disturb other settings in citting.

\documentclass{article}
\usepackage{xpatch}
% \usepackage[style = authoryear-comp, maxnames = 99]{biblatex}

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
giveninits,
uniquename=init]{biblatex}


\DeclareNameAlias{sortname}{family-given} %for second and third author name
\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{csquotes}

\usepackage[unicode,colorlinks,citecolor=blue]{hyperref}


% for a chapter edited by a book
\usepackage{xpatch}
% \renewcommand*{\finalnamedelim}{\addspace\&\space} 
% \renewcommand*{\intitlepunct}{\space} (to become In:)
\renewcommand{\labelnamepunct}{\space} %to delete . after (1997)
% \DeclareFieldFormat[article, incollection, unpublished]{pages}{#1} % to add in PP. (page)
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}
% \renewcommand{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod\addspace}} %cancel out this in order to add in PP. (page)


% for title italic
% \DeclareFieldFormat*{title}{\mkbibemph{#1}} %for title italic in all format (conference, paper..)
\DeclareFieldFormat*{title}{#1} %for conference title delete ".."
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}} %for incollecion title italic ONLY
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} %for phdthesis title italic ONLY
% for title italic

% to delete "In:" for article
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
% to delete "In:" for article


% for delete comma after Author A and Aurhor b
\DefineBibliographyExtras{english}{%
   \let\finalandcomma\empty
   \let\finalandsemicolon\empty
 }
\renewcommand{\compcitedelim}{\space\&\space}
\DeclareNameAlias{editorin}{given-family}

\newbibmacro*{byeditor:in}{%
  \ifnameundef{editor}
    {}
    {\printnames[editorin]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}}     


\xpatchbibdriver{inbook}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{byeditor:in}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{incollection}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor}}
  {}{}

\xpatchbibdriver{inproceedings}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{phdthesis}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\DeclareDelimFormat[textcite]{postnotedelim}{\addcolon\space}
\DeclareDelimFormat[parencite]{postnotedelim}{\addcolon\space}

% \DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}
\DeclareFieldFormat{multipostnote}{#1}


% for references 's studies (year)
\renewcommand*{\nameyeardelim}{\addcomma\space}
\newcommand{\mycite}[1]{\citeauthor{#1}'s \citeyear{#1}}

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printtext[bibhyperref]{\printnames{labelname}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citeyear} % <======================================
    {}
    {(\bibhyperref{\printdate})}
    {\multicitedelim}
    {}

\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\renewcommand*{\postnotedelim}{\addcolon\space}%
   \usebibmacro{cite:init}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\usebibmacro{cite}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\cbx@textcite}
  {\renewcommand*{\postnotedelim}{\addsemicolon\space}%
   \usebibmacro{cite:init}}
  {\usebibmacro{citeindex}%
   \usebibmacro{textcite}}
  {}
  {\usebibmacro{textcite:postnote}}  



\makeatletter
\let\abx@macro@textciteOrig\abx@macro@textcite
\renewbibmacro{textcite}{% <============================================
   \bibhyperref{%
   \let\bibhyperref\relax\relax%
   \abx@macro@textciteOrig%
   }%
}%
\makeatother
% for references 's studies (year)

\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}



\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}




@online{WinNT,
%   author = {Conflict Memory Displacement},
   author = {{Conflict Memory Displacement}},
   title = {Conflict Memory Displacement: Responding to the refugee crisis in the UK and Italy},
   year = 2016,
   url = {http://conflictmemorydisplacement.com/},
%   urldate = {28 July 2016}
   addendum = "[Accessed 28 July 2016]",
  }

@book{latexcompanion,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The \LaTeX\ Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}


\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}

This website is done \parencite{WinNT}.\\
This book is done byford \textcite{latexcompanion}



\printbibliography
\end{document}
aan
  • 2,663

1 Answers1

5

You should use urldate for this. You are just using the wrong format. All dates in biblatex need to be in the format YYYY-MM-DD (more complex dates are also permissible).

Then you just need to change the urlseen string and the urldate format.

I also used australian language since you seem to want Australian style dates and (from your other question) quotation marks.

MWE

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{WinNT,
  author = {{Conflict Memory Displacement}},
  title = {Conflict Memory Displacement},
  subtitle = {Responding to the refugee crisis in the UK and Italy},
  date = {2016},
  url = {http://conflictmemorydisplacement.com/},
  urldate = {2016-09-28},
}
\end{filecontents}

\usepackage[australian]{babel}
\usepackage{csquotes}

\usepackage[%
  backend=biber, 
  style=authoryear-comp,
  dashed=false,
  maxcitenames=2,
  maxbibnames=99,
  giveninits,
  alldates=comp,
  dateabbrev=false,
  uniquename=init]{biblatex}
\addbibresource{\jobname.bib}

\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}

\DefineBibliographyStrings{english}{%
  urlseen = {Accessed},
}

\begin{document}
\nocite{WinNT}
\sloppy
\printbibliography
\end{document}

MWE output

Alternative without using Australian

If you don't want to use Australian, you need to supply some more date redefinitions. The output is the same in both cases.

\documentclass{article}
\pagestyle{empty}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{WinNT,
  author = {{Conflict Memory Displacement}},
  title = {Conflict Memory Displacement},
  subtitle = {Responding to the refugee crisis in the UK and Italy},
  date = {2016},
  url = {http://conflictmemorydisplacement.com/},
  urldate = {2016-09-28},
}
\end{filecontents}

\usepackage[english]{babel}
\usepackage[style=british]{csquotes}

\usepackage[%
  backend=biber, 
  style=authoryear-comp,
  dashed=false,
  maxcitenames=2,
  maxbibnames=99,
  giveninits,
  alldates=comp,
  dateabbrev=false,
  uniquename=init]{biblatex}
\addbibresource{\jobname.bib}

\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}

\DefineBibliographyStrings{english}{%
  urlseen = {Accessed},
}

\DefineBibliographyExtras{english}{%
  \protected\def\mkdaterangecomp{%
    \mkdaterangetrunc{long}}%
  \protected\def\mkdaterangeterse{%
    \mkdaterangetrunc{short}}%
  \protected\def\mkdaterangecompextra{%
    \mkdaterangetruncextra{long}}%
  \protected\def\mkdaterangeterseextra{%
    \mkdaterangetruncextra{short}}%
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#3}
      {}
      {\thefield{#3}%
       \iffieldundef{#2}{}{\nobreakspace}}%
    \iffieldundef{#2}
      {}
      {\mkbibmonth{\thefield{#2}}%
       \iffieldundef{#1}{}{\space}}%
    \iffieldbibstring{#1}
      {\bibstring{\thefield{#1}}}
      {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}}%
}

\begin{document}
\nocite{WinNT}
\sloppy
\printbibliography
\end{document}
David Purton
  • 25,884
  • Thanks. Is there a way to print the full words of September, instead of Sept. in [Accessed 28 Sept. 2016] for example? – aan Oct 02 '19 at 07:44
  • @aan, yes I'll look up in the manual and show you – David Purton Oct 02 '19 at 08:02
  • One more question. If I used \usepackage[english]{babel}, it will become output [Accessed Sept. 30, 2019].. Is there a way to keep using usepackage[english]{babel} at the same time get [Accessed 30 September 2019]? – aan Oct 02 '19 at 16:42
  • 1
    @aan, you can use full months using the dateabbrev=false option for biblatex. – David Purton Oct 03 '19 at 01:47
  • 1
    @aan, you can keep english as the option for babel using this answer. I'll update my answer, showing you your options. – David Purton Oct 03 '19 at 01:52
  • It works very well. Brillant! – aan Oct 04 '19 at 01:53
  • not sure if you able to have a look at this question regarding add Available at: DOI... https://tex.stackexchange.com/questions/511038/how-can-i-add-available-at-for-my-doi-and-should-i-use-online-or-article-fo – aan Oct 07 '19 at 14:31