我有以下在线来源(URL),并用它创建了一个 BibTex 条目
@online{verbraucherzentrale2023,
title = {Energieausweis: Was sagt dieser Steckbrief für Wohngebäude aus?},
author = {{Verbraucherzentrale NRW e.V.}},
year = {2023},
url = {https://www.verbraucherzentrale.de/wissen/energie/energetische-sanierung/energieausweis-was-sagt-dieser-steckbrief-fuer-wohngebaeude-aus-24074},
}
存在两个问题:
- 标题是指向 URL 的链接(因此为蓝色)。它应该只是一个没有链接的标题。
- URL 超出了纸张的边界。不应该出现这种情况。应通过在正确位置进行换行来防止这种情况发生
您知道我必须如何调整 bibtex 条目才能摆脱这两个问题吗?
更新:这是主要的 Latex 文件
\documentclass[5p,times,twocolumn]{elsarticle}
\usepackage{physics}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{hidelinks}
\usepackage{csquotes}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{acro}
\include{sections/00_acro}
\graphicspath{{figures/}}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{float}
\usepackage{comment}
\usepackage{subcaption}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{nomencl} % Nomenclature package
\usepackage{makecell}
\usepackage{xurl}
%Define the color of the links
\usepackage{xcolor}
\usepackage{hyperref}
\definecolor{myColor}{RGB}{0, 0.0, 0}
\hypersetup{
colorlinks=true,
linkcolor=myColor,
citecolor=myColor,
urlcolor=myColor,
}
\journal{}
\begin{document}
\begin{frontmatter}
\title{Title}
\author[1]{Author 1}
\author[1]{Author 2}
\address[1]{Institue 1}
\begin{abstract}
\input{sections/00_abstract}
\end{abstract}
\begin{comment}
%%Graphical abstract
\begin{graphicalabstract}
\includegraphics{grabs}
\end{graphicalabstract}
%%Research highlights
\begin{highlights}
\item Research highlight 1
\item Research highlight 2
\end{highlights}
\end{comment}
\begin{keyword}
%% keywords here, in the form: keyword \sep keyword
keyword 1 \sep keyword 2 \sep keyword 3 \sep keyword 4 \sep keyword 5
%% PACS codes here, in the form: \PACS code \sep code
%\PACS 0000 \sep 1111
%% MSC codes here, in the form: \MSC code \sep code
%% or \MSC[2008] code \sep code (2000 is the default)
%MSC 0000 \sep 1111
\end{keyword}
\end{frontmatter}
\thispagestyle{empty} % Remove page number and header/footer on the first page
%% \linenumbers
%\input{sections/00_nomecl}
\input{sections/01_intro}
\input{sections/02_results}
\input{sections/03_conclusion}
%% If you have bibdatabase file and want bibtex to generate the
%% bibitems, please use
%%
\bibliographystyle{elsarticle-num}
\bibliography{refs}
%% else use the following coding to input the bibitems directly in the
%% TeX file.
% \begin{thebibliography}{00}
% %% \bibitem{label}
% %% Text of bibliographic item
% \bibitem{}
% \end{thebibliography}
\end{document}
\endinput
%%
%% End of file `elsarticle-template-num.tex'.
答案1
评论太长了,但这似乎在一个文件中复制了你的第一张图片
\documentclass[5p,times,twocolumn]{elsarticle}
\usepackage{physics}
\usepackage{tabularx}
\usepackage{siunitx}
\usepackage{xcolor}
\usepackage{hyperref}
\hypersetup{hidelinks}
\usepackage{csquotes}
\usepackage{amssymb}% http://ctan.org/pkg/amssymb
\usepackage{pifont}% http://ctan.org/pkg/pifont
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
\usepackage{acro}
\include{sections/00_acro}
\graphicspath{{figures/}}
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{float}
\usepackage{comment}
\usepackage{subcaption}
\usepackage{framed} % Framing content
\usepackage{multicol} % Multiple columns environment
\usepackage{nomencl} % Nomenclature package
\usepackage{makecell}
\usepackage{xurl}
%Define the color of the links
\usepackage{xcolor}
\usepackage{hyperref}
\definecolor{myColor}{RGB}{0, 0.0, 0}
\hypersetup{
colorlinks=true,
linkcolor=myColor,
citecolor=myColor,
urlcolor=myColor,
}
\journal{}
\begin{filecontents}[overwrite]{refs.bib}
@online{verbraucherzentrale2023,
title = {Energieausweis: Was sagt dieser Steckbrief für Wohngebäude aus?},
author = {{Verbraucherzentrale NRW e.V.}},
year = {2023},
url = {https://www.verbraucherzentrale.de/wissen/energie/energetische-sanierung/energieausweis-was-sagt-dieser-steckbrief-fuer-wohngebaeude-aus-24074},
}
\end{filecontents}
\begin{document}
\cite{verbraucherzentrale2023}
\bibliographystyle{elsarticle-num}
\bibliography{refs}
\end{document}
问题 2 很容易回答,xurl
按照示例中的方法操作即可。它比普通方法引入了更多断点url
。
对于问题 1,这是由于正在使用的 bibtex 样式造成的elsarticle-num.bst
。它将标题包裹在内\href{url}{title}
。似乎没有任何方法可以关闭此功能。
我们可以做
\renewcommand\href[2]{#2}
在参考书目之前。但是,如果您被要求使用特定模板和特定的 bibtex 样式,那么您真的不应该更改格式。