在 moderncv 模板中添加出版物

在 moderncv 模板中添加出版物

如何在moderncv模板中添加以下出版物(例如)?

艾尔伯特爱因斯坦。 归于电力动力学的波动。 (德语)[论运动物体的电动力学]。物理学年鉴,322(10):891–921,1905。

我创建了一个名为的文件,publication.bib用于存储信息:

 @article{einstein,
         author = "Albert Einstein",
         title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
                [{On} the electrodynamics of moving bodies]",
         journal = "Annalen der Physik",
         volume = "322",
         number = "10",
         pages =  "891--921",
         year = "1905",
         DOI = "http://dx.doi.org/10.1002/andp.19053221004"
   }

然后我就打电话给publication.bibdocument.tex

\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}       

 \moderncvcolor{green}   

 \usepackage[utf8]{inputenc}       

  \usepackage[scale=0.75]{geometry}

  \name{John}{Doe}
  \title{Resumé title}            

  \address{street and number}{postcode city}{country}

  \phone[mobile]{+1~(234)~567~890}         

  \phone[fixed]{+2~(345)~678~901}        

  \phone[fax]{+3~(456)~789~012}      

  \email{[email protected]}         

  \homepage{www.johndoe.com}       

  \extrainfo{additional information}     

   \begin{document}

   \makecvtitle

   \section{Education}
   \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % arguments 3 to 6 can be left empty
  \cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}


 \bibliographystyle{unsrt}
 \bibliography{publication}

 \end{document}

运行document.tex正常。但是它不显示 中包含的信息publication.bib

在此处输入图片描述

为什么它不显示参考?

答案1

你几乎就成功了。

唯一缺少的是您需要使用命令\nocite{*}来告诉 BibTeX 所有 bib 条目都应该添加到参考书目中。

请参阅以下 MWE(我曾经filecontents将 bib 文件和 tex 代码放在一个 MWE 中;重要的更改以 标记<========):

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{einstein,
  author  = "Albert Einstein",
  title   = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
              [{On} the electrodynamics of moving bodies]",
  journal = "Annalen der Physik",
  volume  = "322",
  number  = "10",
  pages   =  "891--921",
  year    = "1905",
  DOI     = "http://dx.doi.org/10.1002/andp.19053221004"
}
\end{filecontents*}


\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}       

\moderncvcolor{green}   
\usepackage[utf8]{inputenc}       
\usepackage[scale=0.75]{geometry}

\name{John}{Doe}
\title{Resumé title}            
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}         
\phone[fixed]{+2~(345)~678~901}        
\phone[fax]{+3~(456)~789~012}      
\email{[email protected]}         
\homepage{www.johndoe.com}       
\extrainfo{additional information}     


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\nocite{*} % <==========================================================
\bibliographystyle{unsrt}
\bibliography{\jobname} % To use bib file created by filecontents

\end{document}

pdflatex使用、bibtexpdflatex、编译后的结果页面pdflatex

生成的 pdf

相关内容