我正在尝试引用一个网站,但收到了这条消息
Underfull \hbox (badness 1939) in paragraph at lines 9--11
我的引用是
@MISC{K&J,
author = {k\&J magnetics},
year = {2011},
title = {The original K\&J magnet calculator},
howpublished ={\url{https://www.kjmagnetics.com/calculator.asp}},
note = {Accessed 2020-2-30},
}
我正在使用的软件包
\documentclass[5p,preprint]{elsarticle}
\journal{Energy}
\setcitestyle{square}
\usepackage{times}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage[RPvoltages]{circuitikz}
\usetikzlibrary{patterns}
\usepackage{array,booktabs}
%\usepackage[round, sort & compress]{natbib}
\usepackage{tikz}
\usepackage{float}
\hypersetup{pdfauthor=whatever}
答案1
一些建议和意见:
为了避免因为 URL 字符串而收到有关行数不足或过满的警告消息,请加载
xurl
包前加载中hyperref
。由于
elsarticle-num
参考书目样式识别名为的字段url
,因此请使用它,即将 替换howpublished = {\url{https://www.kjmagnetics.com/calculator.asp}},
为url = {https://www.kjmagnetics.com/calculator.asp},
。K\&J
将字段中的字符串括title
在花括号中,以防止其被 BibTeX 转换为小写。将
author
字段从更改{k\&J magnetics}
为{{K\&J Magnetics}}
,以便将作者识别为“公司”作者并排在 K 下,而不是 M 下。对于
elsarticle
文档类,最好将其指定times
为文档类选项,而不是将其作为包加载。
\documentclass[5p,preprint,times]{elsarticle}
\journal{Energy}
\begin{filecontents}[overwrite]{testbib.bib}
@MISC{K&J,
author = {{K\&J Magnetics}},
year = {2011},
title = {The Original {K\&J} Magnet Calculator},
xxhowpublished= {\url{https://www.kjmagnetics.com/calculator.asp}},
url = {https://www.kjmagnetics.com/calculator.asp},
note = {Accessed 2020-2-30},
}
\end{filecontents}
\bibliographystyle{elsarticle-num} % information gleaned from an earlier posting
\setcitestyle{square}
\usepackage{graphicx,subfig,amsmath,array,booktabs}
\usepackage{tikz}
\usepackage[RPvoltages]{circuitikz}
\usetikzlibrary{patterns}
\usepackage{xurl} % <-- new
\usepackage[colorlinks,allcolors=blue]{hyperref}
\hypersetup{pdfauthor=whoever}
\begin{document}
\cite{K&J}
\bibliography{testbib}
\end{document}