Notice
Recent Posts
Recent Comments
Link
관리 메뉴

뛰는 놈 위에 나는 공대생

[LaTeX] 참고 문헌 삽입 (bibtex, natbib, biblatex) 본문

기타/논문작성 Writing

[LaTeX] 참고 문헌 삽입 (bibtex, natbib, biblatex)

보통의공대생 2024. 6. 26. 10:33

 

이 글에서는 overleaf나 latex에서 참고문헌을 삽입하는 방법에 대해서 다룬다.

본인이 서지프로그램(endNote, Zotero, Mendeley 등)을 쓰고 있다면 bib 파일을 출력해서 쉽게 사용할 수 있지만

가장 기본적인 방법부터 패키지 사용법에 대해 다룬다.

자세하게 옵션을 설정하는 것은 나중에 작성한다.

 

bibtex 파일은

 

 

대부분의 논문 사이트에서 제공하는 서지 파일 형식이다. 이 bibtex를 모아서 bib 파일을 직접 만들 수도 있다.

 

이런 파일을 모두 메모장에 모아놓고 bib 파일 확장자로 저장

 

1. 기본 방법

 

참고문헌을 삽입할 때는 일일이 bibitem으로 넣어주는 방법이 가장 기본적일 것이다.

 

\begin{thebibliography}{widest entry}
 \bibitem[label1]{cite_key1} bibliographic information
 \bibitem[label2]{cite_key2} bibliographic information
 ...
\end{thebibliography}

 

위와 같은 형태가 가장 기본적이다. latex은 필수 옵션은 {}으로 표기하고, 선택옵션은 []로 표기한다.

즉, 위에서 label1은 옵션이고 cite_key1은 필수이다. 당연히 본문 내에서 인용을 하려면 cite_key 입력을 통해서 매칭시켜야 하기 때문이다.

위에서 widest entry는 본인이 사용할 레퍼런스들의 총 숫자를 예상할 때의 값을 넣는 것이다. 잘 모르겠으면 00으로 넣어도 무방한 것으로 보인다.

 

 

다음과 같이 사용할 수 있다.

\begin{thebibliography}{00}

\bibitem{FD2} S. Park, \textit{Full-Duplex Communication for Cooperative Cognitive Radio Networks with Two Simultaneous Transmit and Receive Antennas}, Master Thesis, Korea Adv. Inst. Science, Techn., Daejeon, Republic of Korea, 2016.
\bibitem{RVP2}  I. Song, J. Bae, and S. Y. Kim, \textit{Advanced Theory of Signal Detection: Weak Signal Detection in Generalized Observations}, Springer-Verlag, 2002.
\bibitem{ML2} I. Song, T. An, and J. Oh, \textit{Near ML decoding method based on metric-first search and branch length threshold,} registration no. US 8018828 B2, Sep. 13, 2011, USA. 
\bibitem{SOCA2} H.-K. Min, T. An, S. Lee, and I. Song, “Non-intrusive appliance load monitoring with feature extraction from higher order moments,” in \textit{Proc. 6th IEEE Int. Conf. Service Oriented Computing, Appl.,} Kauai, HI, USA, pp. 348-350, Dec. 2013.
\bibitem{EF2} I. Song and S. Lee, “Explicit formulae for product moments of multivariate Gaussian random variables,” \textit{Statistics, Probability Lett.,} vol. 100, pp. 27-34, May 2015.
\end{thebibliography}

 

 

 

2. 자동으로 참고문헌 삽입

 

2-1. 추가 패키지 없이 스타일 만들어서 사용 (내장된 bibtex 사용)

보통은 위와 같이 입력하면 형식을 통일하기 어렵고 순서를 본인이 넣어줘야하기 때문에 어렵다.

그래서 자동으로 정렬하고 형식을 바꾸는 방식을 선호하기도 한다.

본인이 서지프로그램을 사용하고 있다면 서지를 묶어서 bib 파일로 내보낼 수 있다.

 

그래서 우리가 필요한 것은 참고문헌 형식을 지정해주는 bst (옵션)와 인용할 문서들이 bibtex 형식으로 저장된 bib 파일이 필요하다.

 

 

\bibliographystyle{plain}
\bibliography{mybib} % ->compile하면 사용된 참고문헌이 출력

 

위를 보면 plain이라는 스타일에 mybib.bib 파일을 사용할 것이라는 것을 알 수 있다.

plain.bst는 이미 latex에 내장되어있는 스타일이라서 바로 사용할 수 있다.

또한 저널에 논문을 낼 때 보면 bst 파일을 같이 배포하는 경우가 있는데 이 경우에는 그 bst 파일을 위와 같이 지정해주면 된다.

 

 

2-2. 추가 패키지 사용

 

그런데 대부분의 사람들은 natbib, bibtex, biblatex와 같은 패키지를 사용하게 된다. 이를 사용하는 이유는 이 패키지들이 많은 형식들을 커버하고 있어서 편하기 때문이다.

bibTeX가 가장 클래식한 패키지이고, 좀 더 발전된 것이 natbib, 최신 버전이 biblatex라고 한다.

 

대신 각 라이브러리마다 사용할 때 명령어가 조금씩 다르다.

 

1) natbib

 

natbib은 bibtex에서 좀 더 다양한 citation 커맨드를 제공해줘서 편하다. 필자도 natbib을 쓴다. 실제 문서를 쓸 때는 citation command도 중요하기 때문.

 

기본 style을 아래와 같이 제공하는데 IEEEtran도 경험 상 그냥 써도 되었다. (아래 예시 참고)


Style NameDescription
plainnat : Similar to plain, compatible with natbib package
abbrvnat : Similar to abbrv, compatible with natbib package
unsrtnat : Similar to unsrt, compatible with natbib package
apalike : APA-like style, compatible with natbib package
nature : Nature-like style, compatible with natbib package
chicago : Chicago Manual of Style, compatible with natbib package
plainnatnat : A variation of plainnat with more natural names
agsm : Harvard AGPS style, compatible with natbib package

 

\usepackage[numbers, sort&compress]{natbib}

%(본문내용...)

% 참고문헌 파트
\bibliographystyle{IEEEtran}
\bibliography{My_thesis}

 

 

 

 

2) biblatex

biblatex는 써본 적은 없으나 다음과 같이 사용한다. 기본적으로 제공해주는 스타일들도 있으니 package 문서를 참고하는 것을 권한다.

\usepackage[style=<style>]{biblatex}
\addbibresource{<bib-file>.bib}

 

예시 (overleaf에서 소개)

다음과 같이 biblatex을 사용하고 bib 파일을 추가한 다음에 원하는 위치에 \printbibliography로 출력한다.

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}
\addbibresource{sample.bib}

% (본문내용)

\printbibliography

 

 


https://www.overleaf.com/learn/latex/Bibliography_management_in_LaTeX

 

Bibliography management in LaTeX - Overleaf, Online LaTeX Editor

An online LaTeX editor that’s easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

www.overleaf.com

https://www.citedrive.com/en/blog/mastering-bibliography-styles-latex-guide-bibtex-natbib-biblatex/

 

Mastering Bibliography Styles in LaTeX/Overleaf: A Quick Guide for BibTeX, natbib, and BibLaTeX | CiteDrive - Collaborative BibT

Mastering Bibliography Styles in LaTeX/Overleaf: A Quick Guide for BibTeX, natbib, and BibLaTeX Do you use LaTeX or Overleaf and need help customizing bibliography styles for your documents? Whether in BibTeX, natbib, or BibLaTeX, bibliography style custom

www.citedrive.com

 

Comments