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 write a little script to draw a line with a Gaussian pulse. I define some commands (\verticalSpace, \HorizontalSpace and so on) to parametrize the figure. In particular, I define \length to set a certain space that I have to leave. \length does not have any restriction, or at least I cannot find them, but I set

\newcommand{\length}{1.0}

it works, but it doesn't if I set

\newcommand{\length}{1}

Can anyone understand why?

Here's the code

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,arrows,positioning}

\begin{document}

\newcommand{\verticalSpace}{1}
\newcommand{\HorizontalSpace}{5}
\newcommand{\length}{1} % HERE! with 1 it does not work, but it does with 1.0
\newcommand{\Ox}{.5}
\newcommand{\Oy}{0}
\newcommand{\pulse}{plot[domain=-\length/2:\length/2,samples=100] function{exp(-20*x*x)/2}}
\begin{figure}
\centering
\begin{tikzpicture}[scale=1]
  \tikzstyle{linea}=[line width=1pt]
  \tikzstyle{riempimento}=[fillstyle=gradient,gradangle=0,gradbegin=white,gradend=white,gradmidpoint=1.0]
  %
  \path (\Ox-1*\length,\Oy+0.3) node {$x$};
  \filldraw[shift={(\Ox+.5+3*\length+\length/2,\Oy)},linea,draw=blue,top color=blue,shading=axis,shading angle=0] plot[domain=-\length/2:\length/2,samples=100] function{exp(-20*x*x)/2};%\pulse;
  \draw[->,linea] (\Ox , \Oy) -- (\Ox+\HorizontalSpace,\Oy);
 \end{tikzpicture}
\end{figure}

\end{document}

Here's the content of the log file I get adding \listfiles in the preamble.

This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (preloaded format=latex 2011.11.19)  6 MAY 2013 13:27
entering extended mode
**D:/work/PPM/paper/dummy.tex
(D:/work/PPM/paper/dummy.tex
LaTeX2e <2005/12/01>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, loaded.
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\frontendlayer\tikz.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\basiclayer\pgf.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\utilities\pgfrcs.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfutil-common.te
x"
\pgfutil@everybye=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfutil-latex.def
"
\pgfutil@abb=\box26
 ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\ms\everyshi.sty"
Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfrcs.code.tex"
Package: pgfrcs 2010/10/25 v2.10 (rcs-revision 1.24)
))
Package: pgf 2008/01/15 v2.10 (rcs-revision 1.12)
 ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\basiclayer\pgfcore.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks15
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: dvips.def on input line 91.

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\dvips.def"
File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\systemlayer\pgfsys.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgfsys.code.tex
"
Package: pgfsys 2010/06/30 v2.10 (rcs-revision 1.37)
 ("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfkeys.code.tex
"
\pgfkeys@pathtoks=\toks16
\pgfkeys@temptoks=\toks17

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfkeysfiltered.c
ode.tex"
\pgfkeys@tmptoks=\toks18
))
\pgf@x=\dimen105
\pgf@y=\dimen106
\pgf@xa=\dimen107
\pgf@ya=\dimen108
\pgf@xb=\dimen109
\pgf@yb=\dimen110
\pgf@xc=\dimen111
\pgf@yc=\dimen112
\w@pgf@writea=\write3
\r@pgf@reada=\read1
\c@pgf@counta=\count87
\c@pgf@countb=\count88
\c@pgf@countc=\count89
\c@pgf@countd=\count90

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgf.cfg"
File: pgf.cfg 2008/05/14  (rcs-revision 1.7)
)
Package pgfsys Info: Driver file for pgf: pgfsys-dvips.def on input line 900.

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgfsys-dvips.de
f"
File: pgfsys-dvips.def 2008/04/03  (rcs-revision 1.20)

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgfsys-common-p
ostscript.def"
File: pgfsys-common-postscript.def 2008/10/01  (rcs-revision 1.22)
\pgf@objectcount=\count91
)))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgfsyssoftpath.
code.tex"
File: pgfsyssoftpath.code.tex 2008/07/18  (rcs-revision 1.7)
\pgfsyssoftpath@smallbuffer@items=\count92
\pgfsyssoftpath@bigbuffer@items=\count93
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\systemlayer\pgfsysprotocol.
code.tex"
File: pgfsysprotocol.code.tex 2006/10/16  (rcs-revision 1.4)
)) ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\xcolor\xcolor.sty"
Package: xcolor 2007/01/21 v2.11 LaTeX color extensions (UK)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package xcolor Info: Driver file: dvips.def on input line 225.
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1337.
Package xcolor Info: Model `RGB' extended on input line 1353.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1355.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1356.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1357.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1358.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1359.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1360.
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcore.code.tex
"
Package: pgfcore 2010/04/11 v2.10 (rcs-revision 1.7)
 ("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmath.code.tex"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathcalc.code.tex"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathutil.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathparser.code.tex
"
\pgfmath@dimen=\dimen113
\pgfmath@count=\count94
\pgfmath@box=\box27
\pgfmath@toks=\toks19
\pgfmath@stack@operand=\toks20
\pgfmath@stack@operation=\toks21
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.code.
tex"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.basic
.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.trigo
nometric.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.rando
m.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.compa
rison.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.base.
code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.round
.code.tex")
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfunctions.misc.
code.tex")))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\math\pgfmathfloat.code.tex"
\c@pgfmathroundto@lastzeros=\count95
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorepoints.co
de.tex"
File: pgfcorepoints.code.tex 2010/04/09  (rcs-revision 1.20)
\pgf@picminx=\dimen114
\pgf@picmaxx=\dimen115
\pgf@picminy=\dimen116
\pgf@picmaxy=\dimen117
\pgf@pathminx=\dimen118
\pgf@pathmaxx=\dimen119
\pgf@pathminy=\dimen120
\pgf@pathmaxy=\dimen121
\pgf@xx=\dimen122
\pgf@xy=\dimen123
\pgf@yx=\dimen124
\pgf@yy=\dimen125
\pgf@zx=\dimen126
\pgf@zy=\dimen127
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorepathconst
ruct.code.tex"
File: pgfcorepathconstruct.code.tex 2010/08/03  (rcs-revision 1.24)
\pgf@path@lastx=\dimen128
\pgf@path@lasty=\dimen129
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorepathusage
.code.tex"
File: pgfcorepathusage.code.tex 2008/04/22  (rcs-revision 1.12)
\pgf@shorten@end@additional=\dimen130
\pgf@shorten@start@additional=\dimen131
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorescopes.co
de.tex"
File: pgfcorescopes.code.tex 2010/09/08  (rcs-revision 1.34)
\pgfpic=\box28
\pgf@hbox=\box29
\pgf@layerbox@main=\box30
\pgf@picture@serial@count=\count96
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoregraphicst
ate.code.tex"
File: pgfcoregraphicstate.code.tex 2008/04/22  (rcs-revision 1.9)
\pgflinewidth=\dimen132
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoretransform
ations.code.tex"
File: pgfcoretransformations.code.tex 2009/06/10  (rcs-revision 1.11)
\pgf@pt@x=\dimen133
\pgf@pt@y=\dimen134
\pgf@pt@temp=\dimen135
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorequick.cod
e.tex"
File: pgfcorequick.code.tex 2008/10/09  (rcs-revision 1.3)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoreobjects.c
ode.tex"
File: pgfcoreobjects.code.tex 2006/10/11  (rcs-revision 1.2)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorepathproce
ssing.code.tex"
File: pgfcorepathprocessing.code.tex 2008/10/09  (rcs-revision 1.8)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorearrows.co
de.tex"
File: pgfcorearrows.code.tex 2008/04/23  (rcs-revision 1.11)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoreshade.cod
e.tex"
File: pgfcoreshade.code.tex 2008/11/23  (rcs-revision 1.13)
\pgf@max=\dimen136
\pgf@sys@shading@range@num=\count97
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoreimage.cod
e.tex"
File: pgfcoreimage.code.tex 2010/03/25  (rcs-revision 1.16)

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoreexternal.
code.tex"
File: pgfcoreexternal.code.tex 2010/09/01  (rcs-revision 1.17)
\pgfexternal@startupbox=\box31
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorelayers.co
de.tex"
File: pgfcorelayers.code.tex 2010/08/27  (rcs-revision 1.2)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcoretranspare
ncy.code.tex"
File: pgfcoretransparency.code.tex 2008/01/17  (rcs-revision 1.2)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\basiclayer\pgfcorepatterns.
code.tex"
File: pgfcorepatterns.code.tex 2009/07/02  (rcs-revision 1.3)
)))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\modules\pgfmoduleshapes.cod
e.tex"
File: pgfmoduleshapes.code.tex 2010/09/09  (rcs-revision 1.13)
\pgfnodeparttextbox=\box32
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\modules\pgfmoduleplot.code.
tex"
File: pgfmoduleplot.code.tex 2010/10/22  (rcs-revision 1.8)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\compatibility\pgfcomp-version
-0-65.sty"
Package: pgfcomp-version-0-65 2007/07/03 v2.10 (rcs-revision 1.7)
\pgf@nodesepstart=\dimen137
\pgf@nodesepend=\dimen138
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\compatibility\pgfcomp-version
-1-18.sty"
Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\utilities\pgffor.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pgf\utilities\pgfkeys.sty"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgfkeys.code.tex"
)) ("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\utilities\pgffor.code.te
x"
Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18)
\pgffor@iter=\dimen139
\pgffor@skip=\dimen140
\pgffor@stack=\toks22
\pgffor@toks=\toks23
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\frontendlayer\tikz\tikz.cod
e.tex"
Package: tikz 2010/10/13 v2.10 (rcs-revision 1.76)

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\libraries\pgflibraryplothan
dlers.code.tex"
File: pgflibraryplothandlers.code.tex 2010/05/31 v2.10 (rcs-revision 1.15)
\pgf@plot@mark@count=\count98
\pgfplotmarksize=\dimen141
)
\tikz@lastx=\dimen142
\tikz@lasty=\dimen143
\tikz@lastxsaved=\dimen144
\tikz@lastysaved=\dimen145
\tikzleveldistance=\dimen146
\tikzsiblingdistance=\dimen147
\tikz@figbox=\box33
\tikz@tempbox=\box34
\tikztreelevel=\count99
\tikznumberofchildren=\count100
\tikznumberofcurrentchild=\count101
\tikz@fig@count=\count102

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\modules\pgfmodulematrix.cod
e.tex"
File: pgfmodulematrix.code.tex 2010/08/24  (rcs-revision 1.4)
\pgfmatrixcurrentrow=\count103
\pgfmatrixcurrentcolumn=\count104
\pgf@matrix@numberofcolumns=\count105
)
\tikz@expandcount=\count106

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\frontendlayer\tikz\librarie
s\tikzlibrarytopaths.code.tex"
File: tikzlibrarytopaths.code.tex 2008/06/17 v2.10 (rcs-revision 1.2)
)))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\frontendlayer\tikz\librarie
s\tikzlibraryintersections.code.tex"
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\libraries\pgflibraryinterse
ctions.code.tex"
\pgf@intersect@solutions=\count107
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\frontendlayer\tikz\librarie
s\tikzlibraryarrows.code.tex"
File: tikzlibraryarrows.code.tex 2008/01/09 v2.10 (rcs-revision 1.1)

("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\libraries\pgflibraryarrows.
code.tex"
File: pgflibraryarrows.code.tex 2008/10/27 v2.10 (rcs-revision 1.9)
\arrowsize=\dimen148
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\generic\pgf\frontendlayer\tikz\librarie
s\tikzlibrarypositioning.code.tex"
File: tikzlibrarypositioning.code.tex 2008/10/06 v2.10 (rcs-revision 1.7)
) (D:\work\PPM\paper\dummy.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.

ABD: EveryShipout initializing macros
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 21.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 21.


Package pgfshade Warning: No path specified that can be filled on input line 22
.

[1] (D:\work\PPM\paper\dummy.aux)

 *File List*
 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    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
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    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
   dvips.def    1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
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 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty    
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
 ***********

 ) 
Here is how much of TeX's memory you used:
 9254 strings out of 495286
 185626 string characters out of 3179897
 222187 words of memory out of 3000000
 12310 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 14 hyphenation exceptions out of 8191
 56i,5n,55p,463b,601s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on dummy.dvi (1 page, 4352 bytes).
share|improve this question
1  
Some sort of Integer/Float parameter effect? What happens with \newcommand{\length}{1.0}? What happens if ...domain=-\length/2.0:\length/2.0,? –  rickhg12hs May 5 '13 at 21:57
1  
Please rephrase the title and add also regarding information into your question: What application refer the numbers to? What works with the lower version? And please start with “Why does … work with …?” –  Speravir May 5 '13 at 22:06
6  
It works with both 1. and 1.0 –  Alan Munn May 5 '13 at 22:38
1  
I can confirm Alan Munn's comment. Perhaps you are using outdated version of PGF/TikZ? –  Gonzalo Medina May 5 '13 at 22:46
1  
Try also putting braces around it, {\length/2} but it's surely a version problem. You have MikTeX 2.8 which is almost archaic compared to v2.9. –  percusse May 6 '13 at 17:22

1 Answer 1

up vote 3 down vote accepted

Quoting http://www.manpagez.com/info/gnuplot/gnuplot-4.4.0/gnuplot_21.php, "...gnuplot uses both "real" and "integer" arithmetic... The most important difference between the two forms is in division: division of integers truncates: 5/2 = 2..."

The problem is thus the line

domain=-\length/2:\length/2

that in the case of \length equal to 1 becomes

domain=-0:0

and hence nothing is plotted, while with \length equal to 1.0 becomes the expected

domain=-0.5:0.5
share|improve this answer

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.