LaTeX備忘——參考文獻示例

本文介紹LaTeX中參考文獻表示方法之一。


操作系統:Ubuntu 20.04

編輯工具:TeXstudio 2.12.22

編譯方式:LuaLaTeX

編譯命令:lualatex -shell-escape -synctex=1 -interaction=nonstopmode %.tex


示例文件的完整代碼如下:

% 開源中國,陸巍
\documentclass[oneside]{book}%

% 注意宏包順序,有可能會報錯
\usepackage{ctex}% 中文支持
\usepackage{geometry}% 用於頁面設置
\usepackage[dvipsnames, svgnames, x11names]{xcolor} % 顏色支持
\usepackage{graphics}% 圖形支持
\usepackage[
  colorlinks=true,
  linkcolor=Navy,
  urlcolor=Navy,
  citecolor=Navy,
  anchorcolor=Navy
]{hyperref}
\usepackage{enumerate}% 枚舉支持
\usepackage{tcolorbox}% 支持更好的文本框
\usepackage[english]{babel}% 載入美式英語斷字模板
\usepackage[cache=false]{minted}% 支持更好的代碼顯示

% 設置爲A4紙,邊距適中模式(永中office)
\geometry{%
  width = 210mm,%
  height = 297mm,
  left = 19.1mm,%
  right = 19.1mm,%
  top = 25.4mm,%
  bottom = 25.4mm%
}

\hyphenpenalty = 1000% 斷字設置,值越大,斷字越少。
\setmainfont{Ubuntu Mono}% 設置全局英文字體
\setlength{\parindent}{2em}% 縮進
\setlength{\parskip}{2ex} % 段間距
\setcounter{secnumdepth}{3} % 顯示到第3級section的編號

% 修改參考文獻的標題,默認是Bibliography,這裏改爲References
% 這裏因爲使用了babel宏包,所以命令如下。如果未使用babel宏包,則使用命令:
% \renewcommand{\bibname}{References}
\addto{\captionsenglish}{\renewcommand{\bibname}{References}}

\begin{document}
  % ------------------ 目錄 -------------------
  \tableofcontents  % 生成目錄
  
  % ------------------ 前言 -------------------
  \frontmatter

  % ------------------ 正文 -------------------
  \mainmatter%
  \chapter{參考文獻示例}
  ……
  
  解決這些問題的一個關鍵是可重用性。軟件重用的想法並不新鮮。但是,儘管取得了一些成功,可重用性並沒有成爲軟件開發的推動力。許多不成功的重用方法都沒有滿足重用性的基本要求\cite{ref1}。
  
  ……
  
  阻礙開發可重複使用組件的因素之一是,建造可重複使用的單元需要更多的時間和精力\cite{ref3,ref4}。
  
  ……
  
  
  \begin{thebibliography}{7}
    \bibitem{ref1}Basili, V. R., and H. D. Rombach, “Support for Comprehensive Reuse,” \textit{Software Engineering}, Vol. 6, No. 5, 1991, pp. 303–316.
    \bibitem{ref2}Brown, A. W., \textit{Large-Scale Component-Based Development}, Upper Saddle River, NJ: Prentice Hall, 2000.
    \bibitem{ref3}Crnkovic, I., and M. Larsson, “A Case Study: Demands on Component-Based Development,” \textit{Proc. 22nd Int. Conf. Software Engineering}, Limerick, Ireland, ACM Press, 2000.
    \bibitem{ref4}Szyperski, C., \textit{Component Software Beyond Object-Oriented Programming}, Reading, MA: Addison-Wesley, 1998, pp. 46–56.
    \bibitem{ref5}Maiden, N. A., and C. Ncube, “Acquiring COTS Software Selection Requirements,” \textit{IEEE Software}, Vol. 15, No. 2, 1998, pp. 46–56.
    \bibitem{ref6}Lamsweerde, A. V., “Requirements Engineering in the Year 00: A Research Perspective,” \textit{Proc. 22nd Int. Conf. Software Engineering}, Limerick, Ireland, ACM Press, 2000.
    \bibitem{ref7}Larsson, M., “Applying Configuration Management Techniques to Component-Based Systems,” Licentiate Thesis Dissertation 2000-007, Department of Information Technology, Uppsala University, Uppsala, Sweden, 2000.
  \end{thebibliography}
  
  
\end{document}

效果如下:

LaTeX參考文獻示例

關於參考文獻的標題,默認是Bibliography,修改的方法在代碼中有詳細描述。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章