![强制将文件名很长的参考书目链接保持在列宽内](https://linux22.com/image/396220/%E5%BC%BA%E5%88%B6%E5%B0%86%E6%96%87%E4%BB%B6%E5%90%8D%E5%BE%88%E9%95%BF%E7%9A%84%E5%8F%82%E8%80%83%E4%B9%A6%E7%9B%AE%E9%93%BE%E6%8E%A5%E4%BF%9D%E6%8C%81%E5%9C%A8%E5%88%97%E5%AE%BD%E5%86%85.png)
上图为双栏IEEEtran
类的参考图片。
一个潜在的解决方案提到使用 natbib 强制在参考书目中换行,但当链接中没有单个极长的单词时,这种方法有效。上面的链接包含一个很长的 PDF 文件名
PGLowSCRWindGenerationInstabilityIdentificationandMitigation.pdf
名称太长,无法放在一列中,但 LaTeX 仍然不会用连字符连接它。
解决方案使用 natbib 强制在参考书目中换行产量
因此,需要进一步减小链接大小。
有没有办法强制它保持在列宽内,同时保持完整的超链接?
\begin{filecontents*}{sample.bib}
@online{lovelace2015low,
author = {{Lovelace, Will}},
title = {{Low SCR Wind Integration and Mitigation}},
url = {http://www.cce.umn.edu/documents/CPE-Conferences/MIPSYCON-PowerPoints/2015/PGLowSCRWindGenerationInstabilityIdentificationandMitigation.pdf},
organization = {Minnkota Power Cooperative},
date = {2015-11-11},
urldate = {2019-05-20}
}
\end{filecontents*}
\documentclass[]{IEEEtran}
\usepackage[square,numbers]{natbib}
\begin{document}
\cite{lovelace2015low}
\bibliographystyle{IEEEtran}
\bibliography{sample}
\end{document}
答案1
使用当前的 tex 发行版,您可以使用xurl
这样的包(参见<====
代码中的标记):
\begin{filecontents*}{sample.bib}
@online{lovelace2015low,
author = {{Lovelace, Will}},
title = {{Low SCR Wind Integration and Mitigation}},
url = {http://www.cce.umn.edu/documents/CPE-Conferences/MIPSYCON-PowerPoints/2015/PGLowSCRWindGenerationInstabilityIdentificationandMitigation.pdf},
organization = {Minnkota Power Cooperative},
date = {2015-11-11},
urldate = {2019-05-20}
}
\end{filecontents*}
\documentclass[]{IEEEtran}
\usepackage{xurl} % <===================================================
\usepackage[square,numbers]{natbib}
\begin{document}
\cite{lovelace2015low}
\bibliographystyle{IEEEtran}
\bibliography{sample}
\end{document}
及其结果: