Difference between revisions of "FR/Documentation/Paramétrer un style de numérotation de lignes"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Instructions)
(Étape 1. Créer le style de numérotation de liste.)
Line 64: Line 64:
 
[[Image:numlist3.png|Setting up the new CodeNumbering list (numbering) style]]<br>''Figure 3: Paramétrer le nouveau style de liste (numérotation) NumérotationCode.''
 
[[Image:numlist3.png|Setting up the new CodeNumbering list (numbering) style]]<br>''Figure 3: Paramétrer le nouveau style de liste (numérotation) NumérotationCode.''
  
<li>On the Position page, do this:</li>
+
<li>Sous l'onglet Position, faites :</li>
 
<ol  style="list-style-type:lower-alpha">
 
<ol  style="list-style-type:lower-alpha">
  
<li>In the Level box, choose 1.</li>
+
<li>Dans la zone Niveau, choisissez 1.</li>
  
<li>For Indent, choose 0.5cm. (You may need to adjust this later.)</li>
+
<li>Pour le retrait, choisissez 0.5cm (vous pourrez avoir besoin de l'ajuster plus tard).</li>
  
<li>For Spacing to text, choose 1.0cm.</li>
+
<li>Pour l'espacement du texte, choisissez 1.0cm.</li>
  
<li>For Minimum space..., choose 0.4cm.</li>
+
<li>Pour l'espace mini..., choisissez 0.4cm.</li>
  
<li>For Numbering alignment, choose Right.</li>
+
<li>Pour l'alignement de la numérotation, choississez À droite.</li>
  
 
</ol>
 
</ol>
  
[[Image:numlist4.png|Setting the alignment and indentation for the CodeNumbering style]]<br>''Figure 4: Setting the alignment and indentation for the CodeNumbering style.''
+
[[Image:numlist4.png|Setting the alignment and indentation for the CodeNumbering style]]<br>''Figure 4: Paramétrer l'alignement et le retrait du style NumérotationCode.''
  
<li>Do nothing on the other pages of this dialog.</li>
+
<li>Ne faites rien d'autre dans les autres onglets de la boîte de dialogue.</li>
  
<li>Click OK to save this style.</li>
+
<li>Cliquez sur OK pour enregistrer ce style.</li>
 
</ol>
 
</ol>
  

Revision as of 16:37, 17 April 2008

Template:Documentation/Howto Ce document décrit comment paramétrer un style qui utilise un style de liste pour numéroter des lignes (en fait des paragraphes) dans les listings.

Exemple de résultat souhaité

Nous souhaitons créer un style de paragraphe de code de programme qui numérote comme ceci, avec les numéros alignés à droite, chaque ligne de code indentée à la même distance et les paragraphes suffisamment en retrait pour que les numéros s'adaptent à l'espace disponible (chaque ligne de code est un paragraphe séparé).

     1  Ligne 1 
     2  Ligne 2 
     3  Ligne 3 
        ... 
     8  Ligne 8 
     9  Ligne 9 
    10  Ligne 10 
    11  Ligne 11 
        ... 
   101  Ligne 101 
  1001  Ligne 1001

Figure 1: Exemple de liste.

Instructions

Le processus se déroule en trois étapes:

Étape 1. Créer le style de numérotation de liste.

Étape 2. Créer le style de paragraphe.

Étape 3. Appliquer le style de paragraphe au listing de code.

Avant de commencer, pressez F11 pour ouvrir la fenêtre Styles et formatage, si elle n'est déjà ouverte.

Étape 1. Créer le style de numérotation de liste.

  1. Cliquez sur l'icône Styles de liste en haut de la fenêtre Styles et formatage (cinquième à partir de la gauche).
  2. Faites un clic avec le bouton droit dans un espace vide en-dessous de la liste de styles et choisissez Nouveau (vous pouvez modifier un style existant, mais il est plus facile de se souvenir quel style est destiné à un projet spécial si vous en créez un nouveau).
  3. Starting a new list style
    Figure 2: Créer un nouveau style de liste.

    Remarque : Si l'icône en de la fenêtre Styles et formatage est nommée Styles de liste, la boîte de dialogue qui s'ouvre s'appelle Style de numérotation.

  4. Sous l'onglet Gérer de la boîte de dialogue Style de numérotation, donnez un nom au nouveau style de liste, par exemple NumérotationCode.
  5. Sous l'onglet Options, faites :
    1. Dans la zone Niveau, choisissez 1.
    2. Dans la liste Numérotation, choisissez 1,2,3.
    3. Laissez les zones Avant et Après vides, ou supprimez ce qui peut se trouver à l'intérieur.
    4. Laissez la zone Style de caractères sur Aucun(e).
    5. Assurez-vous que Commencer avec est sur 1.
    6. Afficher les sous niveaux devrait être grisé. Ne sélectionnez pas la case à cocher Numérotation continue.
    7. Vous n'avez pas besoin de faire quoi que ce soit avec les autres niveau, parce que ce style de paragraphe ne fera pas partie d'une hiérarchie dans une table.

    Setting up the new CodeNumbering list (numbering) style
    Figure 3: Paramétrer le nouveau style de liste (numérotation) NumérotationCode.

  6. Sous l'onglet Position, faites :
    1. Dans la zone Niveau, choisissez 1.
    2. Pour le retrait, choisissez 0.5cm (vous pourrez avoir besoin de l'ajuster plus tard).
    3. Pour l'espacement du texte, choisissez 1.0cm.
    4. Pour l'espace mini..., choisissez 0.4cm.
    5. Pour l'alignement de la numérotation, choississez À droite.

    Setting the alignment and indentation for the CodeNumbering style
    Figure 4: Paramétrer l'alignement et le retrait du style NumérotationCode.

  7. Ne faites rien d'autre dans les autres onglets de la boîte de dialogue.
  8. Cliquez sur OK pour enregistrer ce style.

Step 2. Create the paragraph style.

  1. Click the Paragraph Styles icon at the top of the Styles and Formatting window (first icon on the left).
  2. Right-click and choose New.
  3. On the Organizer page of the Paragraph Style dialog:
    1. Give the new paragraph style a name. We’ll call it ProgCode.
    2. In the Next Style box, choose ProgCode (that will make the following paragraph also be in this style, until you choose a different style).
    3. In Linked with, I recommend choosing -None-.
    4. Category should be Custom Styles, though I think that doesn't matter.

    Creating the ProgCode paragraph style
    Figure 5: Creating the ProgCode paragraph style.

  4. On the Font page, choose the font you want, perhaps Courier New, and the size.
  5. On the Indents & Spacing page, leave all the boxes showing 0.00cm.
  6. On the Numbering page, choose from the list the CodeNumbering style you just created.
  7. Associating the paragraph style with a numbering style
    Figure 6: Associating the paragraph style with a numbering style.

  8. You should not need to do anything on the other pages of this dialog.
  9. Click OK to save this style.

Step 3. Apply the paragraph style to the code listing.

If you have already entered the lines of code, select them and double-click ProgCode in the Styles and Formatting window. All the lines should now be numbered, indented, and in the correct font.

Note: If you have previously been applying manual formatting to these paragraphs, first select all the paragraphs, right-click, and choose Default Formatting; then apply the ProgCode style.

If you are starting a new block of code, apply the ProgCode style to the first line (either before or after entering it). Then when you press Enter at the end of that line, the next line will appear in the same ProgCode style but with the next number in the list sequence.

Restarting numbering (if required)

If you have more than one list in a chapter, the second and subsequent lists may continue numbering from the previous list. To restart at 1, place the cursor anywhere in the paragraph you want numbered 1, right-click and choose Restart numbering.

Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools