如何在 TEX 中即時編輯錯誤

如何在 TEX 中即時編輯錯誤

我想知道如何編輯 TEX 編譯器指示的錯誤瞬間地
使用i中所述的選項維基教科書^i\hat{i}​該選項後出現以下錯誤i

Z:\>latex first.txt
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/W32TeX) (preloaded
 format=latex)
 restricted \write18 enabled.
entering extended mode
(./first.txt
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(d:/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(d:/texlive/2014/texmf-dist/tex/latex/base/size10.clo)) (./first.aux)
LaTeX Warning: Command \^ invalid in math mode on input line 6.
LaTeX Warning: Command \^ invalid in math mode on input line 6.
! Please use \mathaccent for accents in math mode.
\add@accent ...@spacefactor \spacefactor }\accent
                                                  #1 #2\egroup \spacefactor ...
l.6 $\^i
        $
? i$\hat{i}$
! Missing number, treated as zero.
<to be read again>
                   $
l.6 $\^i
        $
?

誰能告訴我是否可以使用i終端機(命令提示字元)中的選項來修正錯誤以及如何修正錯誤。

答案1

試著ENTERi(但你嘗試過的對我有用),然後插入更正:

$ cat foo.tex 
\documentclass{article}
\begin{document}
\LaTEX
\end{document}
$ pdflatex foo.tex 
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 8 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (./foo.aux)
! Undefined control sequence.
l.3 \LaTEX

? i
insert>\LaTeX
[1{/home/user/.texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./foo.aux) )
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/s
hare/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
Output written on foo.pdf (1 page, 16374 bytes).
Transcript written on foo.log.

但您應該考慮使用 編輯原始碼e,否則下次您將遇到相同的錯誤。

相關內容