$$ 符号的问题

$$ 符号的问题

这是主要错误

\language@active@arg< 的参数有一个额外的 }.\par \end{align}

我意识到问题出在符号<和上>。在 Overleaf 上,我使用相同的结构和相同的文件,发现这些符号没有任何问题。

MNWE(在我的 PC 上。在 Overleaf 上,它们都正常工作。)

\documentclass[a4paper, 12pt, openany]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\begin{document}

\begin{equation}
    1 = 2_{<}
\end{equation}

\end{document}

平均能量损失

\documentclass[a4paper, 12pt, openany]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{equation}
    1 = 2_{<}
\end{equation}

\end{document}

完整日志

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3) (preloaded format=pdflatex 2021.5.7)  7 MAY 2021 15:38
entering extended mode
**./Mainc.tex
(Mainc.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(D:\Programas\MiKTeX 2.9\tex/latex/base\book.cls
Document Class: book 2020/04/10 v1.4m Standard LaTeX document class
(D:\Programas\MiKTeX 2.9\tex/latex/base\bk12.clo
File: bk12.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count179
\c@chapter=\count180
\c@section=\count181
\c@subsection=\count182
\c@subsubsection=\count183
\c@paragraph=\count184
\c@subparagraph=\count185
\c@figure=\count186
\c@table=\count187
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(D:\Programas\MiKTeX 2.9\tex/latex/base\fontenc.sty
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package
)
(D:\Programas\MiKTeX 2.9\tex/latex/base\inputenc.sty
Package: inputenc 2020/08/01 v1.3d Input encoding file
\inpenc@prehook=\toks15
\inpenc@posthook=\toks16
)
(D:\Programas\MiKTeX 2.9\tex/generic/babel\babel.sty
Package: babel 2021/04/26 3.58 The Babel package

(D:\Programas\MiKTeX 2.9\tex/generic/babel\babel.def
File: babel.def 2021/04/26 3.58 Babel common definitions
\babel@savecnt=\count188
\U@D=\dimen139
\l@unhyphenated=\language83

(D:\Programas\MiKTeX 2.9\tex/generic/babel\txtbabel.def)
\bbl@readstream=\read2
)
\bbl@dirlevel=\count189

*************************************
* Local config file bblopts.cfg used
*
(D:\Programas\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
 babel
)
(D:\Programas\MiKTeX 2.9\tex/latex/babel-spanish\spanish.ldf
Language: spanish.ldf 2016/03/03 v5.0p Spanish support from the babel system
\es@quottoks=\toks17
\es@quotdepth=\count190
Package babel Info: Making " an active character on input line 561.
Package babel Info: Making . an active character on input line 662.
Package babel Info: Making < an active character on input line 707.
Package babel Info: Making > an active character on input line 707.
))
(D:\Programas\MiKTeX 2.9\tex/latex/l3backend\l3backend-pdftex.def
File: l3backend-pdftex.def 2021-03-18 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count191
\l__pdf_internal_box=\box47
) (Mainc.aux)
\openout1 = `Mainc.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Info: Redefining \. on input line 7.
LaTeX Info: Redefining \% on input line 7.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <12> on input line 9.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <8> on input line 9.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <6> on input line 9.

! Argument of \language@active@arg< has an extra }.
<inserted text> 
                \par 
l.10    1 = 2_{<}
               
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
! Paragraph ended before \language@active@arg< was complete.
<to be read again> 
                   \par 
l.10    1 = 2_{<}
               
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Missing $ inserted.
<inserted text> 
                $
l.10    1 = 2_{<}
               
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

! Missing } inserted.
<inserted text> 
                }
l.10    1 = 2_{<}
               
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Display math should end with $$.
<to be read again> 
                   \par 
l.10    1 = 2_{<}
               
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.

! Extra }, or forgotten \endgroup.
<recently read> }
                 
l.10    1 = 2_{<}
               
I've deleted a group-closing symbol because it seems to be
spurious, as in `$x}$'. But perhaps the } is legitimate and
you forgot something else, as in `\hbox{$x}'. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `I$}'.

! You can't use `\eqno' in vertical mode.
\endequation ->\eqno 
                     \hbox {\@eqnnum }$$\@ignoretrue 
l.11 \end{equation}
                   
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'.

! Missing $ inserted.
<inserted text> 
                $
l.11 \end{equation}
                   
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

! Display math should end with $$.
<to be read again> 
                   \endgroup 
l.11 \end{equation}
                   
The `$' that I just saw supposedly matches a previous `$$'.
So I shall assume that you typed `$$' both times.

[1{C:/Users/marco/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}

]
(Mainc.aux
LaTeX Info: Redefining \. on input line 8.
LaTeX Info: Redefining \% on input line 8.
) ) 
Here is how much of TeX's memory you used:
 1826 strings out of 479287
 25268 string characters out of 2865244
 326838 words of memory out of 3000000
 19348 multiletter control sequences out of 15000+600000
 407751 words of font info for 38 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 45i,4n,54p,166b,361s stack positions out of 5000i,500n,10000p,200000b,80000s
 <C:\Users\marco\AppData\Local\MiKTeX\2.9\fonts/pk/ljfour/jknappen/ec/dpi600
\ecrm1200.pk><D:/Programas/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr12.pfb>

Output written on Mainc.pdf (1 page, 10342 bytes).
PDF statistics:
 17 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)


此外,我最近已经更新了 MikTeX 的软件包,这是我能想到的唯一原因。

我知道即使在数学模式下我也可以使用 \text{less} 表示 <,但我希望它能正常工作。如果您有未提供的任何信息,我将竭诚为您服务。

PD:为什么 Matjax 在这里不起作用?

答案1

我建议您es-noquoting在使用西班牙语 babel 时使用该选项:

\usepackage[spanish, es-noquoting]{babel}

这些简写形式>会给<许多包(例如 ifthen 或 tikz)带来麻烦。

quoting如果你想按照西班牙语规则引用句子,可以使用环境(参见第 12-13 页)西班牙语 bibtex 手册

相关内容