I am trying to store the figure height and width into a separate file, for this I write the code (please excuse me, if these are not in a standard method) as below:










  \write\imgdetail{\figurename\space\thefigure, Page \thepage, #2}%




Everything works fine, but the figure height doesn't come correct, the output was:

Figure 0, Page 1, gr1.eps
height=\def cm{pt}0.0pt

Can you advise what I did wrong in this?

  • First of always post full minimal examples that others can just copy and test as is. Here we have to add a lot of code to even figure out what yours does. – daleif Jul 2 '19 at 9:46
  • @daleif Updated now... – MadyYuvi Jul 2 '19 at 9:52
  • 1
    Use \immediate\write else the writing is delayed to page shipout (???) and this gets confusing when paired with a float – daleif Jul 2 '19 at 10:33
  • @daleif Yes, your suggestion works in a good manner, now the output came as height=\def cm{pt}140.525pt, just the text \def cm{pt} doesn't need, how can I fix this? – MadyYuvi Jul 2 '19 at 10:43
  • You should not use \printlength to write to disk, it is for formatting and printing to the PDF, you'll need to figure something else out, sorry cannot help you on that one. Why do you need this anyway? (the logging of the images? ) – daleif Jul 2 '19 at 10:47