带有 includegraphics 的 todonotes 包产生编译错误

带有 includegraphics 的 todonotes 包产生编译错误

我想将todonotes-package 与\includegraphics[]{}-command 一起使用。它对文本和图形都很好用,但编译后我还是收到两个错误:

  1. \reserved@a 的参数有一个额外的}。

    \par l.9 ...includegraphics[scale=1.3]{grafik/example}} 我遇到了刚刚插入的}' that doesn't seem to match anything. For example,\def\a#1{...}' 和\a}' would produce this error. If you simply proceed now, the \par',它们会导致我报告失控参数,这可能是问题的根源。但如果使用}' was spurious, just type2',它就会消失。

  2. 失控的争论?

    {@firstoftwo {\Gin@cliptrue \Gin@i }}\def \reserved@b {\Gin@clipfalse \ETC. ! 段落在 \reserved@a 完成之前结束。 \par l.9 ...includegraphics[scale=1.3]{grafik/example}} 我怀疑您忘记了 `}',导致我将这个控制序列应用于太多文本。我们该如何恢复?我的计划是忘记整件事并希望一切顺利。

所以它告诉我同时多了一个}和少了一个}?事实上输出的 pdf 没问题,但无论如何,我想知道如何避免错误。有没有其他方法可以在页面侧面用图片来实现注释?

在此处输入图片描述

\documentclass{article}
\usepackage[colorinlistoftodos,prependcaption,textsize=footnotesize,color=black!20,linecolor=black!20,bordercolor=white,backgroundcolor=white]{todonotes}
\usepackage{tikzducks}

\begin{document}

One morning, when Gregor Samsa woke from 
\todo{hallo} 
troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked. "What's happened to me?" he thought. It wasn't a dream. His room, a proper human room although a little too small, lay peacefully between its four familiar walls. 
\todo{\includegraphics[scale=.3]{example-image}}
A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops 

\end{document}

完整日志为:

This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Arch Linux) (preloaded format=xelatex 2020.2.10)  7 MAR 2020 21:31
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**name.tex
(./name.tex
LaTeX2e <2019-10-01> patch level 1
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/08/27 v1.4j Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2019/08/27 v1.4j Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-dist/tex/latex/todonotes/todonotes.sty
Package: todonotes 2019/01/24 v1.1.2 Todonotes source and documentation.
Package: todonotes 2018/11/22

(/usr/share/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(/usr/share/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

(/usr/share/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15

(/usr/share/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count88
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
(/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

(/usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: xetex.def on input line 225.

(/usr/share/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2017/06/24 v5.0h Graphics/color driver for xetex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
)
(/usr/share/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
\pgfutil@everybye=\toks16
\pgfutil@tempdima=\dimen103
\pgfutil@tempdimb=\dimen104

(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex))
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
\pgfutil@abb=\box27

(/usr/share/texmf-dist/tex/latex/ms/everyshi.sty
Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
))
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
(/usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex)
Package: pgfrcs 2019/08/03 v3.1.4b (3.1.4b)
))
Package: pgf 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2019/10/08 v1.3c Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: xetex.def on input line 105.
)
\Gin@req@height=\dimen105
\Gin@req@width=\dimen106
)
(/usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
Package: pgfsys 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
\pgfkeys@pathtoks=\toks17
\pgfkeys@temptoks=\toks18

(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex
\pgfkeys@tmptoks=\toks19
))
\pgf@x=\dimen107
\pgf@y=\dimen108
\pgf@xa=\dimen109
\pgf@ya=\dimen110
\pgf@xb=\dimen111
\pgf@yb=\dimen112
\pgf@xc=\dimen113
\pgf@yc=\dimen114
\pgf@xd=\dimen115
\pgf@yd=\dimen116
\w@pgf@writea=\write3
\r@pgf@reada=\read1
\c@pgf@counta=\count89
\c@pgf@countb=\count90
\c@pgf@countc=\count91
\c@pgf@countd=\count92
\t@pgf@toka=\toks20
\t@pgf@tokb=\toks21
\t@pgf@tokc=\toks22
\pgf@sys@id@count=\count93

(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
File: pgf.cfg 2019/08/03 v3.1.4b (3.1.4b)
)
Driver file for pgf: pgfsys-xetex.def

(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
File: pgfsys-xetex.def 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
File: pgfsys-dvipdfmx.def 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
File: pgfsys-common-pdf.def 2019/08/03 v3.1.4b (3.1.4b)
)
\pgfsys@objnum=\count94
)))
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
File: pgfsyssoftpath.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfsyssoftpath@smallbuffer@items=\count95
\pgfsyssoftpath@bigbuffer@items=\count96
)
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
File: pgfsysprotocol.code.tex 2019/08/03 v3.1.4b (3.1.4b)
))
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
Package: pgfcore 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
\pgfmath@dimen=\dimen117
\pgfmath@count=\count97
\pgfmath@box=\box28
\pgfmath@toks=\toks23
\pgfmath@stack@operand=\toks24
\pgfmath@stack@operation=\toks25
)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code
.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.te
x) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics
.code.tex))) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
\c@pgfmathroundto@lastzeros=\count98
)) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
File: pgfcorepoints.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@picminx=\dimen118
\pgf@picmaxx=\dimen119
\pgf@picminy=\dimen120
\pgf@picmaxy=\dimen121
\pgf@pathminx=\dimen122
\pgf@pathmaxx=\dimen123
\pgf@pathminy=\dimen124
\pgf@pathmaxy=\dimen125
\pgf@xx=\dimen126
\pgf@xy=\dimen127
\pgf@yx=\dimen128
\pgf@yy=\dimen129
\pgf@zx=\dimen130
\pgf@zy=\dimen131
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
File: pgfcorepathconstruct.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@path@lastx=\dimen132
\pgf@path@lasty=\dimen133
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
File: pgfcorepathusage.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@shorten@end@additional=\dimen134
\pgf@shorten@start@additional=\dimen135
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
File: pgfcorescopes.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfpic=\box29
\pgf@hbox=\box30
\pgf@layerbox@main=\box31
\pgf@picture@serial@count=\count99
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
File: pgfcoregraphicstate.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgflinewidth=\dimen136
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.t
ex
File: pgfcoretransformations.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@pt@x=\dimen137
\pgf@pt@y=\dimen138
\pgf@pt@temp=\dimen139
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
File: pgfcorequick.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
File: pgfcoreobjects.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.te
x
File: pgfcorepathprocessing.code.tex 2019/08/03 v3.1.4b (3.1.4b)
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
File: pgfcorearrows.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfarrowsep=\dimen140
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
File: pgfcoreshade.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@max=\dimen141
\pgf@sys@shading@range@num=\count100
\pgf@shadingcount=\count101
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
File: pgfcoreimage.code.tex 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
File: pgfcoreexternal.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfexternal@startupbox=\box32
))
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
File: pgfcorelayers.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
File: pgfcoretransparency.code.tex 2019/08/03 v3.1.4b (3.1.4b)
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
File: pgfcorepatterns.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
File: pgfcorerdf.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)))
(/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
File: pgfmoduleshapes.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfnodeparttextbox=\box33
)
(/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
File: pgfmoduleplot.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
Package: pgfcomp-version-0-65 2019/08/03 v3.1.4b (3.1.4b)
\pgf@nodesepstart=\dimen142
\pgf@nodesepend=\dimen143
)
(/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
Package: pgfcomp-version-1-18 2019/08/03 v3.1.4b (3.1.4b)
))
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex))
(/usr/share/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
Package: pgffor 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)
\pgffor@iter=\dimen144
\pgffor@skip=\dimen145
\pgffor@stack=\toks26
\pgffor@toks=\toks27
))
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
Package: tikz 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.te
x
File: pgflibraryplothandlers.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgf@plot@mark@count=\count102
\pgfplotmarksize=\dimen146
)
\tikz@lastx=\dimen147
\tikz@lasty=\dimen148
\tikz@lastxsaved=\dimen149
\tikz@lastysaved=\dimen150
\tikz@lastmovetox=\dimen151
\tikz@lastmovetoy=\dimen152
\tikzleveldistance=\dimen153
\tikzsiblingdistance=\dimen154
\tikz@figbox=\box34
\tikz@figbox@bg=\box35
\tikz@tempbox=\box36
\tikz@tempbox@bg=\box37
\tikztreelevel=\count103
\tikznumberofchildren=\count104
\tikznumberofcurrentchild=\count105
\tikz@fig@count=\count106
 (/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
File: pgfmodulematrix.code.tex 2019/08/03 v3.1.4b (3.1.4b)
\pgfmatrixcurrentrow=\count107
\pgfmatrixcurrentcolumn=\count108
\pgf@matrix@numberofcolumns=\count109
)
\tikz@expandcount=\count110

(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
topaths.code.tex
File: tikzlibrarytopaths.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)))
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
positioning.code.tex
File: tikzlibrarypositioning.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
shadows.code.tex
File: tikzlibraryshadows.code.tex 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
fadings.code.tex
File: tikzlibraryfadings.code.tex 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
File: pgflibraryfadings.code.tex 2019/08/03 v3.1.4b (3.1.4b)
)))
(/usr/share/texmf-dist/tex/latex/tools/calc.sty
Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count111
\calc@Bcount=\count112
\calc@Adimen=\dimen155
\calc@Bdimen=\dimen156
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count113
\calc@Cskip=\skip45
)
\c@@todonotes@numberoftodonotes=\count114
)
(/usr/share/texmf-dist/tex/latex/tikzducks/tikzducks.sty
Package: tikzducks 2019/04/07 v1.1 Draw rubber ducks in TikZ

(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
patterns.code.tex
File: tikzlibrarypatterns.code.tex 2019/08/03 v3.1.4b (3.1.4b)

(/usr/share/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.code.tex
File: pgflibrarypatterns.code.tex 2019/08/03 v3.1.4b (3.1.4b)
))
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
calc.code.tex
File: tikzlibrarycalc.code.tex 2019/08/03 v3.1.4b (3.1.4b)
) (/usr/share/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
)) (./name.aux)
\openout1 = `name.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.

ABD: EveryShipout initializing macros
! Argument of \reserved@a has an extra }.
<inserted text> 
                \par 
l.10 ...\includegraphics[scale=.3]{example-image}}

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?
{\@firstoftwo {\Gin@cliptrue \Gin@i }}\def \reserved@b {\Gin@clipfalse \ETC.
! Paragraph ended before \reserved@a was complete.
<to be read again> 
                   \par 
l.10 ...\includegraphics[scale=.3]{example-image}}

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.

File: example-image.pdf Graphic file (type pdf)
<use example-image.pdf>

Overfull \hbox (39.25674pt too wide) in paragraph at lines 10--10
[][][]  
 []

File: example-image.pdf Graphic file (type pdf)
<use example-image.pdf>

Overfull \hbox (39.25674pt too wide) in paragraph at lines 10--10
[][][]  
 []

[1

] (./name.aux) ) 
Here is how much of TeX's memory you used:
 12751 strings out of 492483
 265525 string characters out of 6134979
 355950 words of memory out of 5000000
 17018 multiletter control sequences out of 15000+600000
 3656 words of font info for 16 fonts, out of 8000000 for 9000
 1348 hyphenation exceptions out of 8191
 68i,12n,83p,977b,985s stack positions out of 5000i,500n,10000p,200000b,80000s

Output written on name.pdf (1 page).

答案1

这个错误是典型的“移动参数中的脆弱命令”错误,LaTeX\protect为这种情况提供了解决方案。

我在 texlive 2018 中遇到了错误,但如果你使用

\todo{\protect\includegraphics[scale=.3]{example-image}}
      %%%%%%%%%

在更新的 texlive 2019 或 texlive 2020 预测试中,问题中的原始文档没有出现任何错误。

相关内容