
ConTeXt를 사용하여 Circuitikz에서 수직 좌표를 사용하려고 하면 컴파일 오류가 발생합니다.
\usemodule[tikz]
\usemodule[circuitikz]
\ctikzset{current=european, voltage=european, resistor=european, inductor=european}
\starttext
\startcircuitikz
\draw (0, 0)
node [en amp, noinv input up] (ALI) {}
(ALI.+) -- ++(-1, 0) coordinate (A)
(ALI.-) -- ++(0, -1.5) coordinate (B)
to [R, l=$R_1$] (ALI.out |- B);
\stopcircuitikz
\stoptext
다음 오류가 발생합니다.
Package PGF Math Error: Unknown function `out' (in 'out |- B')
좌표 이름에 점 연산자를 사용 (ALI.out) coordinate (S)
하고 피하려고 시도했지만 오류가 계속 발생합니다. (S |- B)
다른 게시물을 보면 내 코드에 일반적인 오류가 표시되지 않습니다. ConTeXt와 Circuitikz에 문제가 있나요?
미리 감사드립니다.
답변1
Ti 설정이 변경된 것 같습니다.케이Z 그림 context
; 어쨌든 단순한 "앨리어싱"은 \startcircuitikz
더 이상 작동하지 않습니다. 좋은 소식은 circuitikz
환경이 아무 것도 하지 않는다는 것입니다(그리고 매뉴얼에서 이를 제거하는 것을 고려하고 있습니다). 귀하의 경우에는
\usemodule[tikz]
\usemodule[circuitikz]
\ctikzset{current=european, voltage=european, resistor=european, inductor=european}
\starttext
\starttikzpicture
\draw (0, 0)
node [en amp, noinv input up] (ALI) {}
(ALI.+) -- ++(-1, 0) coordinate (A)
(ALI.-) -- ++(0, -1.5) coordinate (B)
to [R, l=$R_1$] (ALI.out |- B);
\stoptikzpicture
\stoptext
제대로 작동하는 것 같습니다. 어쨌든, 나는 무슨 일이 일어나고 있는지 확인하려고 노력할 것입니다.
답변2
|
ConTeXt는 활성 문자(catcode 13)로 설정되고 Ti는케이Z는 "기타" |
(catcode 12)를 기대합니다. 이는 실제로 를 입력했지만 Ti를 의미합니다.|13=12
케이Z는 .|12=12
\startcircuitikz
구분된 매크로로 정의됩니다.
% Lines 131--134 of m-circuitikz.mkxl
\aliased\let\stopcircuitikz\relax
\permanent\protected\def\startcircuitikz#1\stopcircuitikz
{\starttikzpicture#1\stoptikzpicture}
따라서 인수가 스캔될 때 catcode는 "동결"됩니다. \starttikzpicture
인수를 취하지 않으므로~이다|
적절한 catcode로 스캔할 수 있습니다 .
이 문제를 해결하려면 다음 중 하나 \startcircuitikz
에 직접 별칭을 지정할 수 있습니다 \starttikzpicture
.
\usemodule[circuitikz]
\let\startcircuitikz\starttikzpicture
\let\stopcircuitikz\stoptikzpicture
\startTEXpage[offset=1em]
\startcircuitikz
\draw (0, 0) to (0, 0 -| 1, 1);
\stopcircuitikz
\stopTEXpage
또는 |
의 catcode를 수동으로 수정할 수 있습니다.
\usemodule[circuitikz]
\catcode`\|=12
\startTEXpage[offset=1em]
\startcircuitikz
\draw (0, 0) to (0, 0 -| 1, 1);
\stopcircuitikz
\stopTEXpage
두 옵션 모두 동일한 출력을 제공합니다.