更新後西班牙語無法使用

更新後西班牙語無法使用

我最近將 Lyx 更新到了新的 2.1 版本。但是當我嘗試編譯我的文件(西班牙語)時,出現以下“未定義的控制序列”錯誤:

 \StartBabelCommands
                         *{spanish}{captions}
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.

\usepackage[spanish]{babel}我已在“設定”>“語言”中將西班牙語設定為我的語言,並且我還嘗試在序言中添加。沒有結果。我真的不知道為什麼會發生這種情況。在我的舊 Lyx 2.0 中,該配置運行得很好。

編輯:這裡有 LyX 的 LaTeX 輸出(最小工作範例)。這段程式碼產生了上面提到的錯誤: 我也嘗試在 LyX 之外編譯這個 LaTeX,但它不起作用。

%% LyX 2.1.3 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[spanish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}
Una fórmula:
\[
E=mc^{2}
\]

\end{document}

感謝您的幫忙!

答案1

解決了!問題是 babel 套件已經過時了。我運行了 MikTeX 2.9 Updater(管理員)並更新了所有軟體包。之後,LyX 重新配置後,它現在可以工作了。

相關內容