This question already has an answer here:

I am new to VTEX. How can i solve this??


Output: 345.0 pt

but i have to write a macro to calculate hsize in mm example: \printdimen[mm]\hsize and if i take hsize 6.5in then what will be output in mm?

marked as duplicate by Werner, Svend Tveskæg, Przemysław Scherwentke, Malipivo, user31729 Apr 21 '15 at 16:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

% arara: pdflatex

\def\convertto#1#2{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1}
\DeclareDocumentCommand\printdimen { o m }{%

    \text{\the\hsize} &\equiv \printdimen[mm]\hsize \\
                      &\equiv \printdimen[cm]\hsize \\
                      &\equiv \printdimen[ex]\hsize \\                    
                      &\equiv \printdimen[em]\hsize \\      
                      &\equiv \printdimen[bp]\hsize \\
                      &\equiv \printdimen[dd]\hsize \\                    
                      &\equiv \printdimen[pc]\hsize \\  
                      &\equiv \printdimen[in]\hsize                                    

enter image description here

  • For VTeX...........? – jon Apr 21 '15 at 14:49
  • @jon no idea, what that is. Sorry. – LaRiFaRi Apr 21 '15 at 14:50
  • No e-TeX extensions. – jon Apr 21 '15 at 14:53
  • @LaRiFaRi i want to show output only 121.25221 mm. In that case what i have to do? whenever i use \printdimen[mm]\hsize then output ll be only 21.25221 mm "Thanks" – enadul shaheen Apr 21 '15 at 16:12
  • @enadulshaheen you get 21... when compiling my MWE? – LaRiFaRi Apr 21 '15 at 16:17

Like this?

  • like that \printdimen[mm]\hsize – enadul shaheen Apr 21 '15 at 14:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.