1

For my example \pscirclebox doesn't align right and the circled object is way too high. See the MWE:

\documentclass{minimal}
\usepackage{pstricks,auto-pst-pdf}

\begin{document}

$$a\pscirclebox{=}b$$

a\pscirclebox{=}b

\end{document}

Is there a cure?

3
  • 1
    It could be a good idea, if you could try your example first at yourself ... – user2478 Jan 3 '19 at 16:00
  • +1 for that. Sorry, Herbert. Now it's a working example. BTW, I've updated my distribution (TeXlive on macOS) today. – Michael Hoppe Jan 3 '19 at 16:35
  • @MichaelHoppe Hi, why you use double signs dollar instead of \[...\]? – Sebastiano Jan 3 '19 at 20:03
3

auto-pst-pdf looks for an pspicture environment for the correct cropping of the created image which has always no depth. Use xelatex without auto-pst-pdf or tell auto-pst-pdf that there is some PostScript stuff:

\documentclass{minimal}
\usepackage{pstricks,auto-pst-pdf}
\newcommand\kreisel[1]{\pscirclebox{#1}}
\newcommand\ps[1]{\begin{postscript}$#1$\end{postscript}}

\begin{document}
    \[
    \begin{postscript}$a\pscirclebox{=}b$\end{postscript}
    \]

    \centering
    \begin{postscript}
        a\pscirclebox{=}b   
    \end{postscript}

\ps{y=a+b\kreisel{x^2}}

\end{document}

enter image description here

4
  • Thanks a lot. But my goal is to circle some objects like \ln(y) in running text (for some obscure reasons), like "bla blub \kreisel{\ln(y)} blabber". At the moment I'm using \def\kreisel#1{\raisebox{-1ex}{\pscirclebox[framesep=0pt]{#1}}} – Michael Hoppe Jan 3 '19 at 18:20
  • That makes no difference. Inside the postscript environment you have to reactivate the math mode. thats all ... – user2478 Jan 3 '19 at 18:26
  • Excuse me for my dull example. Hasn't few to do with mathmode. I would like to have a macro which works like \textcircled, but with the circle's size being adequate. Always starting a postscript environment seems too annoying for me. Just want to write [y=a+b\kreisel{$x^2$}]. – Michael Hoppe Jan 3 '19 at 18:34
  • see edieted answer – user2478 Jan 3 '19 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.