Ambiente list

  • Creatore
    Topic
  • #17497
    Up
    0
    Down
    ::


    Per dei motivi particolari sono costretto ad usare l’ambiente list (devo controllare manualmente la numerazione) e ho bisogno di indentare alcuni punti più degli altri. Cercando e scavando sono riuscito a fare in modo da riuscire ad aumentare l’indentatura della prima riga di un item, ma se il testo è parecchio viene vanificato. Vi faccio un esempio così ci capiamo meglio:
    `
    \documentclass{minimal}

    \usepackage[italian]{babel}

    \newcounter{line}
    \setcounter{line}{0}

    \newcommand{\aumind}{\addtolength{\itemindent}{\parindent}\addtolength{\labelsep}{\parindent}}
    \newcommand{\dimind}{\addtolength{\itemindent}{-\parindent}\addtolength{\labelsep}{-\parindent}}

    \begin{document}
    \makeatletter
    \begin{list}{\small \arabic{line}}{%
    \topsep\z@%
    \itemsep\z@ \labelsep 0.6em \itemindent\z@ \listparindent 2em%
    \partopsep\z@ \parskip\z@ \parsep\z@%
    \labelwidth 1.2em%
    \leftmargin\labelwidth \addtolength{\leftmargin}{\labelsep}%
    }
    \makeatother
    \stepcounter{line}
    \item[\arabic{line}] a b c d e f g h i l m n o p q r s t u v z a b c d e f g
    h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
    c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
    u v z a b c d e f g h i l m n o p q r s t u v z
    \aumind
    \stepcounter{line}
    \item[\arabic{line}]a b c d e f g h i l m n o p q r s t u v z a b c d e f g
    h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
    c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
    u v z a b c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o
    p q r s t u v z
    \end{list}
    \end{document}
    `

    Se guardate l’item 1 è ok, anche l’indentazione della prima riga dell’item 2, il punto è che però vorrei che tutto l’item 2 abbia quella indentazione.

    Scusate se sono stato confuso… mi avete capito?
    Grazie in anticipo!

Visualizzazione 2 filoni di risposte
  • Autore
    Risposte
    • #17498
      DMW
        Up
        0
        Down
        ::

        Per dei motivi particolari sono costretto ad usare l’ambiente list (devo controllare manualmente la numerazione) e ho bisogno di indentare alcuni punti più degli altri. Cercando e scavando sono riuscito a fare in modo da riuscire ad aumentare l’indentatura della prima riga di un item, ma se il testo è parecchio viene vanificato. Vi faccio un esempio così ci capiamo meglio:
        `
        \documentclass{minimal}

        \usepackage[italian]{babel}

        \newcounter{line}
        \setcounter{line}{0}

        \newcommand{\aumind}{\addtolength{\itemindent}{\parindent}\addtolength{\labelsep}{\parindent}}
        \newcommand{\dimind}{\addtolength{\itemindent}{-\parindent}\addtolength{\labelsep}{-\parindent}}

        \begin{document}
        \makeatletter
        \begin{list}{\small \arabic{line}}{%
        \topsep\z@%
        \itemsep\z@ \labelsep 0.6em \itemindent\z@ \listparindent 2em%
        \partopsep\z@ \parskip\z@ \parsep\z@%
        \labelwidth 1.2em%
        \leftmargin\labelwidth \addtolength{\leftmargin}{\labelsep}%
        }
        \makeatother
        \stepcounter{line}
        \item[\arabic{line}] a b c d e f g h i l m n o p q r s t u v z a b c d e f g
        h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
        c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
        u v z a b c d e f g h i l m n o p q r s t u v z
        \aumind
        \stepcounter{line}
        \item[\arabic{line}]a b c d e f g h i l m n o p q r s t u v z a b c d e f g
        h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
        c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
        u v z a b c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o
        p q r s t u v z
        \end{list}
        \end{document}
        `

        Se guardate l’item 1 è ok, anche l’indentazione della prima riga dell’item 2, il punto è che però vorrei che tutto l’item 2 abbia quella indentazione.

        Scusate se sono stato confuso… mi avete capito?
        Grazie in anticipo!

        Questo è un problema che secondo me non si può risolvere perché devi modificare \leftmargin localmente e non si può fare; è un problema analogo a questo
        http://www.guit.sssup.it/phpbb/viewtopic.php?t=3164

        Perché non usi enumitem? Fa quello che cerchi ed altro ancora.

        Ciao

        Andrea

      • #17499
        Up
        0
        Down
        ::


        ma da quel che vedo enumitem usa comunque le liste indentate… a me deve essere un’unica lista, con una singola numerazione con indentazioni diverse…

        tu sapresti ottenerla con enumitem?

      • #17500
        Up
        0
        Down
        ::

        Per dei motivi particolari sono costretto ad usare l’ambiente list (devo controllare manualmente la numerazione) e ho bisogno di indentare alcuni punti più degli altri. Cercando e scavando sono riuscito a fare in modo da riuscire ad aumentare l’indentatura della prima riga di un item, ma se il testo è parecchio viene vanificato. Vi faccio un esempio così ci capiamo meglio:
        `\documentclass{minimal}

        \usepackage[italian]{babel}

        \newcounter{line}
        \setcounter{line}{0}

        \newcommand{\aumind}{\addtolength{\itemindent}{\parindent}\addtolength{\labelsep}{\parindent}}
        \newcommand{\dimind}{\addtolength{\itemindent}{-\parindent}\addtolength{\labelsep}{-\parindent}}

        \begin{document}
        \makeatletter
        \begin{list}{\small \arabic{line}}{%
        \topsep\z@%
        \itemsep\z@ \labelsep 0.6em \itemindent\z@ \listparindent 2em%
        \partopsep\z@ \parskip\z@ \parsep\z@%
        \labelwidth 1.2em%
        \leftmargin\labelwidth \addtolength{\leftmargin}{\labelsep}%
        }
        \makeatother
        \stepcounter{line}
        \item[\arabic{line}] a b c d e f g h i l m n o p q r s t u v z a b c d e f g
        h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
        c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
        u v z a b c d e f g h i l m n o p q r s t u v z
        \aumind
        \stepcounter{line}
        \item[\arabic{line}]a b c d e f g h i l m n o p q r s t u v z a b c d e f g
        h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t u v z a b
        c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o p q r s t
        u v z a b c d e f g h i l m n o p q r s t u v z a b c d e f g h i l m n o
        p q r s t u v z
        \end{list}
        \end{document}
        `

        Se guardate l’item 1 è ok, anche l’indentazione della prima riga dell’item 2, il punto è che però vorrei che tutto l’item 2 abbia quella indentazione.

        Scusate se sono stato confuso… mi avete capito?

        Temo che anche aumentando \leftmargin non si ottenga nulla. In realtà ciò che stai chiedendo è di avere liste annidate: il secondo \item è in effetti una lista a sé stante annidata nella prima.

        Già che ci sono: se nel secondo argomento di \list scrivi anche \usecounter{line}, non avrai bisogno di specificare \stepcounter{line} e \item[\arabic{line}]: basta \item

        Ciao
        Enrico

    Visualizzazione 2 filoni di risposte
    • Devi essere connesso per rispondere a questo topic.

    Go to top