代码:

代码:

是否可以改变 bibtex 的行为/设置,以便标题(书籍、文章、论文、论文等)始终为斜体,而其他所有内容(例如作者、期刊、版本等)始终为直立?

基本上: 在此处输入图片描述

最小工作示例:

Latex 文件:

\documentclass{article}
\begin{document}
I cite ~\cite{Bre89}.
\nocite{*}
\bibliography{Master}
\bibliographystyle{alpha}
\end{document}

主.bib:

@book {Bre89,
    AUTHOR = {Bressoud, David M.},
     TITLE = {{Factorization and Primality Testing}},
    SERIES = {Undergraduate Texts in Mathematics},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1989},
}
@article {CEP83,
    AUTHOR = {Canfield, E. R. and Erd{\H{o}}s, Paul and Pomerance, Carl},
     TITLE = {On a problem of {O}ppenheim concerning ``factorisatio
              numerorum''},
   JOURNAL = {J. Number Theory},
  FJOURNAL = {Journal of Number Theory},
    VOLUME = {17},
      YEAR = {1983},
    NUMBER = {1},
     PAGES = {1--28},
}

我的 bib 文件实际上要大得多,因此涉及我更改每个条目的解决方案并不理想。

答案1

复制alpha.bst并命名为myalpha.bst。在 中myalpha.bst搜索

FUNCTION {format.title}
{ title empty$
    { "" }
    { title "t" change.case$ }
  if$
}

并将其替换为

FUNCTION {format.title}
{ title empty$
    { "" }
    { title emphasize "t" change.case$ }  
  if$
}

请注意添加emphasize

现在搜索

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      format.vol.num.pages output
      format.date "year" output.check
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

并替换为

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal "journal" output.check
      format.vol.num.pages output
      format.date "year" output.check
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

此处,emphasize从行中删除:journal emphasize "journal" output.check以防止期刊标题变得过于突出。

不要忘记使用\bibliographystyle{myalpha}

代码:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{Master.bib}
@book {Bre89,
    AUTHOR = {Bressoud, David M.},
     TITLE = {{Factorization and Primality Testing}},
    SERIES = {Undergraduate Texts in Mathematics},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1989},
}
@article {CEP83,
    AUTHOR = {Canfield, E. R. and Erd{\H{o}}s, Paul and Pomerance, Carl},
     TITLE = {On a problem of {O}ppenheim concerning ``factorisatio
              numerorum''},
   JOURNAL = {J. Number Theory},
  FJOURNAL = {Journal of Number Theory},
    VOLUME = {17},
      YEAR = {1983},
    NUMBER = {1},
     PAGES = {1--28},
}
\end{filecontents*}
\begin{document}
I cite ~\cite{Bre89}.
\nocite{*}
\bibliography{Master}
\bibliographystyle{myalpha}
\end{document}

在此处输入图片描述

按照相同的策略根据您的意愿添加/删除强调/删除强调。

答案2

如果您不想手动创建文件.bst,一种解决方案是将样式替换alpha为 AMS 提供的相应样式:样式amsalpha

因此,只需替换

\bibliographystyle{alpha}

\bibliographystyle{amsalpha}

你就会得到你想要的。

但请注意,这种样式也会改变参考书目条目格式的其他内容。

相关内容