如何获取 URL 访问日期的完整月份?

如何获取 URL 访问日期的完整月份?

在下面的例子中,我想更改 URL 访问日期的外观。而不是像

(2013 年 9 月 1 日访问)。

我希望月份能够完整地写出并像这样显示

(2013 年 9 月 1 日访问)。

梅威瑟:

\documentclass[twocolumn]{article}
\usepackage[style=authoryear,maxcitenames = 2,mincitenames = 1,maxbibnames = 99,minbibnames = 1,dashed = false,firstinits=true,backend=biber]{biblatex}  
% !BIB TS-program = biber     
%^ line above is necessary to tell TeXShop to use Biblatex rathern than traditional BibTex.
\usepackage[utf8]{inputenc}    % utf8 support       
\usepackage[T1]{fontenc}       % code for pdf file  % w/out these two lines, I get the warning, "WARN - The entry '_______' has characters which cannot be encoded in 'ascii'. Recoding problematic characters into macros.

\usepackage{filecontents}
\begin{filecontents}{Test.bib}    
@unpublished{usgs_gmted_data,
Author = {{United States Geological Survey}},
Title = {USGS Global Multi-resolution Terrain Elevation Data (GMTED) product},
Url = {http://topotools.cr.usgs.gov/gmted_viewer/},
urldate = {2013-09-01}, 
urlmonth = {September},                    % Added                                
Year = {2010}}
\end{filecontents}
\addbibresource{Test.bib}

% Add the text, "Available at:" prior to URL and "accessed" afterward in parentheses.
\DefineBibliographyStrings{english}{%          
urlseen = {accessed}
}
\DefineBibliographyStrings{english}{%
urlseen = {accessed},
url = {Available at:}
}
\DeclareFieldFormat{url}{\bibstring{url}\space\url{#1}}

% Prevent Italics for booktitle in these data types 
\DeclareFieldFormat
[article,book,manual,misc,software,unpublished]
{booktitle}{#1}

 % Remove quotations around the following titles.
\DeclareFieldFormat[article,book,collection,incollection,manual,misc,
periodical,proceedings,report,thesis,software,unpublished]{title}{#1} 

%% =================================================
\begin{document}
Test cite \parencite{usgs_gmted_data}.

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

引文如下:

美国地质调查局 (2010) USGS 全球多分辨率地形高程数据 (GMTED) 产品。可从以下网址获取:http://topotools.cr.usgs.gov/gmted_viewer/(2013 年 9 月 1 日访问)。

但我希望它看起来像这样:

美国地质调查局 (2010) USGS 全球多分辨率地形高程数据 (GMTED) 产品。可从以下网址获取:http://topotools.cr.usgs.gov/gmted_viewer/(2013 年 9 月 1 日访问)。

答案1

除了选项之外urldate=longdateabbrev=false您还需要一些与语言类似的参考书目附加内容australian,但您不需要从数字中去掉前导零。

因此,您可以将以下几行添加到您的序言中(代码取自并修改自australian.lbx):

\DefineBibliographyExtras{english}{%
  \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}}}{\stripzeros{\thefield{#1}}}}%
}

请注意,您不需要在文件中写入具体的urlmonth和。urlday.bib

梅威瑟:

\documentclass[twocolumn]{article}
\usepackage[style=authoryear,
            maxcitenames = 2,
            mincitenames = 1,
            maxbibnames = 99,
            minbibnames = 1,
            dashed = false,
            firstinits=true,
            urldate=long,
            dateabbrev=false,
            backend=biber]{biblatex}

% !BIB TS-program = biber
%^ line above is necessary to tell TeXShop to use Biblatex rathern than traditional BibTex.
\usepackage[utf8]{inputenc}    % utf8 support
\usepackage[T1]{fontenc}       % code for pdf file  % w/out these two lines, I get the warning, "WARN - The entry '_______' has characters which cannot be encoded in 'ascii'. Recoding problematic characters into macros.

\usepackage{filecontents}
\begin{filecontents}{Test.bib}
@unpublished{usgs_gmted_data,
Author = {{United States Geological Survey}},
Title = {USGS Global Multi-resolution Terrain Elevation Data (GMTED) product},
Url = {http://topotools.cr.usgs.gov/gmted_viewer/},
urldate = {2013-09-01},
Year = {2010}}
\end{filecontents}
\addbibresource{Test.bib}

% Add the text, "Available at:" prior to URL and "accessed" afterward in parentheses.
\DefineBibliographyStrings{english}{%
urlseen = {accessed}
}
\DefineBibliographyStrings{english}{%
urlseen = {accessed},
url = {Available at:}
}
\DeclareFieldFormat{url}{\bibstring{url}\space\url{#1}}

% Prevent Italics for booktitle in these data types
\DeclareFieldFormat
[article,book,manual,misc,software,unpublished]
{booktitle}{#1}

 % Remove quotations around the following titles.
\DeclareFieldFormat[article,book,collection,incollection,manual,misc,
periodical,proceedings,report,thesis,software,unpublished]{title}{#1}

\DefineBibliographyExtras{english}{%
  \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}}}{\stripzeros{\thefield{#1}}}}%
}

%% =================================================
\begin{document}
Test cite \parencite{usgs_gmted_data}.

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

输出:

在此处输入图片描述

答案2

的格式urldate由选项控制urldate,对于长日期,使用long选项。第二个要设置的选项是是否使用缩写,即dateabbrev=false

最后,为了实现英国日期格式,必须设置language=british

采用上述方案,即:

\usepackage[style=authoryear,
  maxcitenames = 2,
  mincitenames = 1,
  maxbibnames = 99,
  minbibnames = 1,
  dashed =false,
  firstinits=true,
  backend=biber,
  urldate=long,
  dateabbrev=false,
  language=british]{biblatex}    

OP中提供的MWE产生:

在此处输入图片描述

相关内容