BaroqueW

BaroqueW

and his sidekick nikkitaa

BaroqueW RSS Feed
 
 
 
 

Archive for December 8th, 2007

West End Highlights

La semaine passée, Kittaa et moi nous sommes rendus à la balettakademien (oui oui, un seul L en suédois) pour assister à un showcase par West End Highlights. Une partie de la troupe a interprété des extraits des comédies musicales le Fantôme de l’Opéra, Les Misérables, Chicago, West Side Story et quelques autres. Les quatre membres présents étaient Kimberley Akester, John Martin Bengtsson, Johan Christer Novsjø et Gabriella Khan.

La représentation a duré une trentaine de minutes et était gratuite (encore fallait-il être au courant… de toute façon la salle ne faisait guère que 30 ou 40 places, principalement occupées par la famille, les amis et des agents/impressarios/recruteurs, et oui, c’est un showcase). Sur le point de vue musical, je ne m’avancerai pas trop, j’ai reconnu Chicago grâce au film mais le reste m’était inconnu, peu passionné que je suis par les comédies musicales. Dans l’ensemble c’était bien interprété (chanté ET joué), à part par Mlle Akester qui à mon avis ferait mieux de travailler sa voix qui déraille dans les aigus et son jeu qui… qui rien, justement. Mention spéciale aussi pour l’extrait de Blues in the Night qui réunissait les quatre chanteurs et qui était fort réussi ma foi.

Category: Articles en français, Musique, Théâtre | Leave a comment

Latex - How to create a glossary?

To ease the reading of your technical reports, that usually end up being crowded with abbreviations, it’s good to add a glossary to them. Here is an example of how to add a glossary to a LaTeX file. In this case, the glossary chapter is not numbered (\chapter*) but is listed in the table of contents (\addcontentsline{toc}{chapter}{Glossary}).

  1. \makeglossary
  2. \begin{document}
  3.  
  4. This website is done in PHP\glossary{[PHP] PHP Hypertext Preprocessor}.
  5.  
  6. %%%%%%%%%%%
  7. %debut du glossaire%
  8. %%%%%%%%%%%
  9.  
  10. \chapter*{Glossary}\label{glossary}\addcontentsline{toc}{chapter}{Glossary}
  11.  
  12. \begin{itemize}
  13. \input{Glossary}
  14. \end{itemize}
  15. \end{document}

Next is a script you can add in TexShop (MacOSX) to generate the glossary files properly. Click on Macros>Open Macros Editor. Chose “New Item” and copy the script below. You can also associate it to a keyboard shortcut to run it easily after every compilation. To get the glossary in your pdf file, compile your LaTeX files, compile the glossary and recompile your LaTeX files.

  1. –AppleScript direct
  2.  
  3. set fileName to #NAMEPATH#
  4. set n to (number of characters of contents of fileName)
  5. set fileNamequoted to quoted form of fileName
  6. set baseName to do shell script "basename " & fileNamequoted
  7. set m to (number of characters of contents of baseName)
  8. set dirName to quoted form of (characters 1 thru (n-m-1) of fileName as string)
  9.  
  10. set shellScript to "cd " & dirName & ";"
  11. set shellScript to shellScript & "./script.sh;"
  12. do shell script shellScript

Note that the script above requires a file named “script.sh” in the folder containing your .tex files. This file uses a PERL script named “writeglossary.prl” (cf. the end of this post) to create an item list from the glossary data. The entries are then sorted in alphabetical order and deletes the duplicates. Remember to replace “Paper.glo” in the script with ‘Your file’.glo.

  1. #!/bin/tcsh
  2. perl writeglossary.prl Paper.glo > Glossary.tmp
  3. #perl script.pl
  4. perl -e ‘while(<>) {push @lines, $_;}warn "\nSorted $. lines in ascending alphabetical order, ignoring case\n\n";print sort {lc($a) cmp lc($b)}@lines’ Glossary.tmp > Glossary.tex

And here is the file “writeglossary.prl”:

  1. # Simple perl script for converting glossary data (*.glo) files produced by
  2. # Latex and converting them to a form suitable for including
  3. # as a Glossary.tex file in a report.
  4. #
  5. # To use:   perl writeglossary.prl filename.glo > Glossary.tex
  6. # Then, in your Latex report file, set up a "description" environment using \begin{description}
  7. # and use \input{Glossary} to import the formatted glossary items.
  8. # (See me310report.tex for example.)
  9. #
  10. # Started 2 August 2006 -mrc
  11. # Note: Macs and Linux usually have perl installed by default. On Windows you might need
  12. # to install it or else use Visual Basic or simply use find/replace in MS Word to
  13. # accomplish the same string replacements as done by this perl script.
  14.  
  15. ############
  16. # Main loop: keep reading new lines until end of file.
  17. # Next line always goes into $_ and pattern matching is done
  18. # on $_ by default.
  19. line: while (<>) {
  20.  
  21. # Replace any instance of "glossaryentry{" with "item " on every line.
  22. # /g is for global matching (as many times as applies)
  23. s/glossaryentry{/item /g;
  24.  
  25. #Then take what comes before "}" and throw away the rest.
  26. if(/}/){
  27. $_ = $`;
  28. }
  29.  
  30. #Append a newline and print to the output.
  31. print($_,"\n");
  32.  
  33. } # end while(<>)
Category: Articles in English, Tech >> Computer | Leave a comment

Latex - Comment faire un glossaire ?

Pour faciliter la lecture de vos rapports techniques, qui foisonnent toujours d’abréviations, il est bon de leur ajouter un glossaire. Ci-dessous, un exemple de document LaTeX avec glossaire. Notez que le chapitre de glossaire n’est pas numéroté (\chapter*) mais apparaît dans la table des matières (\addcontentsline{toc}{chapter}{Glossary}).

  1. \makeglossary
  2. \begin{document}
  3.  
  4. Ce site est fait en PHP\glossary{[PHP] PHP Hypertext Preprocessor}.
  5.  
  6. %%%%%%%%%%%
  7. %debut du glossaire%
  8. %%%%%%%%%%%
  9.  
  10. \chapter*{Glossary}\label{glossary}\addcontentsline{toc}{chapter}{Glossary}
  11.  
  12. \begin{itemize}
  13. \input{Glossary}
  14. \end{itemize}
  15. \end{document}

Ci-dessous, un script que vous pouvez ajouter à TexShop (MacOSX) pour générer le glossaire proprement. Cliquez sur Macros>Open Macros Editor. Choisissez “New Item” et copiez le script ci-dessous. Associez-lui un raccourci clavier pour régénérer le glossaire rapidement. Pour obtenir le glossaire dans votre pdf, voici la marche à suivre : compilez vos fichiers .tex, compilez votre glossaire et recompilez vos .tex.

  1. –AppleScript direct
  2.  
  3. set fileName to #NAMEPATH#
  4. set n to (number of characters of contents of fileName)
  5. set fileNamequoted to quoted form of fileName
  6. set baseName to do shell script "basename " &amp; fileNamequoted
  7. set m to (number of characters of contents of baseName)
  8. set dirName to quoted form of (characters 1 thru (n-m-1) of fileName as string)
  9.  
  10. set shellScript to "cd " &amp; dirName &amp; ";"
  11. set shellScript to shellScript &amp; "./script.sh;"
  12. do shell script shellScript

Notez que le script ci-dessus nécessite la présence d’un fichier “script.sh” dans le dossier contenant vos fichiers .tex. Ce fichier utilise le script PERL “writeglossary.prl” (ci-dessous) pour générer une liste d’items LaTeX à partir des données du glossaire. Il trie ensuite les entrées dans l’ordre alphabétique et élimine les doublons. Pensez à remplacer “Paper.glo” dans le script ci-dessous par ‘Nom de votre fichier’.glo.

  1. #!/bin/tcsh
  2. perl writeglossary.prl Paper.glo > Glossary.tmp
  3. #perl script.pl
  4. perl -e ‘while(<>) {push @lines, $_;}warn "\nSorted $. lines in ascending alphabetical order, ignoring case\n\n";print sort {lc($a) cmp lc($b)}@lines’ Glossary.tmp > Glossary.tex

Et voilà le fichier “writeglossary.prl”:

  1. # Simple perl script for converting glossary data (*.glo) files produced by
  2. # Latex and converting them to a form suitable for including
  3. # as a Glossary.tex file in a report.
  4. #
  5. # To use:   perl writeglossary.prl filename.glo > Glossary.tex
  6. # Then, in your Latex report file, set up a "description" environment using \begin{description}
  7. # and use \input{Glossary} to import the formatted glossary items.
  8. # (See me310report.tex for example.)
  9. #
  10. # Started 2 August 2006 -mrc
  11. # Note: Macs and Linux usually have perl installed by default. On Windows you might need
  12. # to install it or else use Visual Basic or simply use find/replace in MS Word to
  13. # accomplish the same string replacements as done by this perl script.
  14.  
  15. ############
  16. # Main loop: keep reading new lines until end of file.
  17. # Next line always goes into $_ and pattern matching is done
  18. # on $_ by default.
  19. line: while (<>) {
  20.  
  21. # Replace any instance of "glossaryentry{" with "item " on every line.
  22. # /g is for global matching (as many times as applies)
  23. s/glossaryentry{/item /g;
  24.  
  25. #Then take what comes before "}" and throw away the rest.
  26. if(/}/){
  27. $_ = $`;
  28. }
  29.  
  30. #Append a newline and print to the output.
  31. print($_,"\n");
  32.  
  33. } # end while(<>)
Category: Articles en français, Tech >> Computer | Comments (5)