输入符号“&”代替“and”

输入符号“&”代替“and”

在文件中写入参考文献时.bib,我想提及包含“&”符号的书籍的出版地址。执行文件时,main.tex我收到错误“!对齐制表符 & 位置错误。”代码如下

\documentclass{Thesis} 
\usepackage{natbib} 
\usepackage{hyperref}
\begin{document}
\pagestyle{fancy} 
\label{Chapter1}
\section{description}
     This is my main text to be provided with reference\cite{Ref1}.
\label{Bibliography}
\lhead{\emph{Bibliography}}
\bibliographystyle{unsrtnat} 
\bibliography{Bibliography} 
\end{document} 

并且Bibliography.bib形式为

@book{Ref1,
    author     = " Myself",
    title          = "it's my book",
    year         = "2015",
    publisher  = " Home publication",
    address    = "At home, Smith & Johns, abc ",
}

答案1

您需要转义“&”符号,只需在它前面加上反斜杠即可,如下所示:

@book{Ref1,
    author     = " Myself",
    title          = "it's my book",
    year         = "2015",
    publisher  = " Home publication",
    address    = "At home, Smith \& Johns, abc ",
}

进一步来说,LaTeX 中的保留字符是:

# $ % ^ & _ { } ~ \

当你想在文本中使用它们时,应该像这样进行转义:

\# \$ \% \^{} \& \_ \{ \} \~{} \textbackslash{}

相关内容