Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following Example:

    \documentclass{article}
    \usepackage{auto-pst-pdf}
    \newcommand{\directionFieldOneTangent}[2]{
       \pstVerb{%
          /aaaaaaaaa #1 \space def 
        }%
    \pscircle*[linecolor=red!60]( #1, #2){0.2}
    }
    \begin{document}
    \begin{pspicture}(-2.7,-2.7)(2.7,2.7)
    \directionFieldOneTangent{0}{0}

    \directionFieldOneTangent{0}{0}
    \end{pspicture}
    \end{document}

Now the same example, with one empty line removed:

    \documentclass{article}
    \usepackage{auto-pst-pdf}
    \newcommand{\directionFieldOneTangent}[2]{
       \pstVerb{%
          /aaaaaaaaa #1 \space def 
        }%
    \pscircle*[linecolor=red!60]( #1, #2){0.2}
    }
    \begin{document}
    \begin{pspicture}(-2.7,-2.7)(2.7,2.7)
    \directionFieldOneTangent{0}{0}
    \directionFieldOneTangent{0}{0}
    \end{pspicture}
    \end{document}

The first file produces the output in the first pdf file: the two points do not coincide. Where should I report this bug, how can that be fixed, what is the issue?

Buggy image

Displays correctly

share|improve this question
1  
It's not clear that it is necessarily a bug. A blank line is a \par command and the expected behaviour of \par is to inject vertical space. Perhaps a feature request that it be locally defined not to do that, but no package can make all incorrect input safe. –  David Carlisle Mar 12 at 17:46

1 Answer 1

up vote 4 down vote accepted
  1. As far as I know, any blank lines in pspicture will be ignored.
  2. Any trailing whitespace after the opening curly brace of \newcommand{\<macroname>} must be removed by using %.
  3. Any trailing whitespace after the closing curly brace of \pstVerb must be removed by using %.

So there is no bug because they are all well-known facts.

\newcommand{\directionFieldOneTangent}[2]{%<============= You have to kill the whitespace!
   \pstVerb{%
      /aaaaaaaaa #1 \space def 
    }%
\pscircle*[linecolor=red!60]( #1, #2){0.2}
}
share|improve this answer
1  
it wouldn't hurt to add a % after 0.2} as well –  David Carlisle Mar 12 at 17:46
    
Thanks a lot for the answer! That resolves the issue. I follow all your % advice. As far as calling this behavior a bug... I like to stir up some controversy! When white space causes such drastic and difficult to predict changes, some controversial statements are deserved (If I were to design LaTeX/pstricks, I'd avoid such shady syntax behavior of the white space). –  user39417 Mar 13 at 4:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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