저자 및 연도별로 참고문헌을 자동으로 색인화합니다.

저자 및 연도별로 참고문헌을 자동으로 색인화합니다.

나는 문헌 리뷰를 작성하고 있는데 저자와 출판 연도(예: 2)에 대한 색인을 추가하고 싶습니다.분리된지수). 이제는 적절한 \index{}명령을 수동으로 입력할 수도 있는데, 이는 biblatex에서 자동으로 처리할 수 있는 부분인 것 같습니다. 연구를 진행하면서 향후 몇 년 동안 리뷰를 최신 상태로 유지할 계획이므로 유지 관리가 훨씬 쉬워질 것입니다. 이는 중요한 고려 사항입니다.

나는 biblatex에 내장된 인덱싱 옵션을 가지고 놀았지만 여러 인덱스(또는 해당 문제에 대해 연도별 인덱스)로 작동하게 만드는 방법을 알 수 없습니다. 마찬가지로, 나는 다음과 같은 질문을 살펴보았습니다.이 하나사용자 정의 \cite명령을 작성하는 데 어려움을 겪고 있지만 어떻게 작동하는지 확인하는 데 어려움을 겪고 있습니다.

내가 추구하는 최종 결과의 종류를 보여주는 수동으로 색인화된 최소 작업 예제(biblatex 및 multind 사용):

\documentclass{report}

\usepackage{filecontents}
\begin{filecontents*}{testing.bib}
@article{Author2010,
    author="Author, A and Writer, B",
    journal="Slackers Monthly",
    title="An overly long treatise on procrastination",
    year=2010,
    month=jun,
}
@article{Writer2011,
    author="Writer, B and Scribe, C",
    journal="Fake Online Journal",
    title="Waste of time or time of waste: procrastination in a modern society",
    year=2011,
    month=oct,
}
@book{Writer2003,
    author="Writer, B",
    title="Procrastination for dummies",
    year=2003,
    publisher="Procrastination House",
    address="Auckland",
}
\end{filecontents*}

\usepackage[style=authoryear]{biblatex}
\addbibresource{testing}

\usepackage{multind}
\makeindex{authors}
\makeindex{years}

\begin{document}

\chapter{Introductory works}

\section{An overly long treatise on procrastination}

\fullcite{Author2010}
\index{authors}{Author, A!An overly long treatise on procrastination (2010)}
\index{authors}{Writer, B!An overly long treatise on procrastination (2010)}
\index{years}{2010!An overly long treatise on procrastination}

This paper was really useful in telling me how to waste more time rather 
than doing real work.

\section{Waste of time or time of waste: procrastination in a modern society}

\fullcite{Writer2011}
\index{authors}{Writer, B!Waste of time or time of waste: procrastination in a modern society (2011)}
\index{authors}{Scribe, C!Waste of time or time of waste: procrastination in a modern society (2011)}
\index{years}{2011!Waste of time or time of waste: procrastination in a modern society}

Applies post-modern philosophical theory to procrastination.

\section{Procrastination for dummies}

\fullcite{Writer2003}
\index{authors}{Writer, B!Procrastination for dummies (2003)}
\index{years}{2003!Procrastination for dummies}

A classic reference book for anybody starting a research position.

\printbibliography
\printindex{authors}{Author index}
\printindex{years}{Year index}

\end{document}

그리고 이를 컴파일하기 위한 Makefile은 다음과 같습니다.

default:
    xelatex mwe
    bibtex mwe
    xelatex mwe
    xindy -M texindy -M page-ranges -L english -C utf8 authors.idx
    xindy -M texindy -M page-ranges -L english -C utf8 years.idx
    xelatex mwe

그러면 사용자 정의 cite 명령(또는 해당 문제에 대해 내장된 명령)을 사용하여 이를 달성할 수 있습니까? 아니면 BibTeX/biber 출력을 구문 분석하여 xindy에 대한 입력을 생성하는 스크립트를 작성하는 것이 더 나을까요?

답변1

이 답변은 특히 Audrey의 통찰력 있는 의견을 반영하여 업데이트되었습니다.

예. 이를 수행하는 방법에는 여러 가지가 있습니다.

아래 코드는 제가 원래 제안한 내용을 수정한 것입니다. (희망으로는) 일반적인 사용 시 다양한 결함을 수정한 것입니다. 구체적으로:

  • 내 원래 코드는 빈 연도를 우아하게 처리하지 못했습니다.

  • 내 원래 코드는 "하드와이어" multind의 구문과 선택한 인덱스 이름입니다. 이 버전에서는 인덱스 이름이 매크로에 있으므로 변경할 수 있습니다.

  • indexsorttitle내 원래 코드는 및 필드를 사용하지 않았습니다 indextitle. 그래야만 합니다.

  • 내 원본 코드는 특정 매크로(예: Audrey가 적절하게 지적한 것처럼 색인 제목에 사용됨)에서 문제를 일으킬 수 있습니다 \TeX. 이렇게 하면 해당 매크로가 제대로 처리되기를 바랍니다.

귀하가 제공한 예에서는 이 중 아무것도 변경되지 않습니다. 그러나 원래 버전에서는 잘못되거나 어리석게 처리되었을 두 개의 추가 예제 항목을 추가했으며 이는 직접 처리합니다.

이상하게도 \fullcite인덱싱 매크로를 호출하지 않는 것 같아서 \cite; 이에 대한 설명이 있을 것 같지만 자세히 알아볼 시간이 없습니다.

\documentclass{report}

\usepackage{filecontents}
\begin{filecontents*}{testing.bib}
@article{Author2010,
    author="Author, A and Writer, B",
    journal="Slackers Monthly",
    title="An overly long treatise on procrastination",
    year=2010,
    month=jun,
}
@article{Writer2011,
    author="Writer, B and Scribe, C",
    journal="Fake Online Journal",
    title="Waste of time or time of waste: procrastination in a modern society",
    year=2011,
    month=oct,
}
@book{Writer2003,
    author="Writer, B",
    title="Procrastination for dummies",
    year=2003,
    publisher="Procrastination House",
    address="Auckland",
}
@book{knuth:ct:b,
  hyphenation = {american},
  sortyear = {1986-1},
  sorttitle = {Computers & Typesetting B},
  indexsorttitle = {TeX: The Program},
  author = {Knuth, Donald E.},
  title = {\TeX: The Program},
  shorttitle = {\TeX},
  maintitle = {Computers \& Typesetting},
  volume = {B},
  publisher = {Addison-Wesley},
  location = {Reading, Mass.},
  date = {1986},
  annotation = {The second volume of a five-volume book. Note the
    \texttt{sorttitle} and \texttt{sortyear} fields. Also note the
    \texttt{indexsorttitle} field}
}
@book{yearless,
  author = {Lazy B. Ugger},
  title  = {I Can't Be Bothered with Years},
  publisher = {Equally Lazee},
}
\end{filecontents*}

\usepackage[style=authoryear,indexing=cite]{biblatex}
\addbibresource{testing.bib}
\makeatletter
% For the "years" index, we redefine the ordinary bibmacro
% which indexes titles, so that it indexes into the years
% index instead
\renewbibmacro*{index:title}[2]{%
  \iffieldundef{year}
     {\usebibmacro{index:years}%
      {\index}%
      {\undated}%
      {\thefield{indexsorttitle}}%
      {\thefield{entrykey}}}
    {\usebibmacro{index:years}%
      {\index}%
      {\thefield{year}}%
      {\thefield{indexsorttitle}}%
      {\thefield{entrykey}}}}

\newbibmacro*{index:years}[4]{%
    \begingroup
     \protected@edef\theindexentry{%
      \unexpanded{#1}\yearsindex{#2!#3\actualoperator\unexpanded{\citefield}{#4}{indextitle}}}%
     \theindexentry
     \endgroup}

% For authors we just redefine the field format (so that it
% includes title and year information
\DeclareIndexNameFormat{default}{%
  \iffieldundef{year}
    {\usebibmacro{index:name}%
      {\index}%
      {#1}%
      {#3}%
      {#5}%
      {#7}%
      {\thefield{indexsorttitle}}%
      {\thefield{entrykey}}%
      {}}
   {\usebibmacro{index:name}%
      {\index}%
      {#1}%
      {#3}%
      {#5}%
      {#7}%
      {\thefield{indexsorttitle}}%
      {\thefield{entrykey}}%
      { (\thefield{year})}}}
% ... and modify the relevant bibmacro to add the extra information
\renewbibmacro*{index:name}[8]{%
  \begingroup
  \ifuseprefix
    {\protected@edef\theindexentry{%
       \unexpanded{#1}\authorsindex{%
         \ifblank{#4}{}{#4 }%
         \@firstofone #2% remove spurious braces
         \ifblank{#5}{}{ #5}%
         \ifblank{#3}{}{, #3}%
         \actualoperator
         \ifblank{#4}{}{\MakeCapital{#4} }%
         #2%
         \ifblank{#5}{}{ #5}%
         \ifblank{#3}{}{, #3}!#6
            \actualoperator\unexpanded{\citefield}{indextitle}#8}}}%
    {\protected@edef\theindexentry{%
       \unexpanded{#1}\authorsindex{%
         \@firstofone #2% remove spurious braces
         \ifblank{#5}{}{ #5}%
         \ifblank{#3#4}{}{,}%
         \ifblank{#3}{}{ #3}%
         \ifblank{#4}{}{ #4}!#6\actualoperator
            \unexpanded{\citefield}{#7}{indextitle}#8}}}%
  \theindexentry
  \endgroup}
\makeatother
% redefine this if the index for years is differently named, or if using
% index or imakeidx
\newcommand{\yearsindex}{{years}}

% redefine this if the index for authors is differently named, or if
% using index or imakeidx
\newcommand{\authorsindex}{{authors}}

% undated entries
\newcommand{\undated}{n.d.}

\usepackage{multind}
\makeindex{authors}
\makeindex{years}

\begin{document}

\chapter{Introductory works}

\section{An overly long treatise on procrastination}

\fullcite{Author2010}

This paper was really useful in telling me how to waste more time rather 
than doing real work.

\section{Waste of time or time of waste: procrastination in a modern society}

\cite{Writer2011}

Applies post-modern philosophical theory to procrastination.

\section{Procrastination for dummies}

\cite{Writer2003}

A classic reference book for anybody starting a research position.

\section{The Awkward Squad}

\cite{knuth:ct:b}

An author who uses a title that indexing programs find hard to cope
with, but certainly no procrastinator.

\cite{yearless}

An author so lazy that he cannot be bothered to put a year of publication.


\printbibliography
\printindex{authors}{Author index}
\printindex{years}{Year index}

\end{document}

(필요한 경우 biblatex를 동축하여 매우 복잡한 색인 생성을 수행할 수 있습니다. 저는 아주 많은 색인(33개 이상!)을 생성할 수 있고 제목뿐만 아니라 색인을 기반으로 하는 스타일의 첫 번째 버전을 방금 완성했습니다. 필드를 사용하지만 포스트노트를 사용하여 하위 항목을 설정하는 것은 흥미롭지 않지만 biblatex 스탠드로는 절대적으로 가능합니다.

답변2

biblatexMaieul의 기능 요청과 Paul의 피드백 덕분에 인덱싱, 특히 하위 항목 연산자를 사용한 인덱싱을 돕기 위해 2.3 에 여러 보조 명령과 매크로가 도입되었습니다 !. 문서( 22-indexing-subentry.tex)의 예제 22에서는 패키지를 사용하는 하위 항목이 있는 여러 인덱스를 보여줍니다 imakeidx. 다음은 를 사용한 유사한 예입니다 multind.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[indexing=cite,style=authoryear,backend=bibtex]{biblatex}

% Define indices
\usepackage{multind}
\makeindex{authors}
\makeindex{years}

% Name indexing directive for names with title subentries
\DeclareIndexNameFormat{name:title}{%
  \iffieldundef{title}
    {\usebibmacro{index:name}{\index{authors}}{#1}{#3}{#5}{#7}}
    {\usebibmacro{index:name:title:year}{\index{authors}}{#1}{#3}{#5}{#7}}}

% Based on index:name:title macro defined in biblatex.def, takes the arguments:
%   {<index command>}{<last name>}{<first name>}{<first initials>}{<last name prefix>}
% The index:name:subentry macro (also defined in biblatex.def) takes two more:
%   {<plain entry>}{<formatted entry>}
% and forms the subentry: !<plain entry>@<formatted entry>
\newbibmacro*{index:name:title:year}[5]{%
  \iffieldundef{year}
    {\usebibmacro{index:name:title}{#1}{#2}{#3}{#4}{#5}}
    {\usebibmacro{index:name:subentry}{#1}{#2}{#3}{#4}{#5}
       {\thefield{indexsorttitle}}
       {\emph{\csfield{indextitle}}~(\thefield{labelyear})}}}

% Title indexing directive for years with title subentries
\DeclareIndexFieldFormat{year:title}{%
  \iffieldundef{year}
    {\usebibmacro{index:entry}{\index{years}}{%
       \mkbibindexentry{0}{Not dated}%
       \subentryoperator%
       \mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}
    {\usebibmacro{index:entry}{\index{years}}{%
       \thefield{year}\subentryoperator%
       \mkbibindexfield{\thefield{indexsorttitle}}{\emph{#1}}}}}

\renewbibmacro*{citeindex}{%
  \ifciteindex
    {\indexnames[name:title]{author}%
     \indexfield[year:title]{indextitle}}
    {}}

% Index entries accessed via \fullcite
\DeclareCiteCommand{\fullcite}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usedriver
     {\DeclareNameAlias{sortname}{default}}
     {\thefield{entrytype}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\fullcite{knuth:ct,knuth:ct:a,knuth:ct:c,knuth:ct:d}
\cite{aristotle:anima,aristotle:poetics,aristotle:physics,aristotle:rhetoric}
\printbibliography
\raggedright
\printindex{authors}{Author and Title Index}
\printindex{years}{Year and Title Index}
\end{document}

답변3

비슷한 문제에 대해 스크립트 파이썬을 사용합니다.http://geekographie.maieul.net/Un-index-des-sources-primaires-3.

두 개 이상의 필드를 색인화할 수 있는지 묻는 티켓을 열었습니다.https://github.com/plk/biblatex/issues/31

관련 정보