xcoffins – 连接棺材后“重复使用”杆子的问题

xcoffins – 连接棺材后“重复使用”杆子的问题

目前,我正在做一个个人项目,我想使用多个网格,我认为尝试xcoffins实现这一点会很好。我可以为文本主体定义一个棺材,为网格定义杆,并在我想要的任何地方连接一个额外的棺材。但是当连接第二个棺材时,我总是收到错误“杆不存在”。无论我使用普通连接还是星号版本,或者如果我使用[\BodyGrid-PoleColC, ...],只需重新定义杆即可。因为这很累人(我可以更轻松地使用偏移量),我想问一下我是否误解了杆的实现,应该使用不同的方法。

\documentclass[a4paper,twoside,10pt]{scrbook}%

\setlength{\parindent}{0mm}%
\pagestyle{empty}%
\usepackage[width=176mm,height=250mm,left=19mm,top=19mm]{geometry}%
\usepackage{xcolor,xcoffins}%

\begin{document}%

\NewCoffin \BodyGrid%
\SetVerticalCoffin \BodyGrid {176mm} {\color{green!10!white}\rule{176mm}{236mm}}%

\SetVerticalPole \BodyGrid {PoleColA} {0mm}%
\SetVerticalPole \BodyGrid {PoleColB} {30mm}%
\SetVerticalPole \BodyGrid {PoleColC} {60mm}%
\SetVerticalPole \BodyGrid {PoleColD} {90mm}%
\SetVerticalPole \BodyGrid {PoleColE} {120mm}%
\SetVerticalPole \BodyGrid {PoleColF} {150mm}%

\SetHorizontalPole \BodyGrid {PoleRowA} {236mm}%
\SetHorizontalPole \BodyGrid {PoleRowB} {206mm}%
\SetHorizontalPole \BodyGrid {PoleRowC} {176mm}%
\SetHorizontalPole \BodyGrid {PoleRowD} {146mm}%
\SetHorizontalPole \BodyGrid {PoleRowE} {116mm}%
\SetHorizontalPole \BodyGrid {PoleRowF} {86mm}%
\SetHorizontalPole \BodyGrid {PoleRowG} {56mm}%
\SetHorizontalPole \BodyGrid {PoleRowH} {26mm}%

\NewCoffin \CoffinFC%
\SetVerticalCoffin \CoffinFC {26mm} {\rule{26mm}{26mm}}%
\JoinCoffins \BodyGrid [PoleColF,PoleRowC] \CoffinFC [l,t]%

\SetVerticalPole \BodyGrid {PoleColA} {0mm}%
\SetVerticalPole \BodyGrid {PoleColB} {30mm}%
\SetVerticalPole \BodyGrid {PoleColC} {60mm}%
\SetVerticalPole \BodyGrid {PoleColD} {90mm}%
\SetVerticalPole \BodyGrid {PoleColE} {120mm}%
\SetVerticalPole \BodyGrid {PoleColF} {150mm}%

\SetHorizontalPole \BodyGrid {PoleRowA} {236mm}%
\SetHorizontalPole \BodyGrid {PoleRowB} {206mm}%
\SetHorizontalPole \BodyGrid {PoleRowC} {176mm}%
\SetHorizontalPole \BodyGrid {PoleRowD} {146mm}%
\SetHorizontalPole \BodyGrid {PoleRowE} {116mm}%
\SetHorizontalPole \BodyGrid {PoleRowF} {86mm}%
\SetHorizontalPole \BodyGrid {PoleRowG} {56mm}%
\SetHorizontalPole \BodyGrid {PoleRowH} {26mm}%

\NewCoffin \CoffinCG%
\SetVerticalCoffin \CoffinCG {26mm} {\rule{26mm}{26mm}}%
\JoinCoffins \BodyGrid [PoleColC,PoleRowG] \CoffinCG [l,t] %

\TypesetCoffin \BodyGrid%

\end{document}%

答案1

在连接或附加操作之后,原始棺材的极点将保留为\<coffin name>-<pole name>,以便可能重复的极点不会被覆盖。您可以通过使用检查棺材结构来看到这一点\ShowCoffinStructure \BodyGrid

\ShowCoffinStructure例如,请注意,如果您比较第一个\JoinCoffins\BodyGrid与连接\CoffinFC)和第二个\JoinCoffins\BodyGrid+\CoffinFC与连接)之后的输出\CoffinCG,您会看到极点\CoffinCG-...已添加到结构中。此外,如果您\CoffinCG以取代 的方式连接\BodyGrid+\CoffinFC,例如:

\JoinCoffins \BodyGrid [\BodyGrid-l,\BodyGrid-T] \CoffinCG [r,B] %

然后更新原始棺材的所有杆子(当然是在里面\BodyGrid),以匹配整个东西的新位置。\CoffinFC\BodyGrid

以下代码生成与您的相同排版输出。我只是删除了您添加的第二组杆,并在第二个连接操作中进行了更改:

\JoinCoffins \BodyGrid [PoleColC,PoleRowG] \CoffinCG [l,t] %

\JoinCoffins \BodyGrid [\BodyGrid-PoleColC,\BodyGrid-PoleRowG] \CoffinCG [l,t] %
\documentclass[a4paper,twoside,10pt]{scrbook}%

\setlength{\parindent}{0mm}%
\pagestyle{empty}%
\usepackage[width=176mm,height=250mm,left=19mm,top=19mm]{geometry}%
\usepackage{xcolor,xcoffins}%

\begin{document}%

\NewCoffin \BodyGrid%
\SetVerticalCoffin \BodyGrid {176mm} {\color{green!10!white}\rule{176mm}{236mm}}%

\SetVerticalPole \BodyGrid {PoleColA} {0mm}%
\SetVerticalPole \BodyGrid {PoleColB} {30mm}%
\SetVerticalPole \BodyGrid {PoleColC} {60mm}%
\SetVerticalPole \BodyGrid {PoleColD} {90mm}%
\SetVerticalPole \BodyGrid {PoleColE} {120mm}%
\SetVerticalPole \BodyGrid {PoleColF} {150mm}%

\SetHorizontalPole \BodyGrid {PoleRowA} {236mm}%
\SetHorizontalPole \BodyGrid {PoleRowB} {206mm}%
\SetHorizontalPole \BodyGrid {PoleRowC} {176mm}%
\SetHorizontalPole \BodyGrid {PoleRowD} {146mm}%
\SetHorizontalPole \BodyGrid {PoleRowE} {116mm}%
\SetHorizontalPole \BodyGrid {PoleRowF} {86mm}%
\SetHorizontalPole \BodyGrid {PoleRowG} {56mm}%
\SetHorizontalPole \BodyGrid {PoleRowH} {26mm}%

\NewCoffin \CoffinFC%
\SetVerticalCoffin \CoffinFC {26mm} {\rule{26mm}{26mm}}%
\JoinCoffins \BodyGrid [PoleColF,PoleRowC] \CoffinFC [l,t]%

% \ShowCoffinStructure \BodyGrid %

\NewCoffin \CoffinCG%
\SetVerticalCoffin \CoffinCG {26mm} {\rule{26mm}{26mm}}%
\JoinCoffins \BodyGrid [\BodyGrid-PoleColC,\BodyGrid-PoleRowG] \CoffinCG [l,t] %

% \ShowCoffinStructure \BodyGrid %

\TypesetCoffin \BodyGrid%

\end{document}%

相关内容