Outils pour utilisateurs

Outils du site


issue219:latex

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
issue219:latex [2025/07/30 07:12] d52frissue219:latex [2025/07/30 09:24] (Version actuelle) d52fr
Ligne 1: Ligne 1:
-**If you read the Latex column in FCM 218, you may remember I am going to try adding three more features to the book about Whitefoot the Wood Mouse: drop caps for the initial paragraph of each chapter, the geometry package, and illustrations. Before I do those three, I will change the size of the type to be a little friendlier to children’s eyes. When I finished last time, I had reset the font to Noto Serif but made no change to the type size.+**If you read the LaTeX column in FCM 218, you may remember I am going to try adding three more features to the book about Whitefoot the Wood Mouse: drop caps for the initial paragraph of each chapter, the geometry package, and illustrations. Before I do those three, I will change the size of the type to be a little friendlier to children’s eyes. When I finished last time, I had reset the font to Noto Serif but made no change to the type size.
  
 Note: For those who do not know, Noto is a shortened form of “No tofu”. It means this font has an extensive set of characters and supports Unicode. That means it can be used for many languages of the world without generating little blank boxes (“tofu” - □) as substitutes for missing characters. The various styles of the Noto font family are available for free from fonts.google.com, fontsquirrel.com, exfont.com, and other font distributors. Note: For those who do not know, Noto is a shortened form of “No tofu”. It means this font has an extensive set of characters and supports Unicode. That means it can be used for many languages of the world without generating little blank boxes (“tofu” - □) as substitutes for missing characters. The various styles of the Noto font family are available for free from fonts.google.com, fontsquirrel.com, exfont.com, and other font distributors.
  
-Without a type size in the documentclass instruction, Latex generates 68 pages. Setting the default type size to 10pt generates 109 pages. Since this is a book, every chapter will start on a right-hand page by default. Without a default type size, almost all 32 chapters use two pages, a right page and a left page. If I increase the type size, many or all chapters become three pages (right, left, right), then Latex will automatically add a blank left page at the end of each chapter. I would like to avoid using all that extra paper.**+Without a type size in the documentclass instruction, LaTeX generates 68 pages. Setting the default type size to 10pt generates 109 pages. Since this is a book, every chapter will start on a right-hand page by default. Without a default type size, almost all 32 chapters use two pages, a right page and a left page. If I increase the type size, many or all chapters become three pages (right, left, right), then LaTeX will automatically add a blank left page at the end of each chapter. I would like to avoid using all that extra paper.** 
 + 
 +Si vous avez lu la chronique LaTeX dans le FCM n° 218, vous vous souvenez peut-être que je vais essayer d'ajouter trois fonctionnalités supplémentaires au livre « Whitefoot, la souris des bois » : des lettrines pour le premier paragraphe de chaque chapitre, le paquet geometry et des illustrations. Avant cela, je vais modifier la taille de la police pour qu'elle soit plus agréable à lire pour les enfants. La dernière fois, j'avais réinitialisé la police à Noto Serif, mais je n'ai pas modifié la taille de la police. 
 + 
 +Remarque : Pour ceux qui ne le savent pas, Noto est l'abréviation de « No tofu ». Cela signifie que cette police possède un jeu de caractères étendu et prend en charge Unicode. Elle peut donc être utilisée dans de nombreuses langues du monde sans générer de petits espaces vides (des « tofu » - □) pour remplacer les caractères manquants. Les différents styles de la famille de polices Noto sont disponibles gratuitement sur fonts.google.com, fontsquirrel.com, exfont.com et d'autres distributeurs de polices. 
 + 
 +Sans taille de police dans l'instruction documentclass, LaTeX génère 68 pages. Définir la taille de police par défaut à 10 pt génère 109 pages. Comme il s'agit d'un livre, chaque chapitre commence par défaut sur une page de droite. Sans taille de police par défaut, la quasi-totalité des 32 chapitres utilisent deux pages : une page de droite et une page de gauche. Si j'augmente la taille de police, plusieurs chapitres, voire tous, se réduisent à trois pages (droite, gauche, droite), LaTeX ajoutera automatiquement une page de gauche vierge à la fin de chaque chapitre. Je souhaite éviter d'utiliser autant de papier supplémentaire. 
  
 **During my scan of the pages, I noticed many of the epigraphs were occupying four lines of type, not two. In order to adjust most of them to two lines I increased the width of the epigraph area usually to to eight centimetres but to ten or twelve centimetres if necessary: \setlength{\epigraphwidth}{8cm} **During my scan of the pages, I noticed many of the epigraphs were occupying four lines of type, not two. In order to adjust most of them to two lines I increased the width of the epigraph area usually to to eight centimetres but to ten or twelve centimetres if necessary: \setlength{\epigraphwidth}{8cm}
Ligne 10: Ligne 17:
  
 After several experiments and a few test prints, I decided to use the FourierNC package at 11pt. It generates New Century Schoolbook text. That seems appropriate to me since I first encountered Thornton W. Burgess in a grade school classroom. Using the default margins for the document class “book”, and using letter size paper, this choice generates 91 pages. ** After several experiments and a few test prints, I decided to use the FourierNC package at 11pt. It generates New Century Schoolbook text. That seems appropriate to me since I first encountered Thornton W. Burgess in a grade school classroom. Using the default margins for the document class “book”, and using letter size paper, this choice generates 91 pages. **
 +
 +En parcourant les pages, j'ai remarqué que de nombreuses épigraphes occupaient quatre lignes, et non deux. Afin d'ajuster la plupart d'entre elles à deux lignes, j'ai augmenté la largeur de la zone d'épigraphe, généralement à huit centimètres, mais à dix ou douze centimètres si nécessaire : \setlength{\epigraphwidth}{8cm}
 +
 +En modifiant la taille par défaut du texte Noto à 11 pt dans la commande documentclass, on génère 120 pages, et 12 pt augmente encore le nombre de pages à 124. En supprimant le retrait de paragraphe et l'interligne supplémentaire, et en revenant à la taille par défaut de 10 pt, on réduit le nombre de pages à 75. Cependant, ce n'est pas un bon choix de conception. Une autre police de caractères serait peut-être préférable. Ce sont des choix que les concepteurs de livres et autres experts en PAO rencontrent régulièrement.
 +
 +Après plusieurs essais et quelques impressions tests, j'ai décidé d'utiliser le paquet FourierNC à 11 pt. Il génère du texte New Century Schoolbook. Cela me semble approprié, car j'ai rencontré Thornton W. Burgess pour la première fois dans une classe d'école primaire. En utilisant les marges par défaut de la classe de document « livre » et du papier au format lettre, ce choix génère 91 pages.
 +
  
 **As I scrolled through each variation in type size, I noticed some widows and orphans. These terms denote only the first line of a paragraph appearing at the bottom of a page (orphan), or only the last line of a paragraph appearing at the top of a page (widow). These problems and others can be identified in the error log in TexStudio using the widows-and-orphans package. Widows, and often orphans, can be eliminated using the nowidow package. Even if you use the nowidow package, I strongly recommend looking through the generated document carefully to find any orphans that appear in the TexStudio log. Almost always, the adjustments made by the nowidow package will also eliminate orphans. However, you may need to edit the text or introduce an artificial line break or page break in order to correct any orphaned line you find. **As I scrolled through each variation in type size, I noticed some widows and orphans. These terms denote only the first line of a paragraph appearing at the bottom of a page (orphan), or only the last line of a paragraph appearing at the top of a page (widow). These problems and others can be identified in the error log in TexStudio using the widows-and-orphans package. Widows, and often orphans, can be eliminated using the nowidow package. Even if you use the nowidow package, I strongly recommend looking through the generated document carefully to find any orphans that appear in the TexStudio log. Almost always, the adjustments made by the nowidow package will also eliminate orphans. However, you may need to edit the text or introduce an artificial line break or page break in order to correct any orphaned line you find.
Ligne 16: Ligne 30:
  
 Setting up the drop caps has to be done for each chapter individually. For drop caps, I used the lettrine package. It has good documentation and three sample documents. I chose not to use any options, to have the first letter of the first word in a chapter use two lines, and the rest of the first word in small caps. (See the accompanying image in this issue.) This had to be done for each chapter separately, which was a little tedious to do for thirty-two chapters. However I am pleased with the result.** Setting up the drop caps has to be done for each chapter individually. For drop caps, I used the lettrine package. It has good documentation and three sample documents. I chose not to use any options, to have the first letter of the first word in a chapter use two lines, and the rest of the first word in small caps. (See the accompanying image in this issue.) This had to be done for each chapter separately, which was a little tedious to do for thirty-two chapters. However I am pleased with the result.**
 +
 +En parcourant chaque variation de taille de police, j'ai remarqué des veuves et des orphelins. Ces termes désignent uniquement la première ligne d'un paragraphe apparaissant en bas de page (orpheline), ou uniquement la dernière ligne d'un paragraphe apparaissant en haut de page (veuve). Ces problèmes, et d'autres, peuvent être identifiés dans le journal des erreurs de TexStudio grâce au paquet widows-and-orphans. Les veuves, et souvent les orphelins, peuvent être éliminés grâce au paquet nowidow. Même avec ce dernier, je vous recommande vivement d'examiner attentivement le document généré pour identifier les orphelins figurant dans le journal de TexStudio. Les ajustements effectués par le paquet nowidow éliminent presque toujours les orphelins. Cependant, vous devrez peut-être modifier le texte ou introduire un saut de ligne ou de page artificiel afin de corriger toute ligne orpheline trouvée.
 +
 +Remarque : Effectuez la vérification finale des veuves et des orphelins après avoir effectué tous les autres ajustements affectant la quantité de texte sur une page. Sinon, vous risquez d'insérer un saut de ligne ou de page qui créerait une page blanche indésirable.
 +
 +La configuration des lettrines doit être effectuée pour chaque chapitre individuellement. Pour les lettrines, j'ai utilisé le paquet lettrine. Il dispose d'une bonne documentation et de trois exemples de documents. J'ai choisi de n'utiliser aucune option, de faire en sorte que la première lettre du premier mot d'un chapitre occupe deux lignes et le reste du premier mot en petites capitales. (Voir l'image d'accompagnement dans ce numéro.) Cette opération a dû être effectuée pour chaque chapitre séparément, ce qui était un peu fastidieux pour trente-deux chapitres. Je suis néanmoins satisfait du résultat.
 +
  
 **To get the document ready for printing as a book, some margin adjustments are required. Books are printed on both sides of the sheet of paper. In order to bind the pages into a book, the right-hand side of the left pages and the left-hand side of the right pages must be set wide enough so there is extra paper which will be used in the binding process. In book printing terminology, these two margins are the inside margins. Usually inside margins are larger than outside margins. It is also customary for bottom margins to be larger than top margins. **To get the document ready for printing as a book, some margin adjustments are required. Books are printed on both sides of the sheet of paper. In order to bind the pages into a book, the right-hand side of the left pages and the left-hand side of the right pages must be set wide enough so there is extra paper which will be used in the binding process. In book printing terminology, these two margins are the inside margins. Usually inside margins are larger than outside margins. It is also customary for bottom margins to be larger than top margins.
Ligne 21: Ligne 42:
 This is a children’s book and needs to be sized to fit a child’s hand. Standard letter paper is too large. After measuring some children’s books in my house I decided to set the page size to 230mm * 150mm (9in * 6in). Outside margins will be 25mm, inside margins will be the same. Contents will start 20mm from the top. The bottom margin will be 40mm, this includes the space for page numbers. These measurements need to be set in the options for the geometry package. You can see the code in the accompanying image.** This is a children’s book and needs to be sized to fit a child’s hand. Standard letter paper is too large. After measuring some children’s books in my house I decided to set the page size to 230mm * 150mm (9in * 6in). Outside margins will be 25mm, inside margins will be the same. Contents will start 20mm from the top. The bottom margin will be 40mm, this includes the space for page numbers. These measurements need to be set in the options for the geometry package. You can see the code in the accompanying image.**
  
-**In an Internet search, I found only one illustration suitable to this particular book. I had expected to find several good images and some not-so-good images. I guess either the original book did not have many illustrations, or the images are still protected by copyright. The image is of Whitefoot and Mrs. Whitefoot, so it belongs near the end of the story. The Latex code for the image contains a few explanations in comments.+Pour préparer le document à l'impression sous forme de livre, certains ajustements de marges sont nécessaires. Les livres sont imprimés recto-verso. Pour relier les pages, le côté droit des pages de gauche et le côté gauche des pages de droite doivent être suffisamment larges pour permettre la reliure. En librairie, ces deux marges sont les marges intérieures. Généralement, les marges intérieures sont plus grandes que les marges extérieures. Il est également courant que les marges inférieures soient plus grandes que les marges supérieures. 
 + 
 +Ceci est un livre pour enfants et doit être dimensionné pour la main d'un enfant. Le papier standard au format letter est trop grand. Après avoir mesuré certains livres pour enfants chez moi, j'ai décidé de définir le format de page à 230 mm x 150 mm (9 pouces x 6 pouces). Les marges extérieures seront de 25 mm, les marges intérieures seront identiques. Le contenu commencera à 20 mm du haut. La marge inférieure sera de 40 mm, espace pour la numérotation des pages inclus. Ces mesures doivent être définies dans les options du paquet geometry. Le code est présenté page 27 en haut. 
 + 
 + 
 +**In an Internet search, I found only one illustration suitable to this particular book. I had expected to find several good images and some not-so-good images. I guess either the original book did not have many illustrations, or the images are still protected by copyright. The image is of Whitefoot and Mrs. Whitefoot, so it belongs near the end of the story. The LaTeX code for the image contains a few explanations in comments.
  
 Code to insert an image is shown above. Code to insert an image is shown above.
Ligne 29: Ligne 55:
 As I have said before, I intend to print the PDF and then bind it into a book. That means I need to print on two sides of each sheet of paper. Organizing the pages into the desired page layout and getting them to print in the correct order is called imposition. This is the last important task before printing. All of the publisher’s design choices must be finished before imposition.** As I have said before, I intend to print the PDF and then bind it into a book. That means I need to print on two sides of each sheet of paper. Organizing the pages into the desired page layout and getting them to print in the correct order is called imposition. This is the last important task before printing. All of the publisher’s design choices must be finished before imposition.**
  
-**The pgfmorepages package seems to be a reasonable choice to use for imposition with Latex. It can reduce four pages of text to two pages (1 sheet) of paper or eight pages to four pages (2 sheets). This package presented two problems for me. It puts four pages into two by reducing the type by 50%. That means the text of page 5 for example remains on page 5 but it is difficult to read. Of course I can solve that by doubling the default size of the text before applying pgfmorepages. Adjusting the font can mean generating more widows, which will be corrected with the no-widows package. It also means a page-by-page review to look for orphans and for any unnecessary blank pages. Any linebreak or pagebreak commands would also have to be examined to find out if they are still appropriate.+Lors d'une recherche sur Internet, je n'ai trouvé qu'une seule illustration adaptée à ce livre. Je m'attendais à trouver plusieurs bonnes images et d'autres moins bonnes. Je suppose que le livre original ne comportait pas beaucoup d'illustrations, ou que les images sont encore protégées par le droit d'auteur. L'image représente Whitefoot et Mme Whitefoot, elle se situe donc vers la fin de l'histoire. Le code LaTeX de l'image contient quelques explications dans les commentaires. 
 + 
 +Le code permettant d'insérer une image est présenté ci-dessus. 
 + 
 +J'ai testé un paquet appelé zwpagelayout. Je pense qu'il pourrait remplacer utilement le paquet geometry. Il inclut certaines fonctionnalités que je souhaitais utiliser pour ce livre. Après avoir lu la documentation à plusieurs reprises, je n'ai pas réussi à comprendre comment activer ces fonctionnalités supplémentaires. Zwpagelayout n'offrait aucun avantage par rapport à geometry. Comme j'étais plutôt satisfait de la mise en page obtenue avec geometry, j'ai abandonné zwpagelayout. Cela vaut la peine d'apprendre, mais cela me prendra plus de temps que prévu. 
 + 
 +Comme je l'ai déjà dit, je compte imprimer le PDF et le relier pour en faire un livre. Cela signifie que je dois imprimer chaque feuille recto-verso. Organiser les pages selon la mise en page souhaitée et les imprimer dans le bon ordre s'appelle l'imposition. C'est la dernière étape importante avant l'impression. Tous les choix de conception de l'éditeur doivent être finalisés avant l'imposition. 
 + 
 + 
 +**The pgfmorepages package seems to be a reasonable choice to use for imposition with LaTeX. It can reduce four pages of text to two pages (1 sheet) of paper or eight pages to four pages (2 sheets). This package presented two problems for me. It puts four pages into two by reducing the type by 50%. That means the text of page 5 for example remains on page 5 but it is difficult to read. Of course I can solve that by doubling the default size of the text before applying pgfmorepages. Adjusting the font can mean generating more widows, which will be corrected with the no-widows package. It also means a page-by-page review to look for orphans and for any unnecessary blank pages. Any linebreak or pagebreak commands would also have to be examined to find out if they are still appropriate.
  
 The other is an issue for binding, not for printing. If I accept the eight pages into four pages then the first eight pages will print as a group. When this group is folded together they will make a two-sheet signature. I would prefer to work with sixteen-page or four-sheet signature when I come to bind this book. The documentation for pgfmorepages has a sample to help with defining a new layout. There are many comments. In the future, I may try to make a new layout which will be 16 text pages on eight physical pages (four sheets of paper), book format.** The other is an issue for binding, not for printing. If I accept the eight pages into four pages then the first eight pages will print as a group. When this group is folded together they will make a two-sheet signature. I would prefer to work with sixteen-page or four-sheet signature when I come to bind this book. The documentation for pgfmorepages has a sample to help with defining a new layout. There are many comments. In the future, I may try to make a new layout which will be 16 text pages on eight physical pages (four sheets of paper), book format.**
  
-**Because of time pressure (not from FCM but from other things in my life), I decided to abandon the pgfmoreages package. My desire to bind Whitefoot the Wood Mouse is a personal one. I need to be able to use Latex to make a PDF with appropriate page sizes and crop marks for a children’s book. Generating that PDF can wait a little while. The final code for the preamble and the heading for the first chapter accompanies this text.+Le paquet pgfmorepages semble être un choix judicieux pour l'imposition avec LaTeX. Il permet de réduire quatre pages de texte en deux pages (1 feuille) ou huit pages en quatre pages (2 feuilles). Ce paquet m'a posé deux problèmes. Il divise quatre pages en deux en réduisant la police de 50 %. Par exemple, le texte de la page 5 reste sur la page 5, mais il est difficile à lire. Je peux bien sûr résoudre ce problème en doublant la taille par défaut du texte avant d'appliquer pgfmorepages. Ajuster la police peut entraîner la génération de plus de veuves, ce qui sera corrigé avec le paquet no-widows. Cela implique également une vérification page par page pour détecter les pages orphelines et les pages blanches inutiles. Les commandes de saut de ligne ou de page doivent également être examinées pour vérifier leur pertinence. 
 + 
 +L'autre problème concerne la reliure, et non l'impression. Si je convertis huit pages en quatre pages, les huit premières s'imprimeront ensemble. Une fois ce groupe plié, elles formeront une signature sur deux feuilles. Je préférerais travailler avec une couverture de seize pages ou de quatre feuilles pour relier ce livre. La documentation de pgfmorepages propose un exemple pour vous aider à définir une nouvelle mise en page. Les commentaires sont nombreux. À l'avenir, j'essaierai peut-être de créer une nouvelle mise en page de seize pages de texte sur huit pages physiques (quatre feuilles de papier), au format livre. 
 + 
 + 
 +**Because of time pressure (not from FCM but from other things in my life), I decided to abandon the pgfmoreages package. My desire to bind Whitefoot the Wood Mouse is a personal one. I need to be able to use LaTeX to make a PDF with appropriate page sizes and crop marks for a children’s book. Generating that PDF can wait a little while. The final code for the preamble and the heading for the first chapter accompanies this text
 + 
 +For now that is the end of our adventures with Whitefoot. Next issue, I will resume my perusal of some of the packages available at ctan.org. There are sixteen topics starting with I and seven starting with J. In those two groups, I will look for topics that might be of general interest. If you have any special requests for tasks you want to do in LaTeX, send me an email (rboardman@psmail.net). Talk to you again in the next issue.** 
 + 
 +En raison de contraintes de temps (non pas liées au FCM, mais à d'autres facteurs), j'ai décidé d'abandonner le paquet pgfmorepages. Mon désir de relier Whitefoot la Souris des Bois est personnel. J'ai besoin de pouvoir utiliser LaTeX pour créer un PDF avec des tailles de page et des repères de coupe appropriés pour un livre pour enfants. La génération de ce PDF peut attendre un peu. Le code final du préambule et du titre du premier chapitre accompagne ce texte.
  
-For now that is the end of our adventures with Whitefoot. Next issueI will resume my perusal of some of the packages available at ctan.org. There are sixteen topics starting with and seven starting with J. In those two groupsI will look for topics that might be of general interestIf you have any special requests for tasks you want to do in Latexsend me an email (rboardman@psmail.net). Talk to you again in the next issue.**+Pour l'instant, c'est la fin de nos aventures avec Whitefoot. Dans le prochain numéroje reprendrai mon examen de certains des paquets disponibles sur ctan.org. Il y a seize sujets commençant par et sept commençant par J. Dans ces deux groupesje rechercherai des sujets susceptibles d'intéresser un public généralSi vous avez des demandes particulières concernant des tâches que vous souhaitez effectuer dans LaTeXenvoyez-moi un courriel (rboardman@psmail.net). À bientôt dans le prochain numéro.
issue219/latex.txt · Dernière modification : 2025/07/30 09:24 de d52fr