编译时的环境 onehalfspacing 错误消息

编译时的环境 onehalfspacing 错误消息

我已在我的文档中添加了代码onehalfspacing,但每次编译时都会收到以下错误消息:

缺少} 插入。}。

请参阅以下 MWE:

\documentclass[a4paper,12pt]{article}
\usepackage{color}
\usepackage{graphicx, epstopdf}
\usepackage{gensymb}
\usepackage{times}
\usepackage{adjustbox}
\usepackage{tabulary}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{booktabs,caption, makecell}
\usepackage{pdflscape,afterpage,caption}
\usepackage[british]{babel}
\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
\usepackage[section]{placeins}%Allows you to permanently fix figures. 
\addbibresource{library}
\usepackage{titleps}%fancy page borders? 
\usepackage[left=2.8cm, right=2.8cm, top=3.5cm, bottom=3.5cm]{geometry}
\usepackage{caption}
\captionsetup[figure]{font=scriptsize,labelfont=scriptsize}
\captionsetup[table]{font=scriptsize,labelfont=scriptsize}
\usepackage{microtype}
\usepackage{setspace}

\begin{document}
\begin{onehalfspacing}
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
To make your document look professionally produced, Word provides header, footer, cover page, and text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.
Save time in Word with new buttons that show up where you need them. To change the way a picture fits in your document, click it and a button for layout options appears next to it. When you work on a table, click where you want to add a row or a column, and then click the plus sign.
Reading is easier, too, in the new Reading view. You can collapse parts of the document and focus on the text you want. If you need to stop reading before you reach the end, Word remembers where you left off - even on another device.

    \end{onehalfspacing}
\end{document}

非常感谢大家提出建议来解决这个问题,而无需对我的文档进行大规模的更改(这是一个很大的文档,我担心会有冲突的代码)。

提前致谢!

答案1

setspace包定义

  1. \onehalfspacing、声明,以及

  2. onehalfspace, 一个环境。

把前者当成后者使用是错误的。因此使用

\begin{onehalfspace}
...
\end{onehalfspace}

如果希望整个文档以“一倍半行距”排版,请输入

\onehalfspacing

\begin{document}

相关内容