文本中连续引用之间的空格

文本中连续引用之间的空格

根据 biblatex-apa 的代码,我创建了一个\fullcitebib命令来在文本中输入完整的参考文献。我可以使用多个此类命令来创建完整参考文献列表,而不必遵循文档中的引文顺序。这会导致参考文献之间出现大量空白,大概是因为它正在将参考文献作为单独列表中的项目进行处理。是否可以避免在连续的\fullcitebib命令之间出现这种空白?

编辑:啊,我可以通过不使用列表项的不同定义来避免垂直空间问题\fullcitebib,这更接近我想要的。仍然存在引用缩进(我不想要)以及悬挂缩进(我想要)的问题。有没有关于如何在没有手册的情况下将引用放在左边距的建议\noindent?示例代码和输出如下。

\documentclass{article}
\usepackage[backend=biber,%
            style=authoryear,%
            ]{biblatex}

\begin{filecontents}{bib.bib}
@book{tras1996,
    Address = {London},
    Author = {R. L. Trask},
    Publisher = {Routledge},
    Title = {A dictionary of phonetics and phonology},
    Year = {1996}}
@book{crys2010,
    Address = {Cambridge},
    Author = {David Crystal},
    Edition = {3},
    Publisher = {Cambridge University Press},
    Title = {The {C}ambridge Encyclopaedia of Language},
    Year = {2010}}
@book{matt2005,
    Address = {Oxford},
    Author = {Matthews, P.H.},
    Publisher = {Oxford University Press},
    Title = {The Concise {O}xford Dictionary of Linguistics},
    Year = {2005}}
\end{filecontents}
\addbibresource{bib.bib} 

\DeclareCiteCommand{\fullcitebib}
  {}
  {\hangindent=3em\usedriver{}{\thefield{entrytype}}\finentry\par}
  {}
  {\usebibmacro{postnote}
   }

\begin{document}

\fullcitebib{tras1996}\fullcitebib{crys2010}\fullcitebib{matt2005}

The references above should have a hanging indent, as they do now, but be against
the left margin, like the references list below.

\printbibliography
\end{document}

在此处输入图片描述

答案1

回答你的问题

要插入一小部分参考文献,您只需使用refsection并获得良好的格式,无需任何技巧。

\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}

\begin{filecontents}{bib.bib}
@book{tras1996,
Address = {London},
Author = {R. L. Trask},
Publisher = {Routledge},
    Title = {A dictionary of phonetics and phonology},
Year = {1996}}
    @book{crys2010,
    Address = {Cambridge},
    Author = {David Crystal},
Edition = {3},
Publisher = {Cambridge University Press},
Title = {The {C}ambridge Encyclopaedia of Language},
Year = {2010}}
@book{matt2005,
Address = {Oxford},
Author = {Matthews, P.H.},
Publisher = {Oxford University Press},
Title = {The Concise {O}xford Dictionary of Linguistics},
Year = {2005}}
\end{filecontents}

\addbibresource{bib.bib} 

\begin{document}

\begin{refsection}
        \newrefcontext[sorting=none]
    \nocite{tras1996,crys2010}
    \printbibliography[heading=none]
\end{refsection}


\newrefcontext[sorting=nyt]
\nocite{tras1996,crys2010,matt2005}
The references above should have a hanging indent, as they do now, but be against
the left margin, like the references list below.

\printbibliography
\end{document}

在此处输入图片描述

回答你的问题:

自定义引用的第一行会缩进,因为它是段落的第一行。这可以通过一个小技巧来恢复:\hskip-\parindent

\documentclass{article}
\usepackage[backend=biber,%
style=authoryear,%
]{biblatex}

\begin{filecontents}{bib.bib}
@book{tras1996,
Address = {London},
Author = {R. L. Trask},
Publisher = {Routledge},
Title = {A dictionary of phonetics and phonology},
Year = {1996}}
@book{crys2010,
Address = {Cambridge},
Author = {David Crystal},
Edition = {3},
Publisher = {Cambridge University Press},
Title = {The {C}ambridge Encyclopaedia of Language},
Year = {2010}}
@book{matt2005,
Address = {Oxford},
Author = {Matthews, P.H.},
Publisher = {Oxford University Press},
Title = {The Concise {O}xford Dictionary of Linguistics},
Year = {2005}}
\end{filecontents}
\addbibresource{bib.bib} 

\DeclareCiteCommand{\fullcitebib}
{}
{\hskip-\parindent\hangindent=\parindent\usedriver{}{\thefield{entrytype}}\finentry\par}
{}
{\usebibmacro{postnote}
}

\begin{document}

\fullcitebib{tras1996}\fullcitebib{crys2010}\fullcitebib{matt2005}

The references above should have a hanging indent, as they do now, but be against
the left margin, like the references list below.

\printbibliography
\end{document}

在此处输入图片描述

答案2

我相信您应该坚持基于的原始定义biblatex-apa

\DeclareCiteCommand{\fullcitebib}
  {\usebibmacro{prenote}%
   \renewcommand*{\finalnamedelim}{%
     \finalandcomma\addspace\bibstring{and}\space}
   \list{}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
   \item}
  {\usedriver
     {}
     {\thefield{entrytype}}\finentry}
  {\item}
  {\endlist
   \usebibmacro{postnote}}

代替

\fullcitebib{tras1996}\fullcitebib{crys2010}\fullcitebib{matt2005}

为每个条目启动一个新列表(正如您正确指出的那样),您应该使用

\fullcitebib{tras1996,crys2010,matt2005}

所有三个条目都在同一个列表中

平均能量损失

\documentclass{article}
\usepackage[backend=biber,%
            style=authoryear,%
            ]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareCiteCommand{\fullcitebib}
  {\usebibmacro{prenote}%
   \renewcommand*{\finalnamedelim}{%
     \finalandcomma\addspace\bibstring{and}\space}
   \list{}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
   \item}
  {\usedriver
     {}
     {\thefield{entrytype}}\finentry}
  {\item}
  {\endlist
   \usebibmacro{postnote}}

\begin{document}

\fullcitebib{sigfridsson}\fullcitebib{worman}\fullcitebib{cicero}

\fullcitebib{sigfridsson,worman,cicero}

\printbibliography
\end{document}

示例输出

相关内容