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.

The code from TikZ: automatic line breaking in equal distances worked but I noticed today it isn't producing the same results. The lines aren't overlaying any more.

Here are the results from \listfiles

 *File List*
standalone.cls    2012/09/15 v1.1b Class to compile TeX sub-files standalone
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
 xkeyval.sty    2012/10/14 v2.6b package option processing (HA)
 xkeyval.tex    2012/10/14 v2.6b key=value parser (HA)
standalone.cfg    2012/09/15 v1.1b Default configuration file for 'standalone' 
class
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
inputenx.sty    2011/05/27 v1.10 Enhanced input encoding handling (HO)
ix-alias.def    2011/05/27 v1.10 Alias list (inputenx)
inputenc.sty    2008/03/30 v1.1d Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  helvet.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
 courier.sty    2005/04/12 PSNFSS-v9.2a (WaS) 
 eulervm.sty    2005/01/11 v4.0 (WaS)
  ot1ppl.fd    2001/06/04 font definitions for OT1/ppl.
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
   t1ppl.fd    2001/06/04 font definitions for T1/ppl.
textcomp.sty    2005/09/27 v1.99g Standard LaTeX package
  ts1enc.def    2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file
  ts1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ts1cmr.fd    1999/05/25 v2.5h Standard LaTeX font definitions
supp-pdf.mkii
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live

And here is the code I am using:

\documentclass[tikz]{standalone}%
% Ensure we are not overriding any existing macro
\newcommand*{\DeltaAngle}{}
\newcommand*{\CurrentStartAngle}{}
\newcommand*{\CurrentEndAngle}{}
\newcommand*{\SegmentedArc}[5][]{%
  % #1 = draw options
  % #2 = number of segments
  % #3 = arc start angle
  % #4 = arc end angle
  % #5 = radius
  \draw[thin, gray] (#5, 0) arc[radius = #5, start angle = #3, end angle = #4];
  % 
  \pgfmathsetmacro{\DeltaAngle}{(#4 - #3)/#2}%
  \foreach \x in {1, ..., #2} {%
    \pgfmathsetmacro{\CurrentStartAngle}{#3 + (\x - 1)*\DeltaAngle}%
    \pgfmathsetmacro{\CurrentEndAngle}{\CurrentStartAngle + \DeltaAngle}%
    \typeout{\string\CurrentStartAngle = \CurrentStartAngle,
      \string\CurrentEndAngle = \CurrentEndAngle}%
    \draw[#1] (\CurrentStartAngle: #5cm) -- (\CurrentEndAngle: #5cm);
  }%
}%
\listfiles
\begin{document}
\begin{tikzpicture}
  \SegmentedArc[thin, red]{4}{20}{100}{2}
\end{tikzpicture}
\end{document}

Here is the image it produces now:

enter image description here

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

There is a bug in the code in your question (you copied it wrong, it's correct in the answer you linked to): It should be

\draw[thin, gray] (#3:#5) arc[radius = #5, start angle = #3, end angle = #4];

instead of

\draw[thin, gray] (#5, 0) arc[radius = #5, start angle = #3, end angle = #4];

Your version only works if your starting angle happens to be 0.

share|improve this answer
    
That is strange though because back when I asked it, that was the code I used and it worked before. –  dustin May 17 at 17:55
    
@dustin: The code was changed on April 23 to correct that error. –  Jake May 17 at 17:56
1  
@dustin: If you see in the comments I added a note that I had changed the code for non-zero start angle. –  Peter Grill May 17 at 17:56
1  
@PeterGrill Okay thanks and Jake. –  dustin May 17 at 17:58
add comment

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.