issue204:latex
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue204:latex [2024/04/28 07:19] – créée d52fr | issue204:latex [2024/05/05 10:21] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | This time, I am going to come back to a topic I did quickly before: tables. I’ll start with what was used in documents to present data in columns before word processing. | + | **This time, I am going to come back to a topic I did quickly before: tables. I’ll start with what was used in documents to present data in columns before word processing. |
Before computers, there were typewriters, | Before computers, there were typewriters, | ||
- | Tabs can be used in Latex in the tab environment. It is relatively easy to set tab stops at specific distances from the left margin in either the tabbing or the tabto environments. However, if you want information arranged in columns and rows, the tabular environment offers more flexibility and more options. | + | Tabs can be used in Latex in the tab environment. It is relatively easy to set tab stops at specific distances from the left margin in either the tabbing or the tabto environments. However, if you want information arranged in columns and rows, the tabular environment offers more flexibility and more options.** |
- | This is not a simple topic. In The Latex Companion (Third Edition) there’s about seventy pages of detailed information discussing the various table environments and their various extensions. If that seems like more than you want to read, there are eleven pages dedicated to a simplified discussion of the table environment in LATEX2e: An unofficial reference manual available at https:// | + | Cette fois, je vais revenir sur un sujet que j'ai déjà abordé rapidement |
- | Ideally tables are used to organize and present information so the contents of the table are clear to the reader. Tables organize information in vertical columns and horizontal rows. A table is a framework, a skeleton into which the writer puts information. A table is described by indicating how many rows and columns it has. Often a table has the same number of columns in each row and the same number of rows in each column. However table cells can be joined in various ways. Table cells are often separated from each other with vertical and / or horizontal lines. All of this is familiar to you, I am sure. | + | Avant les ordinateurs, |
- | In Latex, a table is built inside a table environment. As Erik showed in one of his last columns here is the basic code for a table with some contents (shown above). | + | Les tabulations peuvent être utilisées dans LaTeX dans l' |
+ | |||
+ | |||
+ | **This is not a simple topic. In The Latex Companion (Third Edition) there’s about seventy pages of detailed information discussing the various table environments and their various extensions. If that seems like more than you want to read, there are eleven pages dedicated to a simplified discussion of the table environment in LATEX2e: An unofficial reference manual available at https:// | ||
+ | |||
+ | Ideally tables are used to organize and present information so the contents of the table are clear to the reader. Tables organize information in vertical columns and horizontal rows. A table is a framework, a skeleton into which the writer puts information. A table is described by indicating how many rows and columns it has. Often a table has the same number of columns in each row and the same number of rows in each column. However table cells can be joined in various ways. Table cells are often separated from each other with vertical and / or horizontal lines. All of this is familiar to you, I am sure.** | ||
+ | |||
+ | Ce n'est pas un sujet simple. Le LaTeX Companion (troisième édition) contient environ soixante-dix pages d' | ||
+ | |||
+ | Idéalement, | ||
+ | |||
+ | **In Latex, a table is built inside a table environment. As Erik showed in one of his last columns here is the basic code for a table with some contents (shown above). | ||
{||l|c|c|c|c||} means set up a table with five columns, the left hand column is left-aligned, | {||l|c|c|c|c||} means set up a table with five columns, the left hand column is left-aligned, | ||
- | In Latex tables are one of the items which are floated when typeset. That has two consequences for page designers and authors. The first consequence is the table will appear on the page where there is room for it. If there is not room on the current page then it is “floated” to the next page. The second consequence is a table in the tabular environment cannot extend past the end of a page, that is one table has a maximum size of one page. If you need more space than one page for your table, investigate the use of the supertabular and the longtabular environments. | + | In Latex tables are one of the items which are floated when typeset. That has two consequences for page designers and authors. The first consequence is the table will appear on the page where there is room for it. If there is not room on the current page then it is “floated” to the next page. The second consequence is a table in the tabular environment cannot extend past the end of a page, that is one table has a maximum size of one page. If you need more space than one page for your table, investigate the use of the supertabular and the longtabular environments.** |
+ | |||
+ | Dans LaTeX, un tableau est construit à l' | ||
+ | |||
+ | {||l|c|c|c|c||} signifie créer un tableau avec cinq colonnes, la colonne de gauche est alignée à gauche, toutes les autres sont centrées. La ligne verticale unique entre chaque option d' | ||
+ | |||
+ | Dans LaTeX, les tableaux sont l'un des éléments qui sont flottants lors de la mise en page. Cela a deux conséquences pour les concepteurs de pages et les auteurs. La première conséquence est que le tableau apparaîtra sur la page où il y a de la place pour lui. S'il n'y a pas de place sur la page en cours, il est « flotté » sur la page suivante. La deuxième conséquence est qu'un tableau dans l' | ||
- | The following example shows how to connect two cells in the same row together. There is a similar instruction for connecting two cells in two different rows. The & after {Ene} is necessary to build the third cell in the first row. | + | **The following example shows how to connect two cells in the same row together. There is a similar instruction for connecting two cells in two different rows. The & after {Ene} is necessary to build the third cell in the first row. |
\begin{tabular}{|c|c|c|} | \begin{tabular}{|c|c|c|} | ||
Ligne 31: | Ligne 48: | ||
\multirow{2}{14mm}{Ene} & Mene \\ | \multirow{2}{14mm}{Ene} & Mene \\ | ||
& Muh! \\ | & Muh! \\ | ||
+ | \hline | ||
+ | \end{tabular}** | ||
+ | |||
+ | L' | ||
+ | |||
+ | \begin{tabular}{|c|c|c|} | ||
+ | \hline | ||
+ | \multicolumn{2}{|c|}{Ene} & \\ | ||
+ | \hline | ||
+ | Mene & Muh! & Curly \\ | ||
\hline | \hline | ||
\end{tabular} | \end{tabular} | ||
- | Since I started this column by discussing tabs and tab stops, I am going to finish by showing two methods of getting and using tab stops in Latex. The first way is in the tabbing environment, | + | À l' |
+ | |||
+ | \begin{tabular}{|c|c|} | ||
+ | \hline | ||
+ | \multirow{2}{14mm}{Ene} & Mene \\ | ||
+ | & Muh! \\ | ||
+ | \hline | ||
+ | \end{tabular} | ||
+ | |||
+ | |||
+ | **Since I started this column by discussing tabs and tab stops, I am going to finish by showing two methods of getting and using tab stops in Latex. The first way is in the tabbing environment, | ||
\begin{tabbing} | \begin{tabbing} | ||
Ligne 42: | Ligne 79: | ||
\end{tabbing} | \end{tabbing} | ||
- | The first line after the begin{tabbing} instruction sets the tab stops, the distance from the left margin for the start of the text (or other contents). Notice there are five characters plus one space between the margin and the first tab stop. The first item in the first line will display with no problems, it contains three characters and one space. The first item in the second line has six characters and two spaces. It will display as usual. However the second item in the second line starts with five characters and one space from the left margin, and will overwrite part of the first item. The next code example shows how to fix this problem. | + | The first line after the begin{tabbing} instruction sets the tab stops, the distance from the left margin for the start of the text (or other contents). Notice there are five characters plus one space between the margin and the first tab stop. The first item in the first line will display with no problems, it contains three characters and one space. The first item in the second line has six characters and two spaces. It will display as usual. However the second item in the second line starts with five characters and one space from the left margin, and will overwrite part of the first item. The next code example shows how to fix this problem.** |
+ | |||
+ | Puisque j'ai commencé cette rubrique en parlant des tabulations et des taquets de tabulation, je vais terminer en montrant deux méthodes pour obtenir et utiliser les taquets de tabulation dans LaTeX. La première méthode se trouve dans l' | ||
\begin{tabbing} | \begin{tabbing} | ||
+ | First \= Second \= Third \=\kill | ||
+ | one \> two \> three \> four\\ | ||
+ | one two \> two \> three \> four\\ | ||
+ | \end{tabbing} | ||
+ | |||
+ | La première ligne après l' | ||
+ | |||
+ | |||
+ | **\begin{tabbing} | ||
First tab stop \= Second \= Third \=\kill | First tab stop \= Second \= Third \=\kill | ||
one \> two \> three \> four\\ | one \> two \> three \> four\\ | ||
Ligne 56: | Ligne 104: | ||
The distances are distances from the left margin. Notice the text Tab 3 will be printed between Tab 1 and Tab 2. (The asterisk suppresses line breaks.) | The distances are distances from the left margin. Notice the text Tab 3 will be printed between Tab 1 and Tab 2. (The asterisk suppresses line breaks.) | ||
- | The tabto package will also allow a user to set a specific number of evenly spaced tabs or specify exactly where each tab stop should be (just as can be done with a typewriter). Both parts of the code below go into the document. | + | The tabto package will also allow a user to set a specific number of evenly spaced tabs or specify exactly where each tab stop should be (just as can be done with a typewriter). Both parts of the code below go into the document.** |
- | \TabPositions{0, | + | \begin{tabbing} |
+ | First tab stop \= Second \= Third \=\kill | ||
+ | one \> two \> three \> four\\ | ||
+ | one two \> two \> three \> four\\ | ||
+ | \end{tabbing} | ||
+ | |||
+ | Comme indiqué ci-dessus, tabto est un paquet mais ce n'est pas un environnement, | ||
+ | |||
+ | \tabto*{1cm} Tab 1 \tabto*{3cm} Tab 2 \tabto*{2cm} Tab 3 % dans le document | ||
+ | |||
+ | Les distances sont celles depuis la marge gauche. Remarquez que le texte Tab 3 sera imprimé entre les onglets 1 et 2 (l' | ||
+ | |||
+ | Le paquet tabto permet également à l' | ||
+ | |||
+ | **\TabPositions{0, | ||
Then use \tab in the document. (This is equivalent to \NumTabs{4} | Then use \tab in the document. (This is equivalent to \NumTabs{4} | ||
Ligne 68: | Ligne 130: | ||
There is a brief one-page document for the Tabto package available on ctan.org. A little experimenting will be helpful if you are not used to using tab stops. | There is a brief one-page document for the Tabto package available on ctan.org. A little experimenting will be helpful if you are not used to using tab stops. | ||
- | That is enough Latex fun for one issue. I will spend more time working with tables in the next column. In the meantime, if there is anything in this column that is new to you, I encourage you to try it out, play with the code, experiment with the choices, perhaps even read the documentation. Learning something new takes some effort but the rewards with Latex are worth the effort. | + | That is enough Latex fun for one issue. I will spend more time working with tables in the next column. In the meantime, if there is anything in this column that is new to you, I encourage you to try it out, play with the code, experiment with the choices, perhaps even read the documentation. Learning something new takes some effort but the rewards with Latex are worth the effort.** |
+ | |||
+ | \TabPositions{0, | ||
+ | |||
+ | Utilisez ensuite \tab dans le document. Cela équivaut à \NumTabs{4}. | ||
+ | |||
+ | \NumTabs{4} % dans le document | ||
+ | % quatre taquets de tabulation régulièrement espacés, commençant à la marge gauche | ||
+ | \tab Tab 1 \tab Tab 2 \tab Tab 3 \tab Tab 4 \\ | ||
+ | |||
+ | Un bref document d'une page sur le paquet Tabto est disponible sur ctan.org. Un peu d' | ||
+ | |||
+ | C'est assez de plaisir avec LaTeX pour un seul numéro. Je passerai plus de temps à travailler avec des tableaux dans la prochaine chronique. En attendant, si quelque chose dans cette rubrique est nouveau pour vous, je vous encourage à l' | ||
issue204/latex.1714281567.txt.gz · Dernière modification : 2024/04/28 07:19 de d52fr