setspace 包在 TeX Live 中不起作用

setspace 包在 TeX Live 中不起作用

我正在运行 Ubuntu 16.04 并使用 texlive-full apt 包。我在 TeXmaker 和 TeXstudio 中尝试过这个,在两者中都遇到了同样的错误,我在 Overleaf 上尝试过它并且运行正常,所以问题一定出在 TeX Live 上。

我可以导入 setspace 包而不会出现任何错误或警告,但如果我尝试使用任何 setspace 方法,编译器会说它们未定义。以下是示例和日志文件的相关部分。

我只是不知道为什么这个包在 Overleaf 上运行,却在我的计算机上不运行。

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Title}
\author{Author}
\date{May 2020}

\usepackage[doublespacing]{setspace}
\setdisplayskipstretch{}
\setstretch{2}

\begin{document}

\maketitle

\section{Introduction}

\end{document}
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2020.5.15)  20 MAY 2020 01:22
entering extended mode

...

)) (./setspace.sty)

! LaTeX Error: Unknown option `doublespacing' for package `setspace'.

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

! Undefined control sequence.
<recently read> \setdisplayskipstretch 

l.9 \setdisplayskipstretch
                          {}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
l.10 \setstretch
                {2}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


! LaTeX Error: Missing \begin{document}.

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

l.10 \setstretch{2
                  }
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.
...

答案1

日志片段显示

)) (./setspace.sty)

意思是您的文件夹中有 的本地副本setspace.sty。这可能是 的旧副本setspace或修改版本。

尝试重命名本地副本,看看是否有帮助。

相关内容