IEEE 访问模板 tcolorbox 问题

IEEE 访问模板 tcolorbox 问题

我试图突出显示 IEEE 访问模板中的某些部分。因此我添加了包:

\usepackage[most]{tcolorbox}
\newtcolorbox{highlighted}{colback=yellow,coltext=black,breakable}

当我添加此命令时,我丢失了子部分名称,并收到以下错误。我还尝试了:

\usepackage{pagecolor}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{soul}

它们都使模板崩溃了。

tcolorbox 的错误:

缺失数字,视为零。


 
‪/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex, 33
<to be read again> 
                   \gdef 
l.33 \ifnum
           \c@pgfmath@counta=0
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex))) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
\c@pgfmathroundto@lastzeros=\count310
)) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
File: pgfcorepoints.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@picminx=\dimen267
\pgf@picmaxx=\dimen268
\pgf@picminy=\dimen269
\pgf@picmaxy=\dimen270
\pgf@pathminx=\dimen271
\pgf@pathmaxx=\dimen272
\pgf@pathminy=\dimen273
\pgf@pathmaxy=\dimen274
\pgf@xx=\dimen275
\pgf@xy=\dimen276
\pgf@yx=\dimen277
\pgf@yy=\dimen278
\pgf@zx=\dimen279
\pgf@zy=\dimen280
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
File: pgfcorepathconstruct.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@path@lastx=\dimen281
\pgf@path@lasty=\dimen282
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
File: pgfcorepathusage.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@shorten@end@additional=\dimen283
\pgf@shorten@start@additional=\dimen284
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
File: pgfcorescopes.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgfpic=\box78
\pgf@hbox=\box79
\pgf@layerbox@main=\box80
\pgf@picture@serial@count=\count311
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
File: pgfcoregraphicstate.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgflinewidth=\dimen285
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex
File: pgfcoretransformations.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@pt@x=\dimen286
\pgf@pt@y=\dimen287
\pgf@pt@temp=\dimen288
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
File: pgfcorequick.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
File: pgfcoreobjects.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex
File: pgfcorepathprocessing.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
File: pgfcorearrows.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgfarrowsep=\dimen289
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
File: pgfcoreshade.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@max=\dimen290
\pgf@sys@shading@range@num=\count312
\pgf@shadingcount=\count313
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
File: pgfcoreimage.code.tex 2021/05/15 v3.1.9a (3.1.9a)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
File: pgfcoreexternal.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgfexternal@startupbox=\box81
)) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
File: pgfcorelayers.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
File: pgfcoretransparency.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
File: pgfcorepatterns.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
File: pgfcorerdf.code.tex 2021/05/15 v3.1.9a (3.1.9a)
))) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
File: pgfmoduleshapes.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgfnodeparttextbox=\box82
) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
File: pgfmoduleplot.code.tex 2021/05/15 v3.1.9a (3.1.9a)
) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
Package: pgfcomp-version-0-65 2021/05/15 v3.1.9a (3.1.9a)
\pgf@nodesepstart=\dimen291
\pgf@nodesepend=\dimen292
) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
Package: pgfcomp-version-1-18 2021/05/15 v3.1.9a (3.1.9a)
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/tools/verbatim.sty
Package: verbatim 2020-07-07 v1.5u LaTeX2e package for verbatim enhancements
\every@verbatim=\toks42
\verbatim@line=\toks43
\verbatim@in@stream=\read3
) (/usr/local/texlive/2022/texmf-dist/tex/latex/environ/environ.sty
Package: environ 2014/05/04 v0.3 A new way to define environments
(/usr/local/texlive/2022/texmf-dist/tex/latex/trimspaces/trimspaces.sty
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
))
\tcb@titlebox=\box83
\tcb@upperbox=\box84
\tcb@lowerbox=\box85
\tcb@phantombox=\box86
\c@tcbbreakpart=\count314
\c@tcblayer=\count315
\c@tcolorbox@number=\count316
\tcb@temp=\box87
\tcb@temp=\box88
\tcb@temp=\box89
\tcb@temp=\box90
(/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbraster.code.tex
Library (tcolorbox): 'tcbraster.code.tex' version '5.1.1'
\c@tcbrastercolumn=\count317
\c@tcbrasterrow=\count318
\c@tcbrasternum=\count319
\c@tcbraster=\count320
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex
Library (tcolorbox): 'tcbskins.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (/usr/local/texlive/2022/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
Package: pgffor 2021/05/15 v3.1.9a (3.1.9a)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)
\pgffor@iter=\dimen293
\pgffor@skip=\dimen294
\pgffor@stack=\toks44
\pgffor@toks=\toks45
)) (/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
Package: tikz 2021/05/15 v3.1.9a (3.1.9a)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.tex
File: pgflibraryplothandlers.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgf@plot@mark@count=\count321
\pgfplotmarksize=\dimen295
)
\tikz@lastx=\dimen296
\tikz@lasty=\dimen297
\tikz@lastxsaved=\dimen298
\tikz@lastysaved=\dimen299
\tikz@lastmovetox=\dimen300
\tikz@lastmovetoy=\dimen301
\tikzleveldistance=\dimen302
\tikzsiblingdistance=\dimen303
\tikz@figbox=\box91
\tikz@figbox@bg=\box92
\tikz@tempbox=\box93
\tikz@tempbox@bg=\box94
\tikztreelevel=\count322
\tikznumberofchildren=\count323
\tikznumberofcurrentchild=\count324
\tikz@fig@count=\count325
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
File: pgfmodulematrix.code.tex 2021/05/15 v3.1.9a (3.1.9a)
\pgfmatrixcurrentrow=\count326
\pgfmatrixcurrentcolumn=\count327
\pgf@matrix@numberofcolumns=\count328
)
\tikz@expandcount=\count329
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarytopaths.code.tex
File: tikzlibrarytopaths.code.tex 2021/05/15 v3.1.9a (3.1.9a)
)))
\tcb@waterbox=\box95
(/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbskinsjigsaw.code.texLibrary (tcolorbox): 'tcbskinsjigsaw.code.tex' version '5.1.1'
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex
Library (tcolorbox): 'tcbbreakable.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/generic/oberdiek/pdfcol.sty
Package: pdfcol 2019/12/29 v1.6 Handle new color stacks for pdfTeX (HO)
(/usr/local/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
) (/usr/local/texlive/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
))
Package pdfcol Info: New color stack `tcb@breakable' = 1 on input line 23.
\tcb@testbox=\box96
\tcb@totalupperbox=\box97
\tcb@totallowerbox=\box98
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex
Library (tcolorbox): 'tcbhooks.code.tex' version '5.1.1'
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex
Library (tcolorbox): 'tcbtheorems.code.tex' version '5.1.1'
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbfitting.code.tex
Library (tcolorbox): 'tcbfitting.code.tex' version '5.1.1'
\tcbfitdim=\dimen304
\tcb@lowerfitdim=\dimen305
\tcb@upperfitdim=\dimen306
\tcb@cur@hbadness=\count330
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex
Library (tcolorbox): 'tcblistingsutf8.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex
Library (tcolorbox): 'tcblistings.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/latex/listings/listings.sty
\lst@mode=\count331
\lst@gtempboxa=\box99
\lst@token=\toks46
\lst@length=\count332
\lst@currlwidth=\dimen307
\lst@column=\count333
\lst@pos=\count334
\lst@lostspace=\dimen308
\lst@width=\dimen309
\lst@newlines=\count335
\lst@lineno=\count336
\lst@maxwidth=\dimen310
(/usr/local/texlive/2022/texmf-dist/tex/latex/listings/lstmisc.sty
File: lstmisc.sty 2020/03/24 1.8d (Carsten Heinz)
\c@lstnumber=\count337
\lst@skipnumbers=\count338
\lst@framebox=\box100
) (/usr/local/texlive/2022/texmf-dist/tex/latex/listings/listings.cfg
File: listings.cfg 2020/03/24 1.8d listings configuration
))
Package: listings 2020/03/24 1.8d (Carsten Heinz)
(/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcblistingscore.code.tex
Library (tcolorbox): 'tcblistingscore.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbprocessing.code.tex
Library (tcolorbox): 'tcbprocessing.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tools/shellesc.sty
Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX
Package shellesc Info: Unrestricted shell escape enabled on input line 75.
))
\c@tcblisting=\count339
)) (/usr/local/texlive/2022/texmf-dist/tex/latex/listingsutf8/listingsutf8.sty
Package: listingsutf8 2019-12-10 v1.5 Allow UTF-8 in listings input (HO)
(/usr/local/texlive/2022/texmf-dist/tex/generic/stringenc/stringenc.sty
Package: stringenc 2019/11/29 v1.12 Convert strings between diff. encodings (HO)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pdfescape/pdfescape.sty
Package: pdfescape 2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
)))) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbexternal.code.tex
Library (tcolorbox): 'tcbexternal.code.tex' version '5.1.1'
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbmagazine.code.tex
Library (tcolorbox): 'tcbmagazine.code.tex' version '5.1.1'
) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbvignette.code.tex
Library (tcolorbox): 'tcbvignette.code.tex' version '5.1.1'
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryfadings.code.tex
File: tikzlibraryfadings.code.tex 2021/05/15 v3.1.9a (3.1.9a)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pgf/libraries/pgflibraryfadings.code.tex
File: pgflibraryfadings.code.tex 2021/05/15 v3.1.9a (3.1.9a)
))) (/usr/local/texlive/2022/texmf-dist/tex/latex/tcolorbox/tcbposter.code.tex
Library (tcolorbox): 'tcbposter.code.tex' version '5.1.1'
))
! Extra \fi.
<argument> ...op@@ }\expandafter \@firstofone \fi

答案1

嗨我已经通过添加解决了问题

\let\TeXyear\year
\documentclass{ieeeaccess}
\let\setyear\year
\let\year\TeXyear

    \newcommand\hlc[1]{\colorbox{yellow}{\textcolor{black}{#1}}}
\usepackage[most]{tcolorbox}
\usepackage{tikz} 

\newtcolorbox{highlighted}{colback=yellow,coltext=black,breakable}
\definecolor{accessblue}{cmyk}{1, 0.3, 0, 0.2}
\definecolor{greycolor}{cmyk}{0,0,0,.8}

如果有人收到或面临相同的颜色问题,在突出显示 IEEE 访问模板时可能会使用上面的线条。

相关内容