Re: spazio di puntini

#94405
claudio
Partecipante
    Up
    0
    Down
    ::


    riprendo la discussione

    ho modificato il comando inserendo la possibilità di non fare nulla.
    Mi sembra che funzioni …
    è corretto?
    `
    \documentclass{book}
    \usepackage{fixltx2e}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage[italian]{babel}
    \usepackage[upright]{fourier}
    \usepackage{textcomp}
    \usepackage{amsmath}
    \usepackage{amsthm}
    \usepackage{amssymb}
    \usepackage{isomath}
    \usepackage{microtype}
    \usepackage{geometry}
    % % % % % % % % % % % % % % % % % % % % % % %
    \usepackage{calc}
    \usepackage{ifthen}
    \newboolean{puntinisi}
    \newcommand{\stampapuntini}{\setboolean{puntinisi}{true}}
    \newcommand{\nonstampapuntini}{\setboolean{puntinisi}{false}}

    \makeatletter
    \newcommand\puntini[1]{%
    \ifthenelse{\boolean{puntinisi}}{%
    \ifmmode\expandafter\@firstoftwo\else
    \expandafter\@secondoftwo\fi
    {\makebox[\widthof{$#1$}]}{\makebox[\widthof{#1}]}{\dotfill}}{#1}}
    \makeatother

    \begin{document}
    \stampapuntini
    Questa è una \puntini{prova}

    \nonstampapuntini
    Questa è una \puntini{prova}

    \stampapuntini

    Questa è una $\puntini{A+B}$
    \nonstampapuntini

    Questa è una $\puntini{A+B}$

    \end{document}
    `
    Saluti

    Go to top