
biber
/ 데이터 biblatex
모델을 사용하면 사용자가 를 사용하여 데이터 모델에 대한 제약 조건을 지정할 수 있습니다 \DeclareDatamodelConstraints
. 에 의해 정의된 기본 데이터 모델에는 blx-dm.def
다음이 있습니다.
\DeclareDatamodelConstraints[article]{
\constraint[type=mandatory]{
\constraintfield{author}
\constraintfield{journaltitle}
\constraintfield{title}
}
}
내가 아는 한, 제약 조건은 아무 것도 하지 않습니다. 다음 MWE를 고려하십시오.
\documentclass{article}
\usepackage{biblatex}
\begin{filecontents*}{\jobname.bib}
@article{myarticle,
title = {Some Title}
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\cite{myarticle}
\printbibliography
\end{document}
pdflatex
, biber
, 을 통해 실행하면 제약 조건이 충족되지 않는다고 중지하거나 최소한 큰 소리로 불평할 것으로 pdflatex
예상되지만 또는 파일에는 제약 조건이 충족되지 않음을 암시하는 내용이 아무것도 표시되지 않습니다. /가 충족되지 않으면 불평 하도록 제약 조건을 정의하는 것이 가능합니까 ?biber
log
blg
biber
pdflatex
답변1
이러한 제약 조건을 확인하려면 --validate_datamodel
옵션을 에 전달해야 합니다 biber
. 귀하의 예에서 실행 중
biber --validate_datamodel file
나는 얻다
[...] WARN - Datamodel: Entry 'myarticle' (file.bib): Missing mandatory field - one of 'date, year' must be defined WARN - Datamodel: Entry 'myarticle' (file.bib): Missing mandatory field 'author' WARN - Datamodel: Entry 'myarticle' (file.bib): Missing mandatory field 'journaltitle' [...] INFO - WARNINGS: 3
원하는 경우 다음 biber.conf
으로 구성된 파일 에서 이 옵션을 설정할 수 있습니다.
<?xml version="1.0" encoding="UTF-8"?>
<config>
<validate_datamodel>1</validate_datamodel>
</config>
biber
매번 명령줄 옵션을 쓰는 대신 .
답변2
기존 필드의 제약 조건을 변경하는 경우 전화하는 것을 잊지 마세요.
\ResetDatamodelConstraints
자신의 제약 조건을 정의하기 전에.