使用 \setlanguage 时出现垂直模式错误

使用 \setlanguage 时出现垂直模式错误

我有以下 LaTeX 文件,我想更改两个摘要前后的语言。

\documentclass[a4paper, 11pt]{article}
\usepackage[DIV=15]{typearea}
\usepackage{natbib}
\usepackage[hyphens]{url} % split url
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}
\usepackage[portuguese]{babel}
\usepackage{multicol}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage{caption}
\captionsetup[figure]{font=footnotesize}
\usepackage{amsmath}
\usepackage{changepage}
\usepackage{courier}
\usepackage{booktabs}
\usepackage{float}
\usepackage{placeins} %\FloatBarrier
\usepackage{geometry} % \newgeometry \restoregeometry
\usepackage{verbatim}
%\usepackage{threeparttable}
\usepackage{xcolor} %define color
\definecolor{light-gray}{gray}{0.92}
\usepackage{listings} %R code

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}

\usepackage{listingsutf8}
\usepackage{booktabs} %/tourples
\usepackage{graphicx}
\usepackage{pdflscape}
\usepackage{titling} % postitle
%\usepackage{newclude} % usar include con *
\usepackage{enumitem} % enumerar letras
\renewcommand{\floatpagefraction}{.8}
\usepackage{setspace} %\setstretch{1.25}
\usepackage[para,online,flushleft]{threeparttable}
\usepackage{siunitx} 
\sisetup{input-symbols = ()}

\captionsetup[figure]{skip=0pt}
\setstretch{1.8}

\title{123}
\date{\vspace{-5ex}}
\begin{document}
\maketitle

\setlanguage{english}
\begin{abstract}
abc
\end{abstract}

\setlanguage{portugues}
\begin{abstract}
aei
\end{abstract}

\setlanguage{english}
Lorem ipsum...
\end{document}

当我编译时,我收到三个错误。第一个错误来自\setlanguage{english}

! You can't use `\setlanguage' in vertical mode.
l.58 \setlanguage
{english}
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! You can't use `\setlanguage' in vertical mode.

另外两个错误来自剩下的两\setlanguage行;这些错误与第一个错误相同。

任何帮助深表感谢!

相关内容