遵循以下建议:手动分解长 URL(在参考书目中)和这里:如何拆分参考书目中的长 URL我试图在.bib
文件 URL 中插入一个断点,但该文件 URL 却给出了过满的 hbox 警告。
这是用于创建参考书目的代码:
\documentclass[11pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{url}
%\usepackage{hyperref}
\usepackage{siunitx}
\usepackage[backend=biber,style=apa,natbib=true,maxbibnames=7,maxcitenames=3,dashed=false,uniquename=false]{biblatex}
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{7000}
\setcounter{biburlnumpenalty}{7000}
\addbibresource{bibliography.bib}
\AtBeginDocument{\renewcommand{\bibname}{References}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
\usepackage{hyperref}
被注释掉,因为当包含时,会出现错误:
! Paragraph ended before \Hy@setref@link was complete.
发生。
文件中给出警告的条目.bib
:
@manual{Ormo15,
title = {OrmoComp® and OrmoClear®FX},
organization = {micro resist technology GmbH},
address = {Köpenicker Straße 325, 12555 Berlin, Germany},
note = {OrmoComp® and OrmoClear®FX datasheet},
year = {2015},
URL = {www.microresist.de/sites/default/files/download/PI_OrmoComp_OrmoClearFX_2015_0.pdf}
}
这是输出:
尝试告诉 LaTeX 它是一个 URL(在告诉它在哪里插入断点之前)我尝试:
@manual{Ormo15,
title = {OrmoComp® and OrmoClear®FX},
organization = {micro resist technology GmbH},
address = {Köpenicker Straße 325, 12555 Berlin, Germany},
note = {OrmoComp® and OrmoClear®FX datasheet},
year = {2015},
URL = {\\\url{www.microresist.de/sites/default/files/download/PI_OrmoComp_OrmoClearFX_2015_0.pdf}}
}
但是这样会给出 URL 如下:
摘自 %5C%5C%5Curl%7Bwww.microresist.de/sites/default/files/ download/PI OrmoComp OrmoClearFX 2015 0.pdf%7D
谁能告诉我我在这里做错了什么?
答案1
您的问题不太清楚,您没有向我们展示您用来创建参考书目的代码。
为了让您有个开始,让我们检查以下 MWE。它使用包filecontents
将 tex 代码和 bib 文件合并在一起编译MWE。为了获取打印的 URL,我使用了包natbib
和参考书目样式plainnat
。请注意,我还使用了包hyperref
来获取更好的可分解 URL...
以下 MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@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},
}
@manual{Ormo15,
title = {OrmoComp® and OrmoClear®FX},
organization = {micro resist technology GmbH},
address = {Köpenicker Straße 325, 12555 Berlin, Germany},
note = {OrmoComp® and OrmoClear®FX datasheet},
year = {2015},
URL = {www.microresist.de/sites/default/files/download/PI_OrmoComp_OrmoClearFX_2015_0.pdf}
}
\end{filecontents*}
\documentclass[10pt,a4paper]{article}
\usepackage{showframe} % to visualise the typing area and margins
\usepackage[numbers]{natbib}
\usepackage{hyperref}
\begin{document}
This is text with \cite{Goossens} and \cite{adams}.
\nocite{*} % to test all bib entrys
\bibliographystyle{plainnat} % unsrt
\bibliography{\jobname} % to use bib file created with filecontents
\end{document}
给出结果:
请复制我的 MWE 并在您的计算机上运行。结果相同?很好。如果没有,请报告差异。
如果您想针对自己的情况得到答案,请在您的问题中使用 MWE(复制我的并进行更改以显示您使用的包和围兜样式)向我们展示您当前的情况...
更新:
使用当前 MiKTeX 2.9 版本pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6630 64-bit)
运行以下 MWE(请注意,我更改了调用包的顺序,在您的情况下hyperref
应该最后调用!)
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@manual{Ormo15,
title = {OrmoComp® and OrmoClear®FX},
organization = {micro resist technology GmbH},
address = {Köpenicker Straße 325, 12555 Berlin, Germany},
note = {OrmoComp® and OrmoClear®FX datasheet},
year = {2015},
URL = {www.microresist.de/sites/default/files/download/PI_OrmoComp_OrmoClearFX_2015_0.pdf}
}
\end{filecontents*}
\listfiles % <==========================================================
\documentclass[11pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{siunitx}
\usepackage[%
backend=biber,
style=apa,
natbib=true,
maxbibnames=7,
maxcitenames=3,
dashed=false,
uniquename=false
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{url}
\usepackage{hyperref} % <===============================================
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{7000}
\setcounter{biburlnumpenalty}{7000}
\AtBeginDocument{\renewcommand{\bibname}{References}}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
我得到的结果页面如下,它与您向我们展示的不同:
我用红色箭头标记了差异。可能是您使用了另一种字体,但没有在给定的 MWE 中调用它?或者您使用了 MWE 中未提供的更宽的边距?也可能是您使用的一个或多个软件包已过时。我\listfiles
向 MWE 添加了命令。结果显示以下使用的软件包和版本号列表:
*File List*
filecontents.sty 2011/10/08 v1.3 Create an external file from within a LaTeX document
report.cls 2014/09/29 v1.4h Standard LaTeX document class
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
inputenc.sty 2015/03/17 v1.2c Input encoding file
utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
geometry.sty 2010/09/12 v5.6 Page Geometry
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
siunitx.sty 2017/11/26 v2.7k A comprehensive (SI) units package
expl3.sty 2018/03/05 L3 programming layer (loader)
expl3-code.tex 2018/03/05 L3 programming layer
l3pdfmode.def 2017/03/18 v L3 Experimental driver: PDF mode
xparse.sty 2018/02/21 L3 Experimental document command parser
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
array.sty 2016/10/06 v2.4d Tabular extension package (FMi)
l3keys2e.sty 2018/02/21 LaTeX2e option processing using LaTeX3 keys
translator.sty 2018/01/04 v1.12 Easy translation of strings in LaTeX
biblatex.sty 2018/03/04 v3.11 programmable bibliographies (PK/MW)
pdftexcmds.sty 2018/01/21 v0.26 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
etoolbox.sty 2018/02/11 v2.5e e-TeX tools for LaTeX (JAW)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
logreq.sty 2010/08/04 v1.0 xml request logger
logreq.def 2010/08/04 v1.0 logreq spec v1.0
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
xstring.sty 2013/10/13 v1.7c String manipulations (C Tellechea)
blx-dm.def 2018/03/04 v3.11 biblatex localization (PK/MW)
apa.dbx 2018/03/05 v7.6 APA biblatex style data model
blx-compat.def 2018/03/04 v3.11 biblatex compatibility (PK/MW)
biblatex.def 2018/03/04 v3.11 biblatex compatibility (PK/MW)
blx-natbib.def 2018/03/04 v3.11 biblatex compatibility (PK/MW)
standard.bbx 2018/03/04 v3.11 biblatex bibliography style (PK/MW)
apa.bbx 2018/03/05 v7.6 APA biblatex references style
apa.cbx 2018/03/05 v7.6 APA biblatex citation style
biblatex.cfg
hyperref.sty 2018/02/06 v6.86b Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
pd1enc.def 2018/02/06 v6.86b Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
hpdftex.def 2018/02/06 v6.86b Hyperref driver for pdfTeX
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
english.lbx 2018/03/04 v3.11 biblatex localization (PK/MW)
american.lbx 2018/03/04 v3.11 biblatex localization (PK/MW)
american-apa.lbx 2018/03/05 v7.6 APA biblatex localisation
english-apa.lbx 2018/03/05 v7.6 APA biblatex localisation
ts1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
translator-basic-dictionary-English.dict
siunitx-abbreviations.cfg 2017/11/26 v2.7k siunitx: Abbreviated units
422795.bbl
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
422795.out
422795.out
omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
***********
请在您的计算机上运行我的 MWE,并将日志文件末尾的结果列表与我的进行比较。有区别吗?哪一个?
就目前情况而言,我无法重现您的问题......