%20%ED%85%8D%EC%8A%A4%ED%8A%B8(%5CDefineBibliographyStrings%7B%EC%96%B8%EC%96%B4%7D%20%EC%98%A4%EB%A5%98%20%EB%B0%8F%20%5Ciffieldequalstr%7B%ED%95%98%EC%9D%B4%ED%94%88%20%EC%97%B0%EA%B2%B0%7D%20%EC%98%A4%EB%A5%98).png)
text
pdflatex(biber)를 사용하여 참고문헌에서 언어 종속(맞춤형)을 얻으려고 합니다 .
나는 다음을 통해 이 작업을 수행하는 최소한 3가지 접근 방식을 찾았습니다.
\DefineBibliographyStrings{language}{bibfield={formatting}}
\NewBibliographyString
- 새로운 턱받이 스트링을 생성하고 다음과 같이 사용하십시오.이 예\iffieldequalstr{hyphenation}{language}{true}{false}
하지만,첫 번째 접근 방식
\DefineBibliographyStrings{english}{series = {Ser\adddot\addcolon\space{#1}\isdot}}
\DefineBibliographyStrings{russian}{series = {Сер\adddot\addcolon\space{#1}\isdot}}
오류가 발생합니다.
패키지 keyval 오류: 시리즈가 정의되지 않았습니다. }
두 번째 접근 방식text tuples
맞춤설정할 항목 이 많으면 구현하기가 어렵습니다 .
세 번째 접근 방식
\DeclareFieldFormat{series}{\iffieldequalstr{hyphenation}{russian}{Сер}{Ser}\adddot\addcolon\space{#1}\isdot} %
와 같은 언어 지향 분야에서는 작동하지 않습니다 hyphenation
.
1 및 3 접근 방식의 문제를 해결하는 답변을 도와주세요.
MWE
\documentclass{memoir}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@INBOOK{Inbook,
author = {Peter Eston},
title = {The title of the work},
booktitle = {Book title},
chapter = {8},
pages = {201-213},
publisher = {The name of the publisher},
year = {1993},
volume = {4},
series = {5},
address = {The address of the publisher},
edition = {3},
month = {7},
hyphenation = {english}
}
@Book{avtonomova:fya,
author = {Н. С. Автономова},
title = {Философский язык Жака Деррида},
year = 2011,
publisher = {Российская политическая энциклопедия (РОССПЭН)},
location = {М.},
isbn = {978-5-8243-1618-6},
series = {Российские Пропилеи},
pagetotal = 510,
hyphenation =russian,
}
\end{filecontents}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}[2014/04/30] %
\usepackage[english, russian]{babel}[2014/03/24]%
\usepackage[%
backend=biber,
bibencoding=utf8,
style=gost-numeric,
babel=other,
defernumbers=true,
sortcites=true,
doi=true,
]{biblatex}[2016/09/17]
%add Ser.: to series format
%%% First approach
%\DefineBibliographyStrings{english}{series = {Ser\adddot\addcolon\space{#1}\isdot}}
%
%\DefineBibliographyStrings{russian}{series = {Сер\adddot\addcolon\space{#1}\isdot}}
%%% Third approach
\DeclareFieldFormat{series}{\iffieldequalstr{hyphenation}{russian}{Сер}{Ser}\adddot\addcolon\space{#1}\isdot} % do not work
%% Work perfectly
%\DeclareFieldFormat{series}{\iffieldequalstr{pagetotal}{510}{Сер}{Ser}\adddot\addcolon\space{#1}\isdot} %
\addbibresource{\jobname.bib}
\begin{document}
\cite{avtonomova:fya,Inbook}
\printbibliography
\end{document}
원하는 출력
답변1
.bib
먼저 중괄호(또는 따옴표)를 사용하여 파일 에 숫자가 아닌 값을 제공해야 합니다 . hyphenation = russian
잘못되었으며 경고가 발생합니다 WARN - BibTeX subsystem: <filename>, line 29, warning: undefined macro "russian"
. 그것은해야한다
hyphenation = {russian},
은 레거시 별칭이므로 \iffieldequalstr{hyphenation}{russian}
작동하지 않습니다 . hyphenation
내부적으로 해당 필드는 이제 호출됩니다 langid
. 따라서,
\iffieldequalstr{langid}{russian}
공장.
그러나 나는 참고문헌 문자열을 사용한 접근 방식을 선호합니다. 문자열이 series
아직 정의되지 않았으므로 먼저 로 선언해야 합니다 \NewBibliographyString{series}
. 그런 다음 에 정의를 제공할 수 있습니다 \DefineBibliographyStrings
. 이 정의에는 번역된 문자열만 포함되어야 하며 추가 구두점 및 기타 매크로와 유사한 형식은 포함되어서는 안 됩니다. 마지막으로 문자열을 다음과 함께 사용할 수 있습니다.\bibsring
마지막으로 필드 형식으로 . 이것은 기본적으로 두 번째 접근 방식입니다.bibfile 내부에 새 명령 만들기.
\documentclass{memoir}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}[2014/04/30] %
\usepackage[english, russian]{babel}[2014/03/24]%
\usepackage[%
backend=biber,
style=gost-numeric,
babel=other,
defernumbers=true,
sortcites=true,
doi=true,
]{biblatex}[2016/09/17]
\NewBibliographyString{series}
\DefineBibliographyStrings{english}{series = {Ser\adddot}}
\DefineBibliographyStrings{russian}{series = {Сер\adddot}}
\DeclareFieldFormat{series}{\bibstring{series}\addcolon\space{#1}\isdot}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@INBOOK{Inbook,
author = {Peter Eston},
title = {The title of the work},
booktitle = {Book title},
chapter = {8},
pages = {201-213},
publisher = {The name of the publisher},
year = {1993},
volume = {4},
series = {5},
address = {The address of the publisher},
edition = {3},
month = {7},
hyphenation = {english}
}
@Book{avtonomova:fya,
author = {Н. С. Автономова},
title = {Философский язык Жака Деррида},
year = 2011,
publisher = {Российская политическая энциклопедия (РОССПЭН)},
location = {М.},
isbn = {978-5-8243-1618-6},
series = {Российские Пропилеи},
pagetotal = 510,
hyphenation = {russian},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{avtonomova:fya,Inbook}
\printbibliography
\end{document}
세 번째 언어를 추가하려는 경우 세 번째 접근 방식은 금방 불가능해집니다. 첫 번째 접근 방식은 biblatex
지역화(bibstrings)와 일반 형식(필드 형식 등)을 분리하기 때문에 작동하지 않습니다 . 그러나 두 번째 접근 방식은 첫 번째 접근 방식에 비해 작업량이 많지 않습니다. 실제로 이 예에서는 코드 중복도 방지할 수 있습니다.