我正在写一篇硕士论文,用 LaTex 写。我利用了它natbib
并对其生成漂亮的参考书目感到满意,但我遇到了一个问题,即参考书目开头的格式在第 15 条之后变为更像块状字体。
natbib
这是我使用该包时出现的问题吗?
% In Settings.tex
\usepackage{natbib}
% In References.tex
\setcitestyle{numbers}
\bibliographystyle{plainnat}
\bibliography{lit}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% In main.tex, have already included settings.tex
% REFERENCES / BIBLIOGRAPHY
\addcontentsline{toc}{chapter}{Bibliography}
\begin{flushleft}
\footnotesize
\input{include/backmatter/References}
\end{flushleft}
15 和 16 的相应 .bib 条目:
@Misc{Giusca2005,
author = {Bogdan Giuşcă},
title = {The problem of the Seven Bridges of Königsberg.},
year = {2005},
note = {File: \ttfamily{Konigsberg bridges.png}},
url = {https://commons.wikimedia.org/wiki/File:Konigsberg_bridges.png},
urlseen = {12-04-19},
}
@Article{Goldford2018,
author = {Goldford, Joshua E. and Lu, Nanxi and Baji{\'c}, Djordje and Estrela, Sylvie and Tikhonov, Mikhail and Sanchez-Gorostiaga, Alicia and Segr{\`e}, Daniel and Mehta, Pankaj and Sanchez, Alvaro},
title = {Emergent simplicity in microbial community assembly},
journal = {Science},
year = {2018},
volume = {361},
number = {6401},
pages = {469--474},
issn = {0036-8075},
doi = {10.1126/science.aat1168},
eprint = {http://science.sciencemag.org/content/361/6401/469.full.pdf},
publisher = {American Association for the Advancement of Science},
url = {http://science.sciencemag.org/content/361/6401/469},
}
编辑: 制作一些可编译的.tex 代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{natbib}
\title{msc}
\author{rosko }
\date{May 2019}
\begin{document}
\maketitle
\section{Introduction}
\citep{Giusca2005} did this
\citep{Goldford2018} did that
% \addcontentsline{toc}{chapter}{Bibliography}
\newpage
\bibliographystyle{plainnat}
\bibliography{bib}
\end{document}
答案1
对于许多字体操作,LaTeX 知道两种类型的命令:字体开关和文本宏。字体切换从写入点开始应用,直到当前组结束。它们确实不是接受一个参数。文本宏接受一个参数,并且通常只将格式应用于该参数。通常,文本宏的名称以 开头\text...
。
这意味着通常使用开关作为
Unaffected text {\<switch> affected text} more unaffected text
和文本宏
Unaffected text \<text macro>{affected text} more unaffected text
例如\bfseries
一个开关
normal text {\bfseries bold text} more normal text
是\textbf
相应的文本宏
normal text \textbf{bold text} more normal text
您可以在以下位置阅读有关这些命令的更多信息牙套在里面还是外面?,如何将格式(无衬线、颜色等)应用于多个段落?,\bfseries 与 \textbf 的关系与 \textsf 的关系相同。通常,您无法预先知道命令的参数结构,即它是开关还是文本宏。您必须查找或试验。唯一的“规则”是许多(如果不是全部)文本宏都以 开头。许多字体开关以、、、\text...
结尾。\...series
\...font
\...shape
\...size
\ttfamily
是字体切换。其效果持续到当前组关闭。当注释字段包含
note = {File: \ttfamily{Konigsberg bridges.png}},
那么 的效果\ttfamily
不会在}
之后结束.png
。相反,它会一直持续到当前组结束。在示例中, 仅在参考书目的最后。
而不是\ttfamily
您想使用的\texttt
。该命令接受参数并以打字机字体排版。
note = {File: \texttt{Konigsberg bridges.png}},
或者,你可以\ttfamily
使用适当的分组来限制
note = {File: {\ttfamily Konigsberg bridges.png}},