最简单的一个latex例子-打印所有中英文参考文献

复制代码
\documentclass[11pt]{ctexart} % 使用 ctexart 以支持中文
\usepackage[margin=2cm,a4paper]{geometry}

\usepackage{fontspec} % 加载 fontspec 包
\setmainfont{Times New Roman} % 设置英文字体为 Times New Roman
% \setCJKmainfont{SimSun} % 设置中文字体为 宋体 C-China,J-Japan,K-Korea

% \usepackage[breadlinks]{hyperref}
% \usepackage[backend=biber]{biblatex}
% \addbibresource{myrefs.bib}
% \nocite{*}
% \printbibliography

\usepackage{natbib}           % 引用管理
\usepackage{ctex}            % 支持中文

\bibliographystyle{plainnat}  % 参考文献样式

\begin{document}
    
    \title{参考文献示例}
    \author{作者姓名}
    \date{\today}
    \maketitle
    
    \section{引言}
    这是一个包含中文和英文文献的简单例子。在本示例中,我们将输出所有参考文献。
    
    \nocite{*}  % 输出所有文献
    
    \bibliography{myrefs}  % 指定.bib文件名,不需要扩展名
    
\end{document}
复制代码

另外还需要一个bib文件,里面是你的参考文献。这里用的natbib库对文献进行管理,对于期刊什么的应该够了,如果数量较多的话要换bibtex这个库

当然也可以使用biber,问题是用texstudio编译查看pdf之后是不显示参考文献的,以为是代码的问题,结果是要再f8一下,然后f5才会出现

Biblatex 与 Biber:配置我的编辑器以避免未定义的引用 - TeX - LaTeX Stack Exchange --- Biblatex with Biber: Configuring my editor to avoid undefined citations - TeX - LaTeX Stack Exchange

最好是用期刊的模板吧,省得自己调试了

复制代码
\documentclass[11pt]{article} 
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{comment}

\usepackage[margin=2cm,a4paper]{geometry}

% style could be numeric,alphabetic,authoryear,apa,ieee,verbose
% sorting could be none nyt nty ydnt ynt
\usepackage[
backend=biber,
style=ieee,
sorting=nty
]{biblatex}
\addbibresource{zznrefs.bib}

%\usepackage{fontspec} % 加载 fontspec 包
%\setmainfont{Times New Roman} % 设置英文字体为 Times New Roman

\title{My publications}
\author{Stephen}
\date{\today}

\begin{document}    

    \maketitle
    
    \section{Introduction}
        An example to refere an literature. 1111 2222
    
    \nocite{*}  % 输出所有文献    
    \printbibliography
        
\end{document}
复制代码

 

posted on   风中狂笑  阅读(151)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2022-10-16 pyqt5学习笔记

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示