pstricks, dvi->ps->pdf 툴체인 및 문자 조합 rt와 관련된 이상한 문제

pstricks, dvi->ps->pdf 툴체인 및 문자 조합 rt와 관련된 이상한 문제

이것은 매우 이상한 버그입니다. [편집]버그는 아닙니다. 문제는 내 코드에 있었습니다.

나는 이것을 작은 작업 예제로 가져오는 데 1시간을 보냈지만 그것이 최소인지 알 수 없습니다.

설정: Ubuntu 최신 릴리스, 표준 업데이트 .tex. 파일:

\documentclass{beamer}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{pst-plot}
\usepackage{pst-math}
\newcommand{\polarWedge}[3]{%
\pstVerb{%
/t #1 def%
}%
}%
\begin{document}
\begin{frame}
\begin{pspicture*}(-3,-1)(1.5,2.3)%
\polarWedge{0}{1}{t 2 div 1 add}%
\end{pspicture*}
rt
\end{frame}
\end{document}

증상: dvi->ps-pdf 툴체인을 사용하면 제대로 컴파일되지 않습니다. pdflatex로 컴파일합니다. 문제는 문자 조합 rt에 있습니다. rt를 rt로 변경하거나 다른 문자 조합으로 변경하면 문제가 사라집니다. 이것은 내가 라텍스에서 본 것 중 가장 이상한 것입니다. (rt 문자가 처리되는 방식일까요?)

이 문제가 얼마나 재현 가능한지 잘 모르겠습니다. 컴퓨터에서 동일한 문제가 발생하면 알려주시기 바랍니다!


[편집] 이제 문제가 해결되었습니다. Herbert는 문제를 올바르게 식별했습니다. t가 내부 변수로 사용되고 t를 재정의하면 뭔가가 엉망이 됩니다. Herbert가 제안한 솔루션도 올바른 솔루션이었습니다. 변수 t를 평가하는 로컬 사전을 정의한 다음 사전을 팝해야 합니다. 슬라이드의 수정된 버전을 게시하고 있습니다.

나는 이것이 버그가 아니라 포스트스크립트에 대한 나의 지식 부족의 표현임을 인정해야 합니다.


[편집]@cfr: 아니오 귀하의 최소한의 예는 내 예와 동일한 문제를 다루지 않습니다. 내 예에서는 pspicture를 제거하면 슬라이드가 rt 문자로 제대로 컴파일됩니다. rt-bug는 pspicture를 사용하는 경우에만 나타납니다.


@Herbert: 예, 문제는 문자 t를 재정의하기 위해 \pstVerb를 사용하는 것과 결합하여 여러 곳에서 사용되는 문자 t에 있다고 생각합니다. 그러나 기능을 평가하려면 문자 t에 값을 할당해야 합니다. \pstVerb를 사용하지 않고 이를 수행할 수 있는 방법이 있습니까?


[편집] @cfr: 내가 받은 오류는 ps2pdf 실행 파일에서 발생했습니다. 오류 보고서는 다음과 같습니다.

프로세스 시작됨: ps2pdf "pstricksProblem".ps

오류: --restore--의 /invalidrestore 피연산자 스택: (r) 0.4 --nostringval-- --nostringval-- 실행 스택: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1916 1 3 %oparray_pop 1915 1 3 %oparray_pop 1899 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- 1839 3 4 %oparray_pop --nostringval-- 1823 3 4 %oparray_pop --nostringval-- 사전 스택 : --dict:1175/1684(ro)(G)-- --dict:1/20(G)-- --dict:163/200(L)-- --dict:189/300(L) -- 현재 할당 모드는 로컬입니다. 현재 파일 위치는 133316입니다. GPL Ghostscript 9.10: 복구할 수 없는 오류, 종료 코드 1

오류로 인해 프로세스가 종료되었습니다.


[편집] 사람들이 요청한 대로 원본 슬라이드는 다음과 같습니다.

\documentclass{beamer}
\usepackage{etex}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{auto-pst-pdf}
\usepackage{pst-plot}
\usepackage{pst-math}
\newcommand{\polarWedge}[3]{%
\pstVerb{%
/t #1 def%
/firstX #1 57.29578 mul cos #3 mul def%
/firstY #1 57.29578 mul sin #3 mul def%
}%
\pstVerb{%
/t #2 def%
/secondX #2 57.29578 mul cos #3 mul def%
/secondY #2 57.29578 mul sin #3 mul def%
}%
\pscustom[fillcolor=cyan, fillstyle=solid, linecolor=blue]{%
\psline(0,0)(! firstX firstY)(! secondX secondY)(0,0)%
}%
}%
\newcommand{\drawPolar}[4]{%
\parametricplot[#4]{#1}{#2}{#3 t 57.29578 mul cos mul #3 t 57.29578 mul sin mul}%
}

\begin{document}
\begin{frame}
\begin{pspicture*}(-3,-1)(3.5,3.3)%
\uncover<2->{%
\polarWedge{0}{0.05}{3 t sub}%
}%
\uncover<3->{%
\polarWedge{0.05}{0.1}{3 t sub}%
}%
\uncover<4->{%
\polarWedge{0.1}{0.15}{3 t sub}%
}%
\uncover<5->{%
\polarWedge{0.15}{0.2}{3 t sub}%
}%
\uncover<6->{%
\polarWedge{0.2}{0.25}{3 t sub}%
}%
\uncover<7->{%
\polarWedge{0.25}{0.3}{3 t sub}%
}%
\uncover<8->{%
\polarWedge{0.3}{0.35}{3 t sub}%
}%
\uncover<9->{%
\polarWedge{0.35}{0.4}{3 t sub}%
}%
\drawPolar{0}{2.5}{3 t sub}{linecolor=red, plotpoints=1000}%
\end{pspicture*}
\uncover<1-10>{}
rt
\end{frame}
\end{document}

[편집] 내가 사용하는 변수는 t입니다. 함수를 전달하기 때문입니다.

3t 서브

\parametricplot을 호출하는 함수의 인수로 사용되며 parametricplot에 사용되는 변수 이름은 t입니다. 원하시면 인수가 함수인 함수를 만들고 있습니다. 물론 내 설정은 변수 "t"가 지역 변수라는 가정에 전적으로 의존합니다. 위 슬라이드가 문자 r과 t가 분리되어 있을 때 작동한다는 사실이 이것이 사실임을 뒷받침합니다. 그런데 r과 t가 나란히 있는 역할이 무엇인지는 알 수 없습니다.

[편집] 슬라이드의 최종 수정 버전입니다. Herbert의 조언(많은 감사합니다!)과 약간의 포스트스크립트 문서 읽기를 통해 수정이 이루어졌습니다.

\documentclass{beamer}
\usepackage{etex}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage{auto-pst-pdf}
\usepackage{pst-plot}
\usepackage{pst-math}
\newcommand{\polarWedge}[3]{%
\pstVerb{%
/firstX  1 dict begin /t #1 def #1 57.29578 mul cos #3 mul end def%
/firstY  1 dict begin /t #1 def #1 57.29578 mul sin #3 mul end def%
/secondX 1 dict begin /t #2 def #2 57.29578 mul cos #3 mul end def%
/secondY 1 dict begin /t #2 def #2 57.29578 mul sin #3 mul end def%
}%
\pscustom[fillcolor=cyan, fillstyle=solid, linecolor=blue]{%
\psline(0,0)(! firstX firstY)(! secondX secondY)(0,0)%
}%
}%
\newcommand{\drawPolar}[4]{%
\parametricplot[#4]{#1}{#2}{#3 t 57.29578 mul cos mul #3 t 57.29578 mul sin mul}%
}

\begin{document}
\begin{frame}
\begin{pspicture*}(-3,-1)(3.5,3.3)%
\uncover<2->{%
\polarWedge{0}{0.05}{3 t sub}%
}%
\uncover<3->{%
\polarWedge{0.05}{0.1}{3 t sub}%
}%
\uncover<4->{%
\polarWedge{0.1}{0.15}{3 t sub}%
}%
\uncover<5->{%
\polarWedge{0.15}{0.2}{3 t sub}%
}%
\uncover<6->{%
\polarWedge{0.2}{0.25}{3 t sub}%
}%
\uncover<7->{%
\polarWedge{0.25}{0.3}{3 t sub}%
}%
\uncover<8->{%
\polarWedge{0.3}{0.35}{3 t sub}%
}%
\uncover<9->{%
\polarWedge{0.35}{0.4}{3 t sub}%
}%
\drawPolar{0}{2.5}{3 t sub}{linecolor=red, plotpoints=1000}%
\end{pspicture*}
\uncover<1-10>{}
\end{frame}
\end{document}

-토도르 밀레프

답변1

당신이 무엇을 보여주고 싶은지 나에게는 전혀 명확하지 않습니다. 이미 말했듯이 은 t에 의해 내부적으로 사용되며 beamer에 의해 변수로도 사용됩니다 \psparametricplot. 그것을 재정의하는 것은 위험하다.보여주고 싶은 것을 말해보세요유용한 도움을 드릴 수 있습니다. 그러나 귀하의 예는 다음과 같습니다.

\documentclass{beamer}
\usepackage{etex}
\usepackage{pst-plot}
\usepackage{pst-math}
\newcommand\polarWedge[3]{%
  \pstVerb{/t #1 def}
  \pscustom[fillcolor=cyan,fillstyle=solid,linecolor=blue,linewidth=0.2pt]{
    \psline(0,0)(! #1 COS #3 mul #1 SIN #3 mul)
    \parametricplot{#1}{#2}{#3 t COS mul #3 t SIN mul}
    \closepath}}
\newcommand\drawPolar[4]{%
  \parametricplot[#4]{#1}{#2}{#3 t COS mul #3 t SIN mul}%
}

\begin{document}
\begin{frame}
\begin{pspicture*}(-3,-1)(3.5,3.3)%
\multido{\iA=2+1,\rA=0.00+0.05,\rB=0.05+0.05}{16}{%
  \uncover<\iA->{\polarWedge{\rA}{\rB}{3 t sub}}}%
\drawPolar{0}{2.5}{3 t sub}{linecolor=red, plotpoints=100}%
\end{pspicture*}

rt
\end{frame}
\end{document}

마지막 슬라이드의 보기는 다음과 같습니다.

여기에 이미지 설명을 입력하세요

관련 정보