0

What does it mean if a lenght is set to, for instance, length=3pt 2? I noticed it's not the same as lenght=3.2pt...

I'm sorry to ask such a trivial question, but I looked here and there, and I didn't find any information about that.

Thanks in advance!

3
  • 8
    Can you give a complete example, please?
    – mickep
    Commented Jun 6 at 11:13
  • 8
    In normal TeX 3pt 2 is not a length, TeX's parser would stop reading at the space after pt and the parsed length would be 3pt and there would be a trailing 2 (which would be output). If this is valid syntax it is implemented by some package, so a complete example showing your usage of 3pt 2 is crucial for an answer.
    – Skillmon
    Commented Jun 6 at 11:33
  • Downvoted and voted for closing, sorry. You've had plenty of time to give context instead of writing a self-answer without bothering to fix the question.
    – egreg
    Commented Jun 7 at 10:29

3 Answers 3

7

EDIT It turns out my crystal ball isn't quite as good as it claims. The OP is not using pgf, but pstricks. However, as it happens, the length specifications for arrows work the same way in both packages, so this answer still applies. (See Garulfo's answer below.)

Experiment 108(a)(i): Crystal Ball v.5.06

If this is an arrow tip in a TikZ picture, length=3pt 2 means that the length of the tip will be 3pt + 2w where w is the width of the line. See page 193 of the pgf/tikz manual for details. In particular, note that a third factor may be specified in the case of double.

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
  \foreach \i in {0,1,2} \draw [line width=1pt,-{Latex[length=5pt \i]}] (0,{-\i/5}) -- ++(2cm,0pt) ;
\end{tikzpicture}
\end{document}

effect of different line factors

3
  • 2
    +1 but I have a comment: is not Crystal Ball v5.06, this is at least v\infty^3.
    – campa
    Commented Jun 6 at 20:28
  • 1
    @campa Maybe a bug? 'Crystal Ball predicts own version incorrectly [regression]'?
    – cfr
    Commented Jun 6 at 20:54
  • @campa They need to bug-fix this model anyway - see Garulfo's answer below. I'm sure I passed it the --all flag. Unfortunately, all bug reports are pre-closed WILL WORK FOR ME.
    – cfr
    Commented Jun 7 at 23:48
1
\documentclass{article}

\begin{document}

X\parskip=3pt 2X

\end{document}

Produces no warnings and outputs

enter image description here

The length assignment is terminated by the space after 3pt (and the space is consumed and makes no space in the output). Then the 2 like the X is just character data typeset in the current font.

I added the X here just to make it clear that no white space is being added, without them you would just get the 2 typeset.

1

Oh, I found out in the PSTricks User's Guide of 2007: it's specific for arrows. Here the description of the Guide:

<<arrowsize=dim ‘num’
Default: 1.5pt 2
The width of arrowheads is dim plus num times linewidth (if the optional ‘num’ is inclued). See the diagram below.>>

I'm deeply sorry for having bothered you with this... Thanks a lot for your answers! :-)

3
  • 1
    Thanks for the precision. Maybe it would be best to add it directly inside your question.
    – jlab
    Commented Jun 7 at 11:05
  • 1
    @jlab Although there wouldn't be a question in that case. But I wonder if Garulfo would allow me to add a note to my answer saying it works the same way in pstricks? Then people using pstricks wouldn't immediately dismiss this thread as irrelevant because it concerns tikz?
    – cfr
    Commented Jun 7 at 23:45
  • 1
    @cfr Sorry I didn't read this post again since one month. Of course you can add a note as you suggest, it's a good idea.
    – Garulfo
    Commented Jul 8 at 14:34

Not the answer you're looking for? Browse other questions tagged .