TeX - LaTeX Asked by Thomas Hensel on January 5, 2021
The Problem: I want to compile the figure below with TeXLive2016 compatibility. I know this is kind of outdated, but apparently it is used by arxiv. The MWE compiles with TeXLive2019, but not when I switch to TeXLive2016 (e.g. on Overleaf, where you can easily change the TeXLive version). I have located the error to be caused by the xtick definition in the axis environment. Somehow, the macros are not correctly parsed here, while they are perfectly well parsed everywhere else.
The error that is thrown is:
! Package PGF Math Error: Could not parse input ‘0.7+1.0’ as a floating point n
umber, sorry. The unreadable part was near ‘+1.0’..
See the PGF Math package documentation for explanation.
Type H for immediate help.
…
l.49 end{axis}
What I’ve tried:
FPeval
pgfmathparse
in combination with pgfmathresult
-> not available in TeXLive2016Related Questions: Here is, what I think are related questions to my problem, although I have not been able to distill an answer from that.
MWE:
documentclass[preview]{standalone}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{graphics}
%
usepackage{tikz}%drawings like geometries
usetikzlibrary{calc,matrix,positioning}
usetikzlibrary{decorations.pathmorphing}
%
usepackage{pgfplots}
pgfplotsset{
,compat=1.12
}
%----------------------------------------
begin{document}
%
begin{figure}[ht]
centering
begin{tikzpicture}
%Define Parameters
newcommandtmin{0.7}
newcommand{dtmax}{dtstart}
newcommand{dtstart}{1.0}
newcommand{T}{2.0}
newcommand{zmin}{3.0}
newcommand{dvstart}{0.8}
newcommand{vstart}{1.0}
newcommand{zmax}{9.0}
newcommand{g}{0.6}
newcommand{keff}{1.0}
%
begin{axis}[
xlabel={t}, xlabel style={at={(1,0)}, anchor=west},
ylabel={z (m)}, ylabel style={rotate=-90,at={(0,1)}, anchor=south},
xmin=0.0, xmax=tmin+dtstart+2*T+2*dtmax,
xtick={0,tmin,tmin+dtstart,tmin+dtstart+T,tmin+dtstart+T+T,tmin+dtstart+T+T+dtmax},%
xticklabels={$0$,$t_{start}$,$t_0$,$t_0+T$,$t_0+2T$,$t_{end}$},%
ymin=0, ymax=zmax,
axis lines = left,
y=1.cm,
x=1.cm,
ytick={0,1,...,12},
legend pos=north west,
%grid=both,
ymajorgrids=true,
grid style=dashed,
]
end{axis}
%Laserbeams
draw[decorate, decoration = snake, very thick, red, opacity=0.5]
({tmin + dtstart},0) to ({tmin + dtstart},{.9*zmax}) node[above] {$pi/2$};
draw[decorate, decoration = snake, very thick, red, opacity=0.5,]
({tmin + dtstart+T},0) to ({tmin + dtstart + T},{.9*zmax}) node[above] {$pi$};
draw[decorate, decoration = snake, very thick, red, opacity=0.5,]
({tmin + dtstart + 2*T},0) to ({tmin + dtstart + 2*T},{.9*zmax}) node[above] {$pi/2$};
end{tikzpicture}
end{figure}
end{document}
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP