BibLaTeX 소스맵을 사용한 들여쓰기된 부록

BibLaTeX 소스맵을 사용한 들여쓰기된 부록

각 항목에 대한 요약 단락이 포함된 주석이 달린 참고문헌을 생성하려고 합니다. 각 bibentry에 대한 부록은 항목 자체보다 들여쓰기 수준이 한 단계 더 깊은 새 줄에 표시됩니다.

각 항목에 대해

addendum = {Text.}

다음은 내가 보고 싶은 출력 형식을 정확하게 생성하여 잘 작동하는 것 같습니다.

addendum = {\paragraph\indent{Text.}\\}

다음을 사용하여 자동 변환을 수행하려고 합니다.

\DeclareSourcemap{
    \maps[datatype=bibtex]{
        \map{
            \step[fieldsource=addendum, 
                match=\regexp{(.*)},
                fieldset=addendum,
                replace={\\paragraph\{\\indent $1\} \\}
            ]
        }
    }
}

그러나 교체 필드에서 문자를 올바르게 이스케이프 처리할 수 없는 것 같고 LaTeX에서 오류가 발생합니다.

Undefined control sequence.
\\  ->\let \reserved@e 
                       \relax \let \reserved@f \relax \@ifstar {\let \reserv...
l.68 }

나는 이것의 앞부분이나 뒷부분을 만들 수 없습니다. 출력 정규식을 잘못 정의하고 있습니까?

편집: 최소 작업 예:

테스트.턱받이

@article{test,
  author    = {Luigi P. Cordella and
               Pasquale Foggia and
               Carlo Sansone and
               Mario Vento},
  title     = {A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs},
  journal   = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
  volume    = {26},
  number    = {10},
  pages     = {1367--1372},
  year      = {2004},
  doi       = {10.1109/TPAMI.2004.75},
  timestamp = {Sat, 12 Mar 2016 09:04:02 +0100},
  addendum = {This is a test of simple annotations.}
}

@article{test2,
  author    = {Luigi P. Cordella and
               Pasquale Foggia and
               Carlo Sansone and
               Mario Vento},
  title     = {A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs},
  journal   = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
  volume    = {26},
  number    = {10},
  pages     = {1367--1372},
  year      = {2004},
  doi       = {10.1109/TPAMI.2004.75},
  timestamp = {Sat, 12 Mar 2016 09:04:02 +0100},
  addendum = {\paragraph\indent{\textbf{Annotation:} This is a test of simple annotations using biblatex.}\\}
}

test.tex

\documentclass[a4]{article}
\usepackage[backend=biber]{biblatex}

\bibliography{test}

% Sourcemap is placed here.

\begin{document}

Test 1 \cite{test}
Test 2 \cite{test2}

\printbibliography

\end{document}

여기서 테스트 1은 변환 전 인용이고 테스트 2는 원하는 출력입니다.

답변1

을 사용할 필요가 없습니다 \DeclareSourcemap. 간단합니다.

\DeclareFieldFormat{addendum}{\paragraph\indent{\textbf{Annotation:}\addspace#1}\\}

충분하다:

\documentclass{article} % [a4] is not a correct option
\usepackage[english]{babel}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@article{test,
    author    = {Luigi P. Cordella and
        Pasquale Foggia and
        Carlo Sansone and
        Mario Vento},
    title     = {A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs},
    journal   = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
    volume    = {26},
    number    = {10},
    pages     = {1367--1372},
    year      = {2004},
    doi       = {10.1109/TPAMI.2004.75},
    timestamp = {Sat, 12 Mar 2016 09:04:02 +0100},
    addendum = {This is a test of simple annotations.}
}
@article{test2,
    author    = {Luigi P. Cordella and
        Pasquale Foggia and
        Carlo Sansone and
        Mario Vento},
    title     = {A (Sub)Graph Isomorphism Algorithm for Matching Large Graphs},
    journal   = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
    volume    = {26},
    number    = {10},
    pages     = {1367--1372},
    year      = {2004},
    doi       = {10.1109/TPAMI.2004.75},
    timestamp = {Sat, 12 Mar 2016 09:04:02 +0100},
    addendum = {This is a test of simple annotations using biblatex.}
}
\end{filecontents}

\usepackage[backend=biber]{biblatex} 
\usepackage{csquotes} % added
% New format for addendum field
\DeclareFieldFormat{addendum}{\paragraph\indent{\textbf{Annotation:}\addspace#1}\\}
\addbibresource{test.bib} % Not \bibliography{test}

\begin{document}

Test 1 \cite{test}
Test 2 \cite{test2}

\printbibliography

\end{document}

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

추신 = 귀하의 mwe의 일부 코드 줄도 변경했습니다. 댓글을 참조하세요.

관련 정보