연도를 괄호 안에 APA 스타일로 인용

연도를 괄호 안에 APA 스타일로 인용

저는 석사 논문을 작성하고 APA 스타일로 인용하고 있습니다. 아래는 현재 모습을 보여주는 사진입니다.

소환

일반적으로 괜찮아 보이지만 연도를 변경하여 괄호 안에 넣고 싶습니다. 또한 작성자 뒤에 오는 쉼표는 지우고 연도 뒤에 오는 쉼표는 그대로 두어 최종 버전이 다음과 같이 되도록 합니다.

Ruoffet al. (1953), p. 16

거의 최종 버전으로 만들기 위해 코드를 복사했기 때문에 원하는 형식으로 만들기 위해 추가로 변경하는 방법을 모르겠습니다.

서문에 있는 코드는 다음과 같습니다.

\documentclass[12pt]{report}
\usepackage{natbib}

\makeatletter
\newcommand*{\ibid}{Ibid.}
  \let\@predcite\@empty
  \let\@currcite\@empty
\def\citef{\kernel@ifnextchar[\citef@{\citef@[]}}
\def\citef@[#1]{\kernel@ifnextchar[{\citef@@[{#1}]}{\citef@@[][{#1}]}}
\def\citef@@[#1][#2]#3{%
  \def\@currcite{#3}%
  \unskip
    \ifx\@currcite\@predcite
      \footnote{#1 \ifx\tempa\@empty\unskip\fi%
      \ibid\ifx\tempb\@empty\else\NAT@cmt #2\fi}%
    \else%
      \footnote{\citealp[#1][#2]{#3}}%
    \fi
  \gdef\@predcite{#3}%
}
\makeatother

\bibliographystyle{apalike}

게다가 나는 본문에서 다음과 같이 인용했습니다(위 그림에 표시된 예에 대한 것임).

\citef[p. 16]{ruoff53}

미리 귀하의 조언에 진심으로 감사드립니다. 귀하의 도움에 크게 감사드립니다!

편집하다:

Bernard의 팁을 따르면 이제 다음 코드가 생겼습니다.

추가 힌트를 주실 수 있나요? 텍스트 본문을 다음과 같이 변경했는데, 완전히 엉망인 것 같습니다...

\documentclass[12pt]{report}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{biblio.bib}
\usepackage{rotating}

\makeatletter
\newcommand*{\ibid}{Ibid.}
  \let\@predcite\@empty
  \let\@currcite\@empty
\def\citef{\kernel@ifnextchar[\citef@{\citef@[]}}
\def\citef@[#1]{\kernel@ifnextchar[{\citef@@[{#1}]}{\citef@@[][{#1}]}}
\def\citef@@[#1][#2]#3{%
  \def\@currcite{#3}%
  \unskip
    \ifx\@currcite\@predcite
      \footnote{#1 \ifx\tempa\@empty\unskip\fi%
      \ibid\ifx\tempb\@empty\else\NAT@cmt #2\fi}%
    \else%
      \footnote{\citealp[#1][#2]{#3}}%
    \fi
  \gdef\@predcite{#3}%
}
\makeatother

\begin{document}


\chapter{Introduction}
\input{ma_chapters/introduction}
.
.
.
.

\bibliographystyle{apalike}
\bibliography{biblio}

답변1

apalike참고 문헌 스타일, 인용 관리 패키지 및 BibTeX 전반 에 문제가 없다고 가정하면 natbib원하는 인용 설명선 형식을 구현하는 새 매크로를 만들 수 있습니다.

\newcommand\mycite[2][]{\citeauthor{#2}\ (\citeyear{#2})\ifx#1\undefined\else, #1\fi}

첫 번째 선택적 인수가 지정되지 않으면 ; 뒤에 아무것도 인쇄되지 않습니다 \citeyear{#2}. 실제로 선택적 인수가 제공되지 않으면 would \mycite처럼 동작합니다 \citet.

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

\documentclass[12pt]{report}
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{ruoff,
  author = "A. Ruoff and B. Woof and C. Zoot",
  title  = "Thoughts",
  journal= "Circularity Today",
  year   = 1953,
}
\end{filecontents}
\usepackage{natbib}
\bibliographystyle{apalike}
\newcommand\mycite[2][]{%
  \citeauthor{#2}\ (\citeyear{#2})\ifx#1\undefined\else, #1\fi}
\begin{document}
\mycite[p.~16]{ruoff}  % with optional argument

\mycite{ruoff}  % without optional argument -- no comma is printed

\citet{ruoff}   % compare with output of "\citet"
\bibliography{biblio}
\end{document}

부록: 이러한 인용 설명선을 각주에 배치하려면 \myfootcite다음과 같이 정의된 매크로를 사용할 수 있습니다.

\newcommand\myfootcite[2][]{\footnote{\mycite[#1]{#2}.}}

각주 자료 끝에 마침표("마침표")를 넣지 않으려면 뒤를 생략 .하세요 {#2}.


두 번째 부록, "Ibid"를 인쇄하는 인용 매크로에 대한 OP의 요청을 수용합니다. 최신 항목이 이전 인용 명령의 항목과 동일한 경우:

이전 솔루션과 비교할 때 필요한 것은 현재 인용의 키가 이전 인용에 사용된 키와 동일한지 테스트를 추가하는 것뿐입니다. 다음 코드는 \tcite텍스트 내 인용을 위한 , \fcite각주 내 인용을 위한 두 개의 사용자 매크로를 제공합니다.

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

\documentclass[12pt]{report}
\usepackage[textheight=2in]{geometry} %% just for this example
\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{ruoff,
  author = "A. Ruoff and B. Woof and C. Zoot",
  title  = "Thoughts",
  journal= "Circularity Today",
  year   = 1953,
}
@article{abc,
  author = "Anna Andersen and Bertha Branson and Carla Carlsson",
  title  = "Further Thoughts",
  journal= "Circularity Today",   
  year   = 2053,
}
\end{filecontents}

\usepackage{natbib}
\bibliographystyle{apalike}
\def\prevcite{} % initialize \prevcite
%% macro for in-text citation
\newcommand\tcite[2][]{%  
  \def\newcite{#2} 
  \ifx\prevcite\newcite 
    Ibid.%
  \else%
    \gdef\prevcite{#2}% update \prevcite
    \citeauthor{#2}\ (\citeyear{#2})%
  \fi
  \ifx#1\undefined\else, #1\fi}
%% macro for in-footnote citation
\newcommand\fcite[2][]{\footnote{\tcite[#1]{#2}}}
\begin{document}


bla bla\fcite{ruoff}

more bla bla\fcite[p.~75]{ruoff}

still more bla bla\fcite[p.~101]{abc}

further bla bla\fcite{abc}

final bla bla\fcite[p.~999]{abc}
\bibliography{biblio}
\end{document}

답변2

.biblatex-apa​ 다음 옵션 을 사용하여 natbib 명령을 에뮬레이트할 수 있습니다 natbib.

\documentclass[12pt]{report}
\usepackage[utf8]{inputenc}

\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber, natbib]{biblatex}
\DeclareLanguageMapping{american}{american-apa}

\addbibresource{biblio.bib}

\usepackage{filecontents}
\begin{filecontents}{biblio.bib}
@article{ruoff,
  author = "A. Ruoff and B. Woof and C. Zoot",
  title = "Thoughts",
  journal= "Circularity Today",
  year = 1953,
}
\end{filecontents}

\renewcommand*{\nameyeardelim}{\addspace}

%
\usepackage{xpatch}

\makeatletter
\newbibmacro*{cite}{%
 \iffieldequals{namehash}{\cbx@lasthash}
% Multiple cites in one command
 {\setunit{\compcitedelim}%
 \usebibmacro{cite:plabelyear+extrayear}}%
% \bibcloseparen%
% Single cite
 {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}}
% No author/editor
 {\usebibmacro{cite:noname}%
 \setunit{\ifbool{cbx:np}%
 {\nameyeardelim}%
 {\global\booltrue{cbx:parens}\addspace\bibopenparen}}%
 \usebibmacro{cite:plabelyear+extrayear}%
 \bibcloseparen%
 \savefield{namehash}{\cbx@lasthash}}
% Normal cite
 {\ifnameundef{shortauthor}
 {\printnames[labelname][-\value{listtotal}]{labelname}}%
 {\cbx@apa@ifnamesaved
 {\printnames{shortauthor}}
 {\printnames[labelname][-\value{listtotal}]{author}\addspace\printnames[sabrackets]{shortauthor}}}%
 \setunit{\ifbool{cbx:np}%
 {\nameyeardelim}%
 {\global\booltrue{cbx:parens}\addspace\bibopenparen}}%
 \usebibmacro{cite:plabelyear+extrayear}%
 \bibcloseparen%
 \savefield{namehash}{\cbx@lasthash}}}%
 \setunit{\multicitedelim}}
\makeatother

\begin{document}

\chapter{Introduction}

\cite[p.~16]{ruoff} % with optional argument

\textcite{ruoff} % without optional argument -- no comma is printed

\citet{ruoff} % compare with output of "\citet"

\printbibliography

\end{document} 

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

관련 정보