issue205:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue205:latex [2024/06/01 10:23] – créée auntiee | issue205:latex [2024/06/12 15:33] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Last time the column was about tabs and tables. One of the big drawbacks with default tables is they cannot extend over the end of a page. An author is limited to tables that are one page or less in size. If a tabular environment extends beyond the limits of one page the extra content overwrites the page’s bottom margin and gives an Overfull \vbox message when compiled. Two packages have been built to overcome this difficulty: supertabular and longtable. They have different features and have their own strengths and weaknesses (as is true of all packages). | + | **Last time the column was about tabs and tables. One of the big drawbacks with default tables is they cannot extend over the end of a page. An author is limited to tables that are one page or less in size. If a tabular environment extends beyond the limits of one page the extra content overwrites the page’s bottom margin and gives an Overfull \vbox message when compiled. Two packages have been built to overcome this difficulty: supertabular and longtable. They have different features and have their own strengths and weaknesses (as is true of all packages). |
- | Supertabular evaluates the amount of used space every time it encounters a \\ command (remember \\ tells Latex – Tex to insert a line break and carriage return). When the amount of used space equals the allowed text height, then supertabular closes the tabular environment, | + | Supertabular evaluates the amount of used space every time it encounters a \\ command (remember \\ tells Latex – Tex to insert a line break and carriage return). When the amount of used space equals the allowed text height, then supertabular closes the tabular environment, |
- | Note: Because page breaks occur only after a \\ command, page breaks in a table must occur between rows and cannot occur inside a row. | + | La dernière fois, l' |
+ | |||
+ | Supertabular évalue la quantité d’espace utilisé chaque fois qu’il rencontre une commande \\ (rappelez-vous \\ dit à LaTeX – TeX d’insérer un saut de ligne et un retour de chariot). Lorsque la quantité d’espace utilisée est égale à la hauteur de texte autorisée, supertabular ferme l’environnement tabulaire, démarre une nouvelle page avec l’en-tête approprié, puis rouvre l’environnement tabulaire. Cette méthode implique que la largeur des colonnes (et la largeur du tableau correspondante) peut varier d’une page à l’autre. Étant donné que supertabular utilise une estimation de l’espace libre de contenu disponible sur une page, cette estimation peut parfois être erronée. Il existe des moyens de contrôler à la fois la hauteur de ligne et la largeur de colonne pour éviter les situations dans lesquelles la largeur du tableau varie d’une page à l’autre, ou pour empêcher la dernière ligne d’un tableau d’être placée toute seule sur une page. | ||
+ | |||
+ | **Note: Because page breaks occur only after a \\ command, page breaks in a table must occur between rows and cannot occur inside a row. | ||
Supertabular is an environment that first requires the package to be loaded, and then requires the environment to be started. It also requires the environment to be closed. There are four somewhat different commands which can be used to begin the environment depending on the needs of the author. | Supertabular is an environment that first requires the package to be loaded, and then requires the environment to be started. It also requires the environment to be closed. There are four somewhat different commands which can be used to begin the environment depending on the needs of the author. | ||
Ligne 19: | Ligne 23: | ||
Width is a required attribute. As you would expect it sets a fixed width for the table. | Width is a required attribute. As you would expect it sets a fixed width for the table. | ||
- | The mpsupertabular environments wrap each supertabular environment into a minipage environment. This allows the footnote command to be used inside the table and the footnote is printed at the end of the relevant page. | + | The mpsupertabular environments wrap each supertabular environment into a minipage environment. This allows the footnote command to be used inside the table and the footnote is printed at the end of the relevant page.** |
- | The command shrinkheight{height} may be used to shrink (or increase if a negative length is used) the height of a row. This is useful in situations when the last row of a table appears at the top of a page. It is put at the start of the affected row. For example, in the sample table, it is possible to shrink the row originally at the bottom of the first page so the row at the top of the second page moves up. | + | Remarque : Étant donné que les sauts de page ne se produisent qu’après une commande \\, les sauts de page dans un tableau doivent se produire entre les lignes et ne peuvent pas se produire à l’intérieur d’une ligne. |
+ | |||
+ | Supertabular est un environnement qui nécessite d’abord le chargement du paquet, puis le démarrage de l’environnement. Il exige également que l’environnement soit fermé. Il y a quatre commandes quelque peu différentes qui peuvent être utilisées pour commencer l’environnement en fonction des besoins de l’auteur : | ||
+ | |||
+ | \begin{supertabular}{colspec} | ||
+ | |||
+ | \begin{supertabular*}{width}{colspec} | ||
+ | |||
+ | \begin{mpsupertabular}{colspec} | ||
+ | |||
+ | \begin{mpsupertabular*}{width}{colspec} | ||
+ | |||
+ | colspec est configuré de la même manière que l’environnement tabulaire. Il indique le nombre de colonnes, l’alignement du contenu et souvent le caractère utilisé pour séparer les colonnes les unes des autres. | ||
+ | |||
+ | La largeur est un attribut obligatoire. Comme vous vous en doutez, il définit une largeur fixe pour le tableau. | ||
+ | |||
+ | Les environnements mpsupertabular enveloppent chaque environnement supertabular dans un environnement minipage. Cela permet d’utiliser la commande footnote à l’intérieur du tableau et la note est imprimée en bas de la page concernée. | ||
+ | |||
+ | **The command shrinkheight{height} may be used to shrink (or increase if a negative length is used) the height of a row. This is useful in situations when the last row of a table appears at the top of a page. It is put at the start of the affected row. For example, in the sample table, it is possible to shrink the row originally at the bottom of the first page so the row at the top of the second page moves up. | ||
For more options read the documentation for supertabular. Although it is 24 pages long, most of the content is an explanation of the inner workings of the supertabular macro. There are also a few example long tables which reward the reader who invests a little time to understand them. | For more options read the documentation for supertabular. Although it is 24 pages long, most of the content is an explanation of the inner workings of the supertabular macro. There are also a few example long tables which reward the reader who invests a little time to understand them. | ||
- | Longtable: Like supertabular, | + | Longtable: Like supertabular, |
+ | |||
+ | La commande shrinkheight{height} peut être utilisée pour réduire (ou augmenter si une longueur négative est utilisée) la hauteur d’une ligne. Cela est utile lorsque la dernière ligne d’un tableau apparaît en haut d’une page. Elle est placée au début de la ligne concernée. Par exemple, dans le tableau d’exemple, | ||
+ | |||
+ | Pour plus d’options, | ||
+ | |||
+ | Longtable : comme supertabular, | ||
+ | |||
+ | |||
+ | **The longtable environment saves information about the width of each table in an aux file. It then uses this information in a second compile to calculate and set the width of each column to the widest required by the contents. This implies any file that uses longtable should be compiled several times before accepting the final pdf output. | ||
- | The longtable environment saves information about the width of each table in an aux file. It then uses this information in a second compile to calculate and set the width of each column to the widest required by the contents. This implies any file that uses longtable should be compiled several times before accepting the final pdf output. | ||
The major difference between supertabular and longtable is most parameters in longtable are set inside the code for the longtable environment, | The major difference between supertabular and longtable is most parameters in longtable are set inside the code for the longtable environment, | ||
- | Notice the [c] instruction in the begin command. With longtable, the position of the table can be set either l(eft), c(enter) or r(ight) in the begin command. With supertabular the table position is set outside the supertabular environment. (See the begin{center} command in the supertabular code fragment. | + | Notice the [c] instruction in the begin command. With longtable, the position of the table can be set either l(eft), c(enter) or r(ight) in the begin command. With supertabular the table position is set outside the supertabular environment. (See the begin{center} command in the supertabular code fragment.** |
- | There is a third environment which can be used for multi-page tables called xltabular. I leave it to you to investigate if this is of interest. | + | L’environnement longtable enregistre des informations sur la largeur de chaque table dans un fichier aux. Il utilise ensuite ces informations dans une deuxième compilation pour calculer et définir la largeur de chaque colonne au plus large requis par le contenu. Cela implique que tout fichier qui utilise longtable doit être compilé plusieurs fois avant d’accepter la sortie finale du pdf. |
+ | |||
+ | La différence majeure entre supertabular et longtable est que la plupart des paramètres dans longtable sont définis à l’intérieur du code pour l’environnement longtable ; la plupart de ceux dans supertabular sont définis avant ou en dehors de l’environnement. Quelques paramètres sont définis dans l’exemple de code affiché à droite. | ||
+ | |||
+ | Notez l’instruction [c] dans la commande begin. Avec longtable, la position de la table peut être définie l(eft) - gauche - , c(enter) - centre - ou r(ight) - droit - dans la commande begin. Avec supertabular, | ||
+ | |||
+ | |||
+ | **There is a third environment which can be used for multi-page tables called xltabular. I leave it to you to investigate if this is of interest. | ||
As noted above, page breaks in multi-page tables occur only at breaks between rows ( or at hline commands). Usually this default behaviour is preferable. This can cause design problems in some instances. Occasionally it is necessary to break the contents of one row over two pages. There is a manual “fix” for this situation which involves adding some line breaks and empty cells to force the cell contents to arrange in a particular way along with the parfillskip command so text aligns properly. If you have a situation like this, read over the guidance on pp. 464-466 in volume 1 of The Latex Companion (3rd edition). | As noted above, page breaks in multi-page tables occur only at breaks between rows ( or at hline commands). Usually this default behaviour is preferable. This can cause design problems in some instances. Occasionally it is necessary to break the contents of one row over two pages. There is a manual “fix” for this situation which involves adding some line breaks and empty cells to force the cell contents to arrange in a particular way along with the parfillskip command so text aligns properly. If you have a situation like this, read over the guidance on pp. 464-466 in volume 1 of The Latex Companion (3rd edition). | ||
- | Erik and I have presented coding about tables three times now, so enough about tables. Next time another adventure with Latex. | + | Erik and I have presented coding about tables three times now, so enough about tables. Next time another adventure with Latex.** |
+ | |||
+ | Il y a un troisième environnement qui peut être utilisé pour les tableaux de plusieurs pages, appelé xltabular. Je vous laisse le soin de chercher si cela vous intéresse. | ||
+ | |||
+ | Comme indiqué ci-dessus, les sauts de page dans les tables multi-pages se produisent uniquement aux sauts entre les lignes (ou aux commandes hline). Habituellement, | ||
+ | |||
+ | Erik et moi avons présenté le codage des tableaux trois fois maintenant, alors assez sur les tableaux. La prochaine fois, une autre aventure avec LaTeX. | ||
issue205/latex.1717230189.txt.gz · Dernière modification : 2024/06/01 10:23 de auntiee