natbib 및 plainnat를 사용하여 인용 및 참고문헌 정렬

natbib 및 plainnat를 사용하여 인용 및 참고문헌 정렬

LaTeX로 논문을 쓰고 있어요. 저는 인용 및 참고 문헌에 대한 natbib패키지와 스타일을 작업하고 있습니다. plainnat문제는 인용과 참고 문헌이 어떻게 정렬되는지입니다.

나는 인용을 연도별로(같은 연도에 대해 알파벳순으로) 정렬하고 참고문헌을 저자의 성을 기준으로 알파벳순으로 정렬하고 싶습니다. 내가 어떻게 해?

내 코드:

    \documentclass[12pt,a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}
    \usepackage[comma,authoryear,round]{natbib}
    \usepackage[none]{hyphenat} 
    \bibliographystyle{plainnat}
    \setcitestyle{citesep={;}}

    \begin{filecontents}{\jobname.bib}
    @book{A,
     author = {Ho, L. and Auntz, K. and Zwitter, B. F. and Valencia, D.},
     year = {2010},
     title = {Title Example 1},
    }
    @book{B,
     author = {Ho, L. and Yelp, A. and Richter, G. and Gregory, K. T.},
     year = {2005},
     title = {Title Example 2},
    }
    @book{C,
     author = {Ho, L. Abrook, H. and Dolman, R. G. and Fjing, H. and Ho, S. and Xerem, R.},
     year = {2013},
     title = {Title Example 3},
    }
    }
    @book{D,
     author = {Di Bernardo, L. and Mc Daug, C. and Coelho, L},
     year = {2000},
     title = {Title Example 4},
    }
    @book{E,
     author = {Gomes, L. N. L. and Ginoris, Y. P and Brand\~{a}o, C. C. S.},
     year = {2010},
     title = {Title Example 5},
    }
    \end{filecontents}


    \begin{document}
    Hi, this is an example. First a citation \citep{A,B},
then an inline citation \citet{B}.
Another citation \citep{C,D} and
the last one \citep{A,E}
    \bibliography{\jobname}
    \end{document}

관찰 결과는 다음과 같습니다.

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

답변1

sort옵션 을 추가하면natbib

    \usepackage[sort,comma,authoryear,round]{natbib}

그런 다음 먼저 저자 이름을 기준으로 정렬한 다음 연도를 기준으로 정렬합니다. 먼저 연도별로 정렬한 다음 저자 이름을 기준으로 정렬하려는 것 같습니다. 나는 natbib그것을 지원한다고 믿지 않습니다 .

편집하다:plainnat.bst이름보다 연도별로 먼저 정렬하도록 복사본을 수정하는 것은 매우 쉽습니다 . 이것은 귀하의 예에서 보여주는 내용이 아닌 것 같지만 아마도 귀하가 원하는 것일 수도 있습니다.

plainnat.bst먼저 현재 디렉터리에 의 복사본을 만들고 이름을 으로 지정합니다 yearnat.bst. 내 컴퓨터에서는 다음을 통해 그렇게 할 수 있습니다.

$ cp `kpsewhich plainnat.bst` yearnat.bst

기능을 편집 하고 다음과 같이 yearnat.bst변경합니다 .presort

FUNCTION {presort}
{ calc.label
  label sortify
  "    "
  *
  year field.or.null sortify
  "    "
  *
  type$ "book" =
  type$ "inbook" =
  or
    'author.editor.sort
    { type$ "proceedings" =
        'editor.organization.sort
        { type$ "manual" =
            'author.organization.sort
            'author.sort
          if$
        }
      if$
    }
  if$
  *
  "    "
  *
  cite$
  *
  #1 entry.max$ substring$
  'sort.label :=
  sort.label *
  #1 entry.max$ substring$
  'sort.key$ :=
}

이 작업은 year필드를 정렬 키의 시작 부분으로 이동하는 것뿐입니다.

이제 sort위와 같은 옵션과 \bibliographystyle{yearnat}. 결과는 다음과 같습니다.

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

모든 것이 먼저 연도별로 정렬된 다음 작성자별로 정렬되어 있는 것을 볼 수 있습니다. 그것이 어떻게 작동하는지 알고 싶다면 다음을 읽어야 합니다.btxhak(또는 실행하여 texdoc btxhak).

관련 정보