fix: \sdcol emits English labels illegal/legal in [en] mode

Previously \sdcol hardcoded Chinese labels 非法/合法 regardless of the
package option. [en] mode now produces 'illegal' and 'legal'.
This commit is contained in:
dela
2026-08-21 14:56:39 +08:00
parent 45db61f3e2
commit f2ccd6fb08
+4 -2
View File
@@ -256,9 +256,9 @@
\node[anchor=west, inner sep=0pt] (#1) at (\the\sd@cx,\the\sd@cy) {% \node[anchor=west, inner sep=0pt] (#1) at (\the\sd@cx,\the\sd@cy) {%
\begin{tikzpicture}[baseline=(sd@mid)] \begin{tikzpicture}[baseline=(sd@mid)]
\node[sd term, fill=sdCoral!30] (sd@B) {$\displaystyle #2$}; \node[sd term, fill=sdCoral!30] (sd@B) {$\displaystyle #2$};
\node[font=\scriptsize, text=sdCoral, above=1pt of sd@B] {非法}; \node[font=\scriptsize, text=sdCoral, above=1pt of sd@B] {\sd@lblillegal};
\node[sd term, fill=sdTeal!30, right=8mm of sd@B] (sd@G) {$\displaystyle #3$}; \node[sd term, fill=sdTeal!30, right=8mm of sd@B] (sd@G) {$\displaystyle #3$};
\node[font=\scriptsize, text=sdTeal, above=1pt of sd@G] {合法}; \node[font=\scriptsize, text=sdTeal, above=1pt of sd@G] {\sd@lbllegal};
\coordinate (sd@mid) at ($(sd@B.east)!0.5!(sd@G.west)$); \coordinate (sd@mid) at ($(sd@B.east)!0.5!(sd@G.west)$);
\end{tikzpicture}};% \end{tikzpicture}};%
\pgfextractx{\sd@tmpx}{\pgfpointanchor{#1}{east}}% \pgfextractx{\sd@tmpx}{\pgfpointanchor{#1}{east}}%
@@ -267,8 +267,10 @@
\ifder@en \ifder@en
\def\sd@lblidea{Idea}\def\sd@lblrw{Rewrite}\def\sd@lblcaveat{Caveat} \def\sd@lblidea{Idea}\def\sd@lblrw{Rewrite}\def\sd@lblcaveat{Caveat}
\def\sd@lblillegal{illegal}\def\sd@lbllegal{legal}
\else \else
\def\sd@lblidea{思路}\def\sd@lblrw{改写}\def\sd@lblcaveat{注意} \def\sd@lblidea{思路}\def\sd@lblrw{改写}\def\sd@lblcaveat{注意}
\def\sd@lblillegal{非法}\def\sd@lbllegal{合法}
\fi \fi
\newcommand{\sdsetlabels}[3]{\def\sd@lblidea{#1}\def\sd@lblrw{#2}\def\sd@lblcaveat{#3}} \newcommand{\sdsetlabels}[3]{\def\sd@lblidea{#1}\def\sd@lblrw{#2}\def\sd@lblcaveat{#3}}
\newlength{\sd@raillen} \newlength{\sd@raillen}