![overleaf 中的功能代码在本地 texmaker 中不起作用](https://linux22.com/image/470796/overleaf%20%E4%B8%AD%E7%9A%84%E5%8A%9F%E8%83%BD%E4%BB%A3%E7%A0%81%E5%9C%A8%E6%9C%AC%E5%9C%B0%20texmaker%20%E4%B8%AD%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我使用 apa7 包创建了一个 apa7 格式的文章模板。该代码在 overleaf 中运行良好。当我将其复制并粘贴到 texmaker 中时,代码会产生很多问题。与 overleaf 相比,我收到错误消息,提示 \begin{document} 缺失,尽管我将其放在了序言之后的代码中。此外,texmaker 似乎无法正确识别 \shorttitle 序言。我确实搜索了几个在线资源,我想我根据那里的建议设置了我的 texmaker。因此,我没有解决问题的想法。这是我的代码:
\documentclass[man]{apa7}
%\usepackage{lipsum}
%\usepackage[american]{babel}
\usepackage{csquotes}
%\usepackage[style=apa,sortcites=true,sorting=nyt,backend=biber]{biblatex}
%\DeclareLanguageMapping{american}{american-apa}
\addbibresource{ef_short_report.bib}
\title{Sample APA-Style Document Using the \textsf{apa7} Package}
\shorttitle{Sample Document}
\author{JK}
\affiliation{A University Somewhere}
\leftheader{K}
\abstract{\lipsum[1]}
\keywords{APA style, demonstration}
\authornote{
\addORCIDlink{JK}{0000-0000-0000-0000}
Correspondence concerning this article should be addressed to J K, Department of XYZ, Medical Center, City, Country
00000. E-mail: [email protected]}
\begin{document}
\maketitle
\Textcite{Beers.2002d} said this,
too \parencite{Augusti.2013,Evans.2013}. Further evidence comes from
other sources \parencite{Barrera.2013}.
\lipsum[3]
\printbibliography
\appendix
\end{document}
这是我收到的错误消息:
LOG FILE :
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 23.10.12) (preloaded format=pdflatex 2023.11.10) 10 NOV 2023 15:42
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**./apa7_temp.tex
(apa7_temp.tex
LaTeX2e <2023-11-01>
L3 programming layer <2023-11-01>
(apa7.cls
Document Style `res' <26 Sep 89>.
LaTeX Warning: You have requested document class `apa7',
but the document class provides `res'.
Document Class: res 2000/05/19 v1.4b Resume class
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2023/05/17 v1.4n Standard LaTeX file (size option)
)
\c@part=\count186
\c@section=\count187
\c@subsection=\count188
\c@subsubsection=\count189
\c@paragraph=\count190
\c@subparagraph=\count191
\c@figure=\count192
\c@table=\count193
\abovecaptionskip=\skip48
\belowcaptionskip=\skip49
\bibindent=\dimen140
)
No auxiliary output files.
\tabular@text=\toks17
\tabular@head=\toks18
\tabular@tail=\toks19
\@ta=\toks20
\undefined@token=\toks21
\sectionwidth=\dimen141
\sectionskip=\skip50
\resumewidth=\dimen142
\@columnwidth=\dimen143
\c@numberofcolumns=\count194
) (C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/csquotes\csquotes.sty
Package: csquotes 2022-09-14 v5.2n context-sensitive quotations (JAW)
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count195
)
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks22
)
\csq@reset=\count196
\csq@gtype=\count197
\csq@glevel=\count198
\csq@qlevel=\count199
\csq@maxlvl=\count266
\csq@tshold=\count267
\csq@ltx@everypar=\toks23
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/csquotes\csquotes.def
File: csquotes.def 2022-09-14 v5.2n csquotes generic definitions (JAW)
)
Package csquotes Info: Trying to load configuration file 'csquotes.cfg'...
Package csquotes Info: ... configuration file loaded successfully.
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/csquotes\csquotes.cfg
File: csquotes.cfg
))
! Undefined control sequence.
l.9 \shorttitle
{jk}
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.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.9 \shorttitle{j
k}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Undefined control sequence.
l.11 \affiliation
{UKL}
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.
! Undefined control sequence.
l.13 \leftheader
{Keil}
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.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.13 \leftheader{K
eil}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.15 \abstract
{here comes the abstract}
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Undefined control sequence.
l.17 \keywords
{maltreatment, cooperation}
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.
! Undefined control sequence.
l.19 \authornote
{
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.
! Undefined control sequence.
l.20 \addORCIDlink
{Jan Keil}{0000-0002-5001-0659}
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.
Package csquotes Info: Checking for multilingual support...
Package csquotes Info: ... none found.
(C:\Users\Jan\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pdfte
x.def
File: l3backend-pdftex.def 2023-10-23 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count268
\l__pdf_internal_box=\box51
)
LaTeX Warning: Unused global option(s):
[jou].
No file apa7_temp.aux.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 25.
LaTeX Font Info: ... okay on input line 25.
[1
{C:/Users/Jan/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}]
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line 26.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 26.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 26.
LaTeX Warning: Citation `Ackerman.2008' on page 2 undefined on input line 30.
[2]
***********
LaTeX2e <2023-11-01>
L3 programming layer <2023-11-01>
***********
LaTeX Warning: There were undefined references.
)
Here is how much of TeX's memory you used:
1515 strings out of 474591
24869 string characters out of 5746721
1925533 words of memory out of 5000000
23749 multiletter control sequences out of 15000+600000
562019 words of font info for 49 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
49i,6n,52p,275b,202s stack positions out of 10000i,1000n,20000p,200000b,200000s
<C:/Users/Jan/AppData/Local/Programs/MiKTeX/fonts/type1/public/amsfonts/cm/cm
bx10.pfb><C:/Users/Jan/AppData/Local/Programs/MiKTeX/fonts/type1/public/amsfont
s/cm/cmbx9.pfb><C:/Users/Jan/AppData/Local/Programs/MiKTeX/fonts/type1/public/a
msfonts/cm/cmr10.pfb><C:/Users/Jan/AppData/Local/Programs/MiKTeX/fonts/type1/pu
blic/amsfonts/cm/cmr12.pfb><C:/Users/Jan/AppData/Local/Programs/MiKTeX/fonts/ty
pe1/public/amsfonts/cm/cmr17.pfb><C:/Users/Jan/AppData/Local/Programs/MiKTeX/fo
nts/type1/public/amsfonts/cm/cmr9.pfb>
Output written on C:\Users\Jan\Desktop\apa7\build\apa7_temp.pdf (2 pages, 77649
bytes).
PDF statistics:
39 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)
提前感谢任何建议。