小编Dro*_*rya的帖子

即使使用natbib包,citep和citet也无法正常工作

我正在写一个乳胶文件,我有一个很大的.bib文件和大量的引用.我想以[作者,年]格式的形式引用并使用natbib包,但无法获得citepcitet工作,虽然简单的引用工作正常.我得到的错误是:

! Undefined control sequence.
l.3 lets cite \citet{cayton05}
Run Code Online (Sandbox Code Playgroud)

我正在使用Ubuntu texlive包并使用\input{<file>}latex命令将章节输入到主.tex文件中.

令人惊讶的是,\input{<file>}如果我只在主.tex文件中包含文本,那么所有cite命令都可以正常工作.

任何帮助将受到高度赞赏.

工作版本是这样的:

\usepackage{cite} 
\usepackage[square,sort]{natbib}
%% lot of other packages and formatting %%

\begin{document}

\chapter{Testing citations}

\begin{enumerate}
  \item this is the first citation \cite{belkin02}.
  \item this is the second citation \citep{belkin02}.
  \item this is the third citation \cite{shlens03}.
\end{enumerate}



\phantomsection\addcontentsline{toc}{chapter}{Bibliography}
\begin{spacing}{1.5}
\nocite{*}
\bibliographystyle{apalike}
\bibliography{testnb.bib}
\end{spacing}

\end{document}
Run Code Online (Sandbox Code Playgroud)

在现实.tex文件,我输入的章节文字从另一个.tex文件,citep并且citet将无法工作在给予上述误差,但纯cite将正常工作.

我之前忘了提到我使用的是简单编号的参考书目样式,一切正常,所以输入的.tex文件没有错误.

latex biblatex

8
推荐指数
2
解决办法
5万
查看次数

将颜色作为变量传递给aes_string

我想在一列上绘制数据矩阵的几列,因此我不是单独绘制每一列,而是使用循环.问题是如果要使用循环,要绘制的列名称和颜色必须是可变的.我尝试了以下方法:

allDs <- sort(unique(plotdata$D))
p <- ggplot(plotdata, aes(SpaceWidth))
for (thisD in allDs) {
    tlColName <- paste("M2D", thisD, "Tl", sep="")
    colorName <- paste("D", thisD, sep="")
    p <- p + geom_line(data = plotdata[!is.na(plotdata[[tlColName]]),], aes_string(y = tlColName, color = colorName))
}
p <- p + scale_colour_manual("Legend", values = c("D2" = "blue", "D3" = "red", "D4" = "green", "D6" = "violet", "D7" = "yellow" ))
p <- p + scale_x_log10(breaks = composite$SpaceWidth)
p <- p + facet_wrap(~ Drawn, ncol = 3)
p <- p …
Run Code Online (Sandbox Code Playgroud)

r ggplot2

6
推荐指数
1
解决办法
2188
查看次数

数组是否返回引用或值?

什么是array get回报,参考或价值?我有一个列表作为值列表,并且必须经常修改列表.有效的方法是什么?

tcl

4
推荐指数
1
解决办法
596
查看次数

如何从此后代中选择具有指定类的最后一个元素?

我有一个<div>有许多<ul>不同类的后代,我正在调用一个函数,<div>它修改<ul>了给定类的最后一个.如何<ul>使用$(this)jQuery选择器选择具有指定类的最后一个后代?

jquery css-selectors

1
推荐指数
1
解决办法
132
查看次数

标签 统计

biblatex ×1

css-selectors ×1

ggplot2 ×1

jquery ×1

latex ×1

r ×1

tcl ×1