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 am still working on formatting my references according to my department’s standard. I am currently trying to alter a date format but failing.

I need:

30. Sept. 2003.

Yet anything I do doesn’t seem to have any influence. Find attached a MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{xpatch}
\usepackage{polyglossia}
\setmainlanguage[variant=british]{english}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{csquotes}
\usepackage{url}
\usepackage[style=authoryear-ibid,backend=biber,doi=false,isbn=false,url=false,autolang=hyphen]{biblatex}
     \addbibresource{Merkliste.bib}
     \renewcommand*{\postnotedelim}{\addcolon\space}
     \renewbibmacro{in:}{\ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
    \renewcommand*{\intitlepunct}{\addspace}
     \renewcommand{\bibpagespunct}{\ifentrytype{incollection}{\addperiod\addspace}{\addcolon\addspace}}

\DeclareFieldFormat
  [online]
  {url}{{#1}}
\DeclareFieldFormat
  [online]
  {title}{\mkbibquote{#1\isdot}}
\xpatchbibmacro{title}{\printfield[titlecase]{subtitle}}%
{\printfield[titlecase]{subtitle}\ifentrytype{online}{\addperiod}{}}%
{}{}%
\DeclareFieldFormat{urldate}{#1}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat{pages}{#1}
%% Here are my tries.
\xpatchbibmacro{url+urldate}{\printfield{urlyear}\mkbibmonth{\thefield{urlmonth}}{\thefield{urlday}}}{}{}
    \xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \setunit*{\addperiod\space}%
  \printtext%
}{}{}

\xpatchbibmacro{title}{\printfield[titlecase]{subtitle}}%
{\printfield[titlecase]{subtitle}\ifentrytype{article}{\addperiod}{}}%
{}{}%

\AtEveryBibitem{\clearlist{language}} % clears language
\AtEveryBibitem{\clearfield{note}}    % clears notes
\AtEveryBibitem{\clearfield{series}}   % clears Series
\AtEveryBibitem{\ifentrytype{book}{\clearfield{number}}{}}
\AtEveryBibitem{\ifentrytype{book}{\clearfield{pages}}{}}

\begin{document}
\nocite{*}. 
\printbibliography
\end{document}

and a .bib-extract:

![@online{secretariat_a_la_politique_linguistique_quebec_dynamique_2014,
    Author = {{Secr{\'e}tariat {\`a} la politique linguistique Qu{\'e}bec}},
    Date-Modified = {2014-08-03 17:01:54 +0000},
    File = {Dynamique des langues en quelques chiffres \: Tableaux - Secr{\'e}tariat {\`a} la politique linguistique.pdf:/Users/Moritz/Desktop/Dynamique des langues en quelques chiffres \: Tableaux - Secr{\'e}tariat {\`a} la politique linguistique.pdf:application/pdf},
    Month = jul,
    Title = {La dynamique des langues en quelques chiffres : Tableaux},
    Urldate = {2014-07-28},
    Year = {2014}}][1]

Here’s my not-perfect output

share|improve this question
    
Is there really a dot after 30? –  Bernard Aug 3 at 17:11
    
Yes, I just double-checked. –  Moritz Aug 3 at 17:15
    
Strange… Never seen that. Btw, do you know that if you use biber, your .bib file can be utf8-encoded, i.e. you can type Québec, for instance (comment aside, I suppose it's du Québec). –  Bernard Aug 3 at 17:19
    
Is the urldate field supposed to be printed in long French format, with mainlanguage=british? –  Bernard Aug 3 at 18:19

1 Answer 1

up vote 4 down vote accepted

Biblatex offers different options to format a date. If the format is not a predefined one, it is possible to use \DeclareFieldFormat to provide a now format, in this case we can provide a format for urldate

\DeclareFieldFormat{urldate}{%
  \thefield{urlday}\adddot\addspace%
  \mkbibmonth{\thefield{urlmonth}}\adddot\addspace%
  \thefield{urlyear}\isdot}

To use the abbreviated version for the month one can use the dateabbrev option of biblatex.

enter image description here

share|improve this answer
    
I'm not sure the braces are correctly placed. –  egreg Aug 3 at 20:03
    
@egreg thanks. fixed now. –  Guido Aug 3 at 20:59
    
There can’t be much that can’t be changed in LaTeX with tex.sx’s help:) –  Moritz Aug 4 at 12:15

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.