Dear all,On the caves’ survey I draw, I am often adding the altitude of points that are characteristic in the cave by using the point « altitude ». I find that really great and I want to keep it.
However, I received several remarks from my co-cavers/surveyors that this is not quite readable, and that they would prefer if I can also add the depth since the entrance at those points. I can do it manually with the point label, but for a complex system, that will be a pain to maintain each time we add a new survey or a connection with an other cave previously unconnected.
I thus tried to add a new user defined point (u:prof) based on the present altitude definition. However I am really not a mpost guru and I am facing two problems. Here is the code I wrote :
###### New point depth ######
code metapost
def p_u_prof (expr pos, R, S, A) =
T:=identity aligned A scaled 1.5S rotated R shifted pos;
# calcul of the depth of the point: altitude of the point - altitude max of the cave
# (it will be better with the altitude of the main entrance
# defined by the option -entrance of the survey block)
depth := \thaltitude - \cavemaxz;
# Print the label
begingroup
interim defaultscale:=1;
label (btex {-- } depth {m --} etex, (0, 0)) transformed T withcolor(0.5,0.,0.);
# 1) Why is profondeur value NOT printed ? Where is the error ?
endgroup;
enddef;
initsymbol("p_u_prof")
endcode
The problem is that this point will print the text "-- depth m --", but not the value of the depth. I suspect that :