通过设置“\baselinestretch”在自定义类中强制执行,从参考列表中删除双倍行距

通过设置“\baselinestretch”在自定义类中强制执行,从参考列表中删除双倍行距

我正在使用来自的自定义类这里。他们设置双倍行距的方式存在问题,对于表格和图形@Mico 提供了一个很好的解决方案这里。但是,我似乎无法解决由 创建的参考部分内的间距\bibliography。我尝试\renewcommand{\baselinestretch}{1}在 或 之前发出\bibliographystyle{apalike}\bibliography{thesis}或者尝试在序言中添加:

\AtBeginEnvironment{thebibliography}{\renewcommand{\baselinestretch}{1}}
\AtEndEnvironment{thebibliography}{\renewcommand{\baselinestretch}{2}}

正如对表格所建议的那样。但是没有效果。

我实际上有三个问题:

  1. 在这种情况下,如何获得参考书目条目的单倍行距(使用natbib)?

  2. 如何获得参考书目部分(参考文献列表)的适当名称并以适当的方式将其添加到目录中(就像类似乎做的那样)?

  3. 指挥的责任由谁来thebibliography承担?


最后一个问题与以下事实有关:从 Lamport 的书以及 LaTeX 配套软件中,我了解到此环境实际上会从文件中创建条目bbl。因此,我希望此环境由natbib或更可能由书目样式生成,在本例中由生成apalike。但这似乎是不正确的,因为如果我注释掉 中的第 549-561 行ucfthes.cls,tex 文件将无法编译,并抱怨:

(/usr/local/texlive/2019/texmf-dist/tex/latex/base/ifthen.sty) (./ucfthma.clo)
(./ucfth12.clo) (./ucfthti.clo))
(/usr/local/texlive/2019/texmf-dist/tex/latex/natbib/natbib.sty

! LaTeX Error: Environment thebibliography undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.1063 \renewenvironment{thebibliography}
                                         [1]{%
? 

thebibliography所以看起来,定义命令是一个类的责任?

当它被定义时(通过取消注释中的相应行 549--561 ucfthes.cls),它无论如何都不会被使用,因为章节标题应该是“参考文献列表”而不是“参考书目”,后者似乎是由 的其他定义产生的thebibliography

下面是一个存在问题的最小示例。它只需要上面 gitbub 链接中的文件、、、以及下面的ucfth12.clo和的内容。ucfthma.cloucfthti.cloucfthes.clsthesis.texthesis.bib


内容thesis.tex

\documentclass{ucfthes} 
\usepackage{natbib}
\usepackage{apalike}
\usepackage{lipsum}

\usepackage{graphicx}
\usepackage{longtable}
\usepackage{afterpage}
\usepackage{color}
\usepackage{multicol}
\usepackage{pdflscape}
\usepackage{float}
\makeatletter
\setlength\@fptop{5pt}
\makeatother
\usepackage{hyperref}
\usepackage{etoolbox}

\begin {document}
\lipsum[1]

\cite{Bethe1930}

\bibliographystyle{apalike}
\bibliography{thesis}
\end {document} \bye

内容thesis.bib

@Electronic{ETD_Format,
  author       = {University of Central Florida Graduate Studies},
  title        = {Formatting the ETD},
  year         = {2016},
  url          = {http://www.students.graduate.ucf.edu/ETD_formatting/},
  howpublished = {Webpage},
}

@Electronic{TemplateGit,
  Title                    = {UCF Thesis LaTeX Template},
  Author                   = {Daniel Gallagher},
  HowPublished             = {Git Repository},
  Organization             = {University of Central Florida},
  Url                      = {https://bitbucket.org/dgallagher/ucf-thesis-latex-template},
  Year                     = {2007},

  Abstract                 = {This template was originally developed in 2007 in compliance with the UCF ETD masters thesis guidelines. It has since been used by various colleges in their PhD dissertation submissions. At this time there was no official LaTeX template available from the university. There is now a basic template supplied by the editor in Graduate studies located on the . However, some may prefer to use this template for there needs.

By publishing my template in a public git repository, I hope that the template may be used by others and will continue to evolve with the revised ETD format guidelines through user contributed updates.}
}

@Article{Bethe1930,
  author       = {Bethe, H.},
  title        = {Zur Theorie des Durchgangs schneller Korpuskularstrahlen durch Materie},
  journal      = {Annalen der Physik},
  journaltitle = {Annalen der Physik},
  year         = {1930},
  volume       = {397},
  number       = {3},
  pages        = {325--400},
  issn         = {1521-3889},
  doi          = {10.1002/andp.19303970303},
  url          = {http://dx.doi.org/10.1002/andp.19303970303},
  file         = {:D\:\\Data\\Personnal\\ucf\\Project - Shielding\\articles\\StoppingPower\\Bethe, H.\; Zur Theorie des Durchgangs schneller Korpuskularstrahlen durch Materie\; Ann. Phys., Vol. 397, Issue 3, (1930).pdf:PDF},
  owner        = {Leoš Pohl},
  publisher    = {WILEY-VCH Verlag},
  timestamp    = {2015.12.17},
}

答案1

\AtBeginEnvironment{thebibliography}{\linespread{1}\selectfont}

若无\selectfont此设置则不强制执行。

一般而言,尽管它们本质上作用相同,但\linespread{<factor>}还是优先于\renewcommand{\baselinestretch}{<factor>}。无论如何,直到第一个(显式或隐式)\selectfont命令才会强制执行该设置。

\documentclass{ucfthes} 
\usepackage{natbib}
\usepackage{apalike}
\usepackage{lipsum}

\usepackage{graphicx}
\usepackage{longtable}
\usepackage{afterpage}
\usepackage{color}
\usepackage{multicol}
\usepackage{pdflscape}
\usepackage{float}
\makeatletter
\setlength\@fptop{5pt}
\makeatother
\usepackage{hyperref}
\usepackage{etoolbox}

\AtBeginEnvironment{thebibliography}{\linespread{1}\selectfont}

\begin {document}
\lipsum[1]

\cite{Bethe1930}

\bibliographystyle{apalike}
\bibliography{thesis}

\end{document}

在此处输入图片描述

相关内容