在笔记本电脑上编译与在 Overleaf 上编译

在笔记本电脑上编译与在 Overleaf 上编译

由于某种原因,下面的最小工作示例在 TexMaker(以及 TexShop)上使用 TeX 发行版 2022 编译时无法像在 Overleaf 上编译时那样呈现,即我在最后一行得到了一个额外的空格,如左图所示:

纺织机械背面

我不明白为什么会发生这种情况。删除一些(无用的)软件包会删除这些额外的空间,但我仍然想知道为什么会出现这种奇怪的行为。有人在他们的笔记本电脑上遇到了和我一样的结果吗?

下面的代码之后,是将“diff”命令应用于两个日志文件的结果,以及来自我的笔记本电脑版本的完整日志文件。


\documentclass{article}

\usepackage{dsfont}
\usepackage{mathrsfs}
\usepackage{latexsym}
\usepackage{amssymb}%mathfrak
\usepackage{stmaryrd}
\usepackage{esvect}

%https://tex.stackexchange.com/questions/124738/
\DeclareFontFamily{U}{wncy}{}
\DeclareFontShape{U}{wncy}{m}{n}{<->wncyr10}{}
\DeclareSymbolFont{mcy}{U}{wncy}{m}{n}

%https://tex.stackexchange.com/questions/44235/
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
      <5> <6> <7> <8> <9> <10>
      <10.95> <12> <14.4> <17.28> <20.74> <24.88>
      mathx10
      }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}

%Music notes
\DeclareFontEncoding{LS2}{}{\noaccents@}
\DeclareFontSubstitution{LS2}{stix}{m}{n}
\DeclareSymbolFont{arrows3}{LS2}{stixtt}{m}{n}

\begin{document}
\noindent
$\mathds{1} \mathfrak{f}$
TextTextTextTextTextTextTextText
TextTextTextTextTextTextTextText
TextTextTextTextTextTextTextText
$$(P)$$ 
TextTextTextTextTextTextTextText
\end{document}

两个日志文件之间的“差异”结果:

< This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.8.9)  1 NOV 2022 13:22
---
> This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.9.2)  1 NOV 2022 14:21
3c3
<  \write18 enabled.
---
>  restricted \write18 enabled.
5,8c5,9
< **main.tex
< (./main.tex
< LaTeX2e <2022-06-01> patch level 5
< L3 programming layer <2022-08-05> (/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
---
> **mainfile.tex
> (./mainfile.tex
> LaTeX2e <2021-11-15> patch level 1
> L3 programming layer <2022-02-24>
> (/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
59c60
< File: l3backend-pdftex.def 2022-08-05 L3 backend support: PDF output (pdfTeX)
---
> File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX)
61,63c62,65
< \l__pdf_internal_box=\box51
< ) (./output.aux)
< \openout1 = `output.aux'.
---
> \l__pdf_internal_box=\box50
> )
> (./mainfile.aux)
> \openout1 = `mainfile.aux'.
124c126,127
< $\U/dsrom/m/n/10 1\U/euf/m/n/10 f$ \OT1/cmr/m/n/10 Text-Text-Text-Text-Text-Text-Text-Text Text-Text-Text-Text-Text-Text-Text-Text Text-
---
> $\U/dsrom/m/n/10 1\U/euf/m/n/10 f$ \OT1/cmr/m/n/10 Text-Text-Text-Text-Text-Tex
> t-Text-Text Text-Text-Text-Text-Text-Text-Text-Text Text-
130c133,134
< {/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./output.aux) ) 
---
> {/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
> (./mainfile.aux) ) 
132,135c136,139
<  1494 strings out of 477678
<  23551 string characters out of 5829488
<  309332 words of memory out of 5000000
<  20286 multiletter control sequences out of 15000+600000
---
>  1471 strings out of 478268
>  22894 string characters out of 5846348
>  298945 words of memory out of 5000000
>  19674 multiletter control sequences out of 15000+600000
138,140c142,148
<  41i,5n,51p,174b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
< </usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/doublestroke/dsrom10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/euler/eufm10.pfb>
< Output written on output.pdf (1 page, 25795 bytes).
---
>  41i,5n,51p,178b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
> </usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfon
> ts/cm/cmmi10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfont
> s/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/doublestr
> oke/dsrom10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts
> /euler/eufm10.pfb>
> Output written on mainfile.pdf (1 page, 25806 bytes).
145a154
> 

笔记本电脑编译的完整日志文件:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.9.2)  1 NOV 2022 14:21
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**mainfile.tex
(./mainfile.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (/usr/local/texlive/2022/texmf-dist/tex/latex/doublestroke/dsfont.sty
Package: dsfont 1995/08/01 v0.1 Double stroke roman fonts
) (/usr/local/texlive/2022/texmf-dist/tex/latex/jknapltx/mathrsfs.sty
Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)
\symrsfs=\mathgroup4
) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/latexsym.sty
Package: latexsym 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
\symlasy=\mathgroup5
LaTeX Font Info:    Overwriting symbol font `lasy' in version `bold'
(Font)                  U/lasy/m/n --> U/lasy/b/n on input line 52.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks16
\symAMSa=\mathgroup6
\symAMSb=\mathgroup7
LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty
Package: stmaryrd 1994/03/03 St Mary's Road symbol package
\symstmry=\mathgroup8
LaTeX Font Info:    Overwriting symbol font `stmry' in version `bold'
(Font)                  U/stmry/m/n --> U/stmry/b/n on input line 89.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/esvect/esvect.sty
Package: esvect 
\symesvector=\mathgroup9
)
\symmcy=\mathgroup10
\symmathx=\mathgroup11
Now handling font encoding LS2 ...
... no UTF-8 mapping file for font encoding LS2
\symarrows3=\mathgroup12
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-02-07 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box50
)
(./mainfile.aux)
\openout1 = `mainfile.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for LS2/stix/m/n on input line 29.
LaTeX Font Info:    Trying to load font information for LS2+stix on input line 29.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stix/ls2stix.fd
File: ls2stix.fd 2015/04/17 v1.1.2-latex STIX LS2 font definitions
)
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Trying to load font information for U+rsfs on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/jknapltx/ursfs.fd
File: ursfs.fd 1998/03/24 rsfs font definition file (jk)
)
LaTeX Font Info:    Trying to load font information for U+lasy on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/ulasy.fd
File: ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
)
LaTeX Font Info:    Trying to load font information for U+msa on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info:    Trying to load font information for U+msb on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Font Info:    Trying to load font information for U+stmry on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)
LaTeX Font Info:    Trying to load font information for U+esvect on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/esvect/uesvect.fd
File: uesvect.fd 
)
LaTeX Font Info:    Trying to load font information for LS2+stixtt on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stix/ls2stixtt.fd
File: ls2stixtt.fd 2015/04/17 v1.1.2-latex STIX typewriter LS2 font definitions
)
LaTeX Font Info:    Trying to load font information for U+dsrom on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/doublestroke/Udsrom.fd
File: Udsrom.fd 1995/08/01 v0.1 Double stroke roman font definitions
)
LaTeX Font Info:    Freeze math alphabet allocation in version normal.
(Font)              Allocated math groups: 14 (local: 2) on input line 31.
LaTeX Font Info:    Trying to load font information for U+euf on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/ueuf.fd
File: ueuf.fd 2013/01/14 v3.01 Euler Fraktur
)
LaTeX Font Info:    Undo math alphabet allocation in version normal on input line 31.

Overfull \hbox (14.37418pt too wide) in paragraph at lines 30--35
$\U/dsrom/m/n/10 1\U/euf/m/n/10 f$ \OT1/cmr/m/n/10 Text-Text-Text-Text-Text-Tex
t-Text-Text Text-Text-Text-Text-Text-Text-Text-Text Text-
 []

LaTeX Font Info:    No math alphabet change to frozen version normal on input line 35.
[1

{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./mainfile.aux) ) 
Here is how much of TeX's memory you used:
 1471 strings out of 478268
 22894 string characters out of 5846348
 298945 words of memory out of 5000000
 19674 multiletter control sequences out of 15000+600000
 476823 words of font info for 63 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 41i,5n,51p,178b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfon
ts/cm/cmmi10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfont
s/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/doublestr
oke/dsrom10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts
/euler/eufm10.pfb>
Output written on mainfile.pdf (1 page, 25806 bytes).
PDF statistics:
 28 PDF objects out of 1000 (max. 8388607)
 16 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

完整的 Overleaf 日志文件:

This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex 2022.8.9)  1 NOV 2022 13:22
entering extended mode
 \write18 enabled.
 %&-line parsing enabled.
**main.tex
(./main.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-08-05> (/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (/usr/local/texlive/2022/texmf-dist/tex/latex/doublestroke/dsfont.sty
Package: dsfont 1995/08/01 v0.1 Double stroke roman fonts
) (/usr/local/texlive/2022/texmf-dist/tex/latex/jknapltx/mathrsfs.sty
Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)
\symrsfs=\mathgroup4
) (/usr/local/texlive/2022/texmf-dist/tex/latex/base/latexsym.sty
Package: latexsym 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
\symlasy=\mathgroup5
LaTeX Font Info:    Overwriting symbol font `lasy' in version `bold'
(Font)                  U/lasy/m/n --> U/lasy/b/n on input line 52.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks16
\symAMSa=\mathgroup6
\symAMSb=\mathgroup7
LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/stmaryrd/stmaryrd.sty
Package: stmaryrd 1994/03/03 St Mary's Road symbol package
\symstmry=\mathgroup8
LaTeX Font Info:    Overwriting symbol font `stmry' in version `bold'
(Font)                  U/stmry/m/n --> U/stmry/b/n on input line 89.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/esvect/esvect.sty
Package: esvect 
\symesvector=\mathgroup9
)
\symmcy=\mathgroup10
\symmathx=\mathgroup11
Now handling font encoding LS2 ...
... no UTF-8 mapping file for font encoding LS2
\symarrows3=\mathgroup12
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2022-08-05 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count193
\l__pdf_internal_box=\box51
) (./output.aux)
\openout1 = `output.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 29.
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Checking defaults for LS2/stix/m/n on input line 29.
LaTeX Font Info:    Trying to load font information for LS2+stix on input line 29.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stix/ls2stix.fd
File: ls2stix.fd 2015/04/17 v1.1.2-latex STIX LS2 font definitions
)
LaTeX Font Info:    ... okay on input line 29.
LaTeX Font Info:    Trying to load font information for U+rsfs on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/jknapltx/ursfs.fd
File: ursfs.fd 1998/03/24 rsfs font definition file (jk)
)
LaTeX Font Info:    Trying to load font information for U+lasy on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/ulasy.fd
File: ulasy.fd 1998/08/17 v2.2e LaTeX symbol font definitions
)
LaTeX Font Info:    Trying to load font information for U+msa on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
)
LaTeX Font Info:    Trying to load font information for U+msb on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/umsb.fd
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
)
LaTeX Font Info:    Trying to load font information for U+stmry on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stmaryrd/Ustmry.fd)
LaTeX Font Info:    Trying to load font information for U+esvect on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/esvect/uesvect.fd
File: uesvect.fd 
)
LaTeX Font Info:    Trying to load font information for LS2+stixtt on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/stix/ls2stixtt.fd
File: ls2stixtt.fd 2015/04/17 v1.1.2-latex STIX typewriter LS2 font definitions
)
LaTeX Font Info:    Trying to load font information for U+dsrom on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/doublestroke/Udsrom.fd
File: Udsrom.fd 1995/08/01 v0.1 Double stroke roman font definitions
)
LaTeX Font Info:    Freeze math alphabet allocation in version normal.
(Font)              Allocated math groups: 14 (local: 2) on input line 31.
LaTeX Font Info:    Trying to load font information for U+euf on input line 31.
(/usr/local/texlive/2022/texmf-dist/tex/latex/amsfonts/ueuf.fd
File: ueuf.fd 2013/01/14 v3.01 Euler Fraktur
)
LaTeX Font Info:    Undo math alphabet allocation in version normal on input line 31.

Overfull \hbox (14.37418pt too wide) in paragraph at lines 30--35
$\U/dsrom/m/n/10 1\U/euf/m/n/10 f$ \OT1/cmr/m/n/10 Text-Text-Text-Text-Text-Text-Text-Text Text-Text-Text-Text-Text-Text-Text-Text Text-
 []

LaTeX Font Info:    No math alphabet change to frozen version normal on input line 35.
[1

{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./output.aux) ) 
Here is how much of TeX's memory you used:
 1494 strings out of 477678
 23551 string characters out of 5829488
 309332 words of memory out of 5000000
 20286 multiletter control sequences out of 15000+600000
 476823 words of font info for 63 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 41i,5n,51p,174b,107s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/doublestroke/dsrom10.pfb></usr/local/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/euler/eufm10.pfb>
Output written on output.pdf (1 page, 25795 bytes).
PDF statistics:
 28 PDF objects out of 1000 (max. 8388607)
 16 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

正如评论中提到的,使用\[...\]而不是$$...$$解决了我的问题。

相关内容