Re: \textwidth

#18514
DMW
    Up
    0
    Down
    ::


    Ti è stato già detto che non puoi mettere lunghezze, ma numeri puri, e tu ci rimetti \unitl che è una lunghezza?

    Devi rendere \unitl un numero puro mediante \strip@pt.
    `
    \makeatletter
    \newcommand{\textwidthfactor}{\strip@pt\textwidth}
    \newlength{\unitl}
    \setlength{\unitl}{.5\textwidth}
    \newcommand{\stripunitl}{\strip@pt\unitl}
    \makeatother

    \begin{document}

    \setlength{\unitlength}{1pt}
    \begin{picture}(\textwidthfactor,\textwidthfactor)
    \put(0,0){\line(0,1){\textwidthfactor}}
    \put(0,0){\line(1,0){\stripunitl}}
    \end{picture}
    \end{document}`

    Ho hanche cambiato l’esempio così si vede meglio.

    Ciao

    Andrea

    Go to top