apacite에 대한 다중 핀포인트 명령

apacite에 대한 다중 핀포인트 명령

\cite{}여러 개의 정확한 인용을 지원하기 위해 확장할 함수를 구성하려고 합니다 (여전히 apacite패키지를 사용하고 있음). ShareLaTex에서 깔끔한 PDF를 렌더링할 수 있고 \citeNP문서 내부에 얽힌 명령 없이도 구문 분석할 수 있는 LaTeX 표시가 있는 문서를 가지려고 합니다.

표준 구문은 다음과 \cite{}같습니다.

\cite<preliminarytext>[pinpoint]{bibtexref1,bibtexref2,...}

다음 명령을 만들려고 합니다.

\myapacite[pinpoint1,pinpoint2,...][additionaloptions]{bibtexref1,bibtexref2,...}

어디:

  • 의 쉼표로 구분된 "pinpoint" 매개변수 수가 \myapacite쉼표로 구분된 "bibtexref" 매개변수의 수와 같지 않으면 이를 무시하고 일반 \cite{}명령을 삽입합니다.

  • 쉼표로 구분된 "pinpoint" 및 "bibtexref" 매개변수의 수가 동일한 경우 다음과 같이 반복하여 삽입합니다.

    (\citeNP[pinpoint1]{bibtexref1}; \citeNP[pinpoint2]{bibtexref2}; ...)
    

여러 TeX 문제가 있을지라도 이것이 내가 달성하려는 기본 레이아웃입니다(많은 사람들과 마찬가지로 저는 프로그래밍 배경에서 왔으며 천천히 TeX/LaTeX를 선택하고 있습니다). 어떤 조언이라도 대단히 감사하겠습니다.

\documentclass[apacite]{apa6}
\usepackage{xparse,expl3}

\NewDocumentCommand\myapacite{O{}O{}m}{%
\if\equals{\clist_count:n {#1}}{\clist_count:n {#3}}%
    \cite[#1]{#3}%
    \else%
    \if\equals{1}{\clist_count:n {#3}}%
    \cite[#1]{#3}%
        \else%
        \if\equals{2}{\clist_count:n {#3}}%
        (\citeNP[\clist_item:Nn {1} {#2}]{\clist_item:Nn {1} {#3}}; \citeNP[\clist_item:Nn {2} {#2}]{\clist_item:Nn {2} {#3}})\fi\fi\fi%
}

\begin{document}

Single cite with no pinpoints: \myapacite{goossens93}
\\
\\
Double cite with both pinpoints: \myapacite[p.123,p.456]{greenwade93,goossens93}
\\
\\
Double cite with no pinpoints: \myapacite{greenwade93,goossens93}
\\
\\
\bibliography{ testbib }
\end{document}

다음은 파일입니다 testbib.bib(ShareLaTeX에서 파일 콘텐츠를 사용하는 방법을 알아낼 수 없었습니다).

@article{greenwade93,
    author  = "George D. Greenwade",
    title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
    year    = "1993",
    journal = "TUGBoat",
    volume  = "14",
    number  = "3",
    pages   = "342--351"
}
@book{goossens93,
    author    = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
    title     = "The LaTeX Companion",
    year      = "1993",
    publisher = "Addison-Wesley",
    address   = "Reading, Massachusetts"
}

관련 정보