날짜 형식(턱받이 항목) / bibelatex biber

날짜 형식(턱받이 항목) / bibelatex biber

저는 biber와 biblatex를 사용하고 있는데 2013년 이전의 모든 논문을 인쇄하고 싶습니다.

year = {2010}

.bib 파일에 항목을 추가하면 모든 생각이 잘 작동합니다. 그러나 내가 사용하면

date = {2010-11-25}

연도 대신 내 항목이 무시됩니다. 나는 날짜 형식을 존중합니다. 그렇죠? 그렇다면 무엇이 잘못되었나요? 여기 MWE가 있습니다.

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@THESIS{a,
  AUTHOR =  {Myself},
  TITLE = {Me, myself and I},
  Institution = {My University},
  type = {Ph.D. thesis},
  year = {2010} 

} %  date = {2010-11-25}
\end{filecontents*}
\usepackage[backend=biber,defernumbers=true,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
         \map[overwrite=true]{
            \step[fieldsource=year,  match=\regexp{199([7-9])|200([0-9])|201([0-2])},final]
            \step[fieldset=keywords, fieldvalue={,}, append]
        \step[fieldset=keywords, fieldvalue={before2013}, append]
}}}

\begin{document}
Hello world.
    \nocite{*}
    \printbibliography[type=thesis,keyword=before2013,title=Thesis,resetnumbers=true]
\end{document}

답변1

Biber의 소스 매핑 대신 문서의 year필드와 비교할 수 있습니다. ( 사용 여부 또는 필드 가 에 기록될 때 항상 해당 구성 요소로 분할되므로 여기에서 biblatex사용할 수 있습니다 .)yearyeardatedate.bbl

우리는 bibcheck를 정의합니다

\defbibcheck{before2013}{%
  \iffieldint{year}
    {\ifnumless{\thefield{year}}{2013}
       {}
       {\skipentry}}
    {\skipentry}}

키워드 대신 해당 수표를 사용하세요.

\printbibliography[type=thesis,check=before2013,title=Thesis,resetnumbers=true]

답변2

1997년부터 2012년까지인 경우 \maps에만 설정되지만 1997-01-01 부터 2012-12-31까지인 경우에는 설정되지 않습니다. 인덱스는 다음과 같은 경우에만 인쇄됩니다 . 따라서 대신에 is를 사용 하면 항목이 인쇄되지 않습니다 .keyword=before2013yeardatekeyword=before2013dateyear

date다음과 같은 유사한 지도를 추가할 수 있습니다 year.

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@THESIS{a,
  AUTHOR =  {Myself},
  TITLE = {Me, myself and I},
  Institution = {My University},
  type = {Ph.D. thesis},
  year = {2010} 
}
@THESIS{b,
  AUTHOR =  {Another},
  TITLE = {Another, one and nobody},
  Institution = {My University},
  type = {Ph.D. thesis},
  date = {2010-11-25} 
}
@THESIS{c,
  AUTHOR= {Never},
  TITLE = {I'm to late},
  Institution = {My University},
  type = {Ph.D. thesis},
  date = {2017-01-01}
}
\end{filecontents*}
\usepackage[backend=biber,defernumbers=true,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite=true]{
      \step[fieldsource=year,  match=\regexp{199([7-9])|200([0-9])|201([0-2])},final]
      \step[fieldset=keywords, fieldvalue={,}, append]
      \step[fieldset=keywords, fieldvalue={before2013}, append]
    }
    \map[overwrite=true]{
      \step[fieldsource=date,  match=\regexp{199([7-9])|200([0-9])|201([0-2])},final]
      \step[fieldset=keywords, fieldvalue={,}, append]
      \step[fieldset=keywords, fieldvalue={before2013}, append]
    }
  }
}

\begin{document}
Hello world.
    \nocite{*}
    \printbibliography[type=thesis,keyword=before2013,title=Thesis,resetnumbers=true]
\end{document}

여기에 이미지 설명을 입력하세요

또 다른 해결책은 날짜가 이미 분할되었을 때 확인이 완료되었으므로 확인을 사용하는 것입니다.

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@THESIS{a,
  AUTHOR =  {Myself},
  TITLE = {Me, myself and I},
  Institution = {My University},
  type = {Ph.D. thesis},
  year = {2010} 
}
@THESIS{b,
  AUTHOR =  {Another},
  TITLE = {Another, one and nobody},
  Institution = {My University},
  type = {Ph.D. thesis},
  date = {2010-11-25} 
}
@THESIS{c,
  AUTHOR= {Never},
  TITLE = {I'm to late},
  Institution = {My University},
  type = {Ph.D. thesis},
  date = {2017-01-01}
}
\end{filecontents*}
\usepackage[backend=biber,defernumbers=true,sorting=ydnt]{biblatex}
\addbibresource{\jobname.bib}
\defbibcheck{before2013}{%
  \iffieldint{year}% If an interger field year exists
  {
    \ifnumless{\thefield{year}}{2013}% and the field value is less than 2013
    {}% do nothing
    {\skipentry}% otherwise skip the entry
  }
  {\skipentry}% skip the entrie also if there isn't an integer field year
}

\begin{document}
Hello world.
    \nocite{*}
    \printbibliography[type=thesis,check=before2013,title=Thesis,resetnumbers=true]
\end{document}

결과는 동일합니다.

관련 정보