
(Soy nuevo en LaTeX). Estoy intentando imprimir una longitud en centímetros. Aquí está mi código:
\documentclass{article}
\begin{document}
\newdimen\mylength
\mylength=1in
\the\mylength
\end{document}
Y aquí está el resultado resultante:
72,27 puntos
Sin embargo, quiero mostrar el resultado en centímetros: Ejemplo: \the dimen [cm]\mylength. ¿Cómo puedo hacer eso?
Respuesta1
Puedes usar el\convertto
macro desdeLa publicación de Philippe Goutet:
\documentclass{article}
\makeatletter
\def\convertto#1#2{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1}
\makeatother
\begin{document}
\newdimen\mylength
\mylength=1in
\convertto{cm}{\the\mylength} cm
\end{document}
Producción:
2,54 cm