我想使用 tikzlibary 结在表格内绘制一个结。当我在结环境中指定考虑自交点时,我收到错误:
You can't use `\unskip' after \the. <argument> \unskip
如果不考虑自相交,它就可以完美地工作。我在 TeXworks 中使用 pdfLaTeX。
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{knots}
\begin{document}
\begin{tabular}{|c|}
\hline
\begin{tikzpicture}
\begin{knot}[
draft mode=crossings,
consider self intersections,]
\strand[red,ultra thick, xscale=.2, yscale=.2] (+-5.1498,+-0.3069)
.. controls (+-4.6351,+2.6312) and (+-2.9828,+5.3368) .. (+0.0000,+5.3368)
.. controls (+2.9828,+5.3368) and (+4.6351,+2.6312) .. (+5.1498,+-0.3069)
.. controls (+5.4153,+-1.8225) and (+5.0220,+-3.2691) .. (+3.6412,+-3.9480)
.. controls (+1.7709,+-4.8675) and (+-0.8477,+-4.5300) .. (+-1.5119,+-2.5546)
.. controls (+-2.1181,+-0.7515) and (+1.1716,+-0.1591) .. (+1.4680,+1.3004)
.. controls (+1.8076,+2.9727) and (+-3.5678,+6.6995) .. (+0.0470,+6.6995)
.. controls (+3.6619,+6.6995) and (+-1.7955,+2.9828) .. (+-1.4680,+1.3004)
.. controls (+-1.1834,+-0.1614) and (+2.1181,+-0.7515) .. (+1.5119,+-2.5546)
.. controls (+0.8477,+-4.5300) and (+-1.7709,+-4.8675) .. (+-3.6412,+-3.9480)
.. controls (+-5.0220,+-3.2691) and (+-5.4153,+-1.8225) .. (+-5.1498,+-0.3069)
-- cycle;
\end{knot}
\end{tikzpicture}
\end{tabular}
\end{document}
这是相应的控制台打印输出,感谢您的帮助:
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./TikzError.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(d:/Programme/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(d:/Programme/texlive/2020/texmf-dist/tex/latex/base/size12.clo))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.
tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-
lists.tex))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.d
ef)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/pgf.revision.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.t
ex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.te
x
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered
.code.tex))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex
.def
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common
-pdf.def)))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpat
h.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotoco
l.code.tex)) (d:/Programme/texlive/2020/texmf-dist/tex/latex/xcolor/xcolor.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.t
ex (d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex
)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.t
ex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.cod
e.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.bas
ic.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.tri
gonometric.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.ran
dom.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.com
parison.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.bas
e.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rou
nd.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.mis
c.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.int
egerarithmetics.code.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.te
x)) (d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.
code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathcon
struct.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusa
ge.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.
code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphic
state.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransfo
rmations.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.c
ode.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects
.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathpro
cessing.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.
code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.c
ode.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.c
ode.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexterna
l.code.tex))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.
code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspa
rency.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepattern
s.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.cod
e.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.c
ode.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.cod
e.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-versi
on-0-65.sty)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-versi
on-1-18.sty))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.te
x)) (d:/Programme/texlive/2020/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.c
ode.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/libraries/pgflibraryploth
andlers.code.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.c
ode.tex)
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibrarytopaths.code.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/spath3/tikzlibraryknots.code.te
x (d:/Programme/texlive/2020/texmf-dist/tex/latex/spath3/spath3.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
) (d:/Programme/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-2020-1
0-01.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse-generi
c.tex))))
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librar
ies/tikzlibraryintersections.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/libraries/pgflibraryinter
sections.code.tex
(d:/Programme/texlive/2020/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.c
ode.tex)))
(d:/Programme/texlive/2020/texmf-dist/tex/latex/spath3/tikzlibraryspath3.code.t
ex)) (./TikzError.aux)
(d:/Programme/texlive/2020/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
(d:/Programme/texlive/2020/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(d:/Programme/texlive/2020/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
! You can't use `\unskip' after \the.
<argument> \unskip
l.23 \end{knot}
?
答案1
库中有一个knots
与比较 s 相关的错误fp
,只有当 knot 环境包含在某种对齐环境中时才会暴露出来。我现在已经修复了这个问题github
并将在适当的时候登陆 CTAN。
答案2
您需要consider self intersections=no splits
选项。根据输出,您可能需要重新考虑坐标,或者添加ignore endpoint intersections=false
和调整clip radius
。
以上:添加consider self intersections=no splits
下面:还添加了ignore endpoint intersections=false
和clip radius=5pt
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{knots}
\begin{document}
\begin{tabular}{|c|}
\hline
\begin{tikzpicture}
\begin{knot}[
draft mode=crossings,
consider self intersections=no splits,
ignore endpoint intersections=false,
clip radius=5pt]
\strand[red,ultra thick, xscale=.2, yscale=.2] (+-5.1498,+-0.3069)
.. controls (+-4.6351,+2.6312) and (+-2.9828,+5.3368) .. (+0.0000,+5.3368)
.. controls (+2.9828,+5.3368) and (+4.6351,+2.6312) .. (+5.1498,+-0.3069)
.. controls (+5.4153,+-1.8225) and (+5.0220,+-3.2691) .. (+3.6412,+-3.9480)
.. controls (+1.7709,+-4.8675) and (+-0.8477,+-4.5300) .. (+-1.5119,+-2.5546)
.. controls (+-2.1181,+-0.7515) and (+1.1716,+-0.1591) .. (+1.4680,+1.3004)
.. controls (+1.8076,+2.9727) and (+-3.5678,+6.6995) .. (+0.0470,+6.6995)
.. controls (+3.6619,+6.6995) and (+-1.7955,+2.9828) .. (+-1.4680,+1.3004)
.. controls (+-1.1834,+-0.1614) and (+2.1181,+-0.7515) .. (+1.5119,+-2.5546)
.. controls (+0.8477,+-4.5300) and (+-1.7709,+-4.8675) .. (+-3.6412,+-3.9480)
.. controls (+-5.0220,+-3.2691) and (+-5.4153,+-1.8225) .. (+-5.1498,+-0.3069)
-- cycle;
\end{knot}
\end{tikzpicture}
\end{tabular}
\end{document}