Outils pour utilisateurs

Outils du site


issue173:tutoriel1

If you have been following along, you now have an idea of how to put down text, how to add a picture, and how to insert a table. All you did was learn one little thing per issue. If you use LaTeX for writing a non-fiction book, for instance, or a school paper, you may need to add a bibliography. Like the “share on facebook” buttons you see on a website, some websites have a “cite this” button. Granted, lots of times it may be on academic websites, but there are websites that will help you out too. (https://www.citethisforme.com/, https://www.easybib.com/, https://www.cite.me/, and more). If you have the option, choose “Bibtex”, to make it easy for you. If you would like to see where I got my information from, see: https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM I need you to look under the tools menu in TeXstudio; you will see “bibliography” with the shortcut key ‘F8’. Click ‘bibliography’ or press F8. What happened? Look at your message pane. This is what I got:

Si vous avez bien suivi, vous savez maintenant comment rédiger un texte, ajouter une image et insérer un tableau. Vous n'avez fait qu'apprendre une petite chose par numéro. Si vous utilisez LaTeX pour écrire un livre non romanesque, par exemple, ou un travail scolaire, vous devrez peut-être ajouter une bibliographie. Tout comme les boutons « partager sur facebook » que vous voyez sur un site Web, certains sites Web ont un bouton « citer ce document ». Bien sûr, il s'agit souvent de sites Web universitaires, mais il existe aussi certains sites Web qui peuvent vous aider. (https://www.citethisforme.com/, https://www.easybib.com/, https://www.cite.me/, et d'autres). Si vous en avez la possibilité, choisissez « Bibtex », pour vous faciliter la tâche.

Si vous voulez savoir où j'ai trouvé mes informations, consultez le site https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM.

Regardez dans le menu Outils de TeXstudio et vous verrez « bibliographie » avec le raccourci clavier « F8 ». Cliquez sur « bibliographie » ou appuyez sur F8. Que s'est-il passé ? Regardez votre panneau de message. Voici ce que j'ai obtenu :

Process started: bibtex “tuto”.aux This is BibTeX, Version 0.99d (TeX Live 2017/Debian) The top-level auxiliary file: tuto.aux I found no \citation commands—while reading file tuto.aux I found no \bibdata command—while reading file tuto.aux I found no \bibstyle command—while reading file tuto.aux (There were 3 error messages) Process exited with error(s) Now what? These are the little things that trip up newbies. Do you have any idea what to do? Well, neither did I. (Off to stackexchange I had to rush). Looking up things and cross-referencing them, is a good way to learn, so don’t knock it. Just as a side note: You can configure your shortcut keys in the options, but I am going default here. Vanilla TeXstudio.

Process started: bibtex “tuto”.aux

This is BibTeX, Version 0.99d (TeX Live 2017/Debian) The top-level auxiliary file: tuto.aux I found no \citation commands—while reading file tuto.aux I found no \bibdata command—while reading file tuto.aux I found no \bibstyle command—while reading file tuto.aux (There were 3 error messages)

Process exited with error(s)

Et maintenant ? Ce sont là les petites choses qui font trébucher les débutants. Vous n'avez aucune idée de ce qu'il faut faire ? Eh bien, moi non plus. (J'ai dû me dépêcher d'aller sur stackexchange). Chercher des choses et les recouper est un bon moyen d'apprendre, alors ne critiquez pas.

Juste une note en passant : vous pouvez configurer vos touches de raccourci dans les options, mais je vais utiliser les touches par défaut ici. TeXstudio standard.

To understand how many fields there are in a bibliography file, open a new tab, then click “bibliography” in the menu, then click on “book”. The output on your form should look something like this: So don’t be put off by the bib output that you get on a web page. Just to show you where to look, open this web page please: https://www.bibsonomy.org/bibtex/226d84980b959304913f957400bb993e5/droessler To the right of the page, you will see a ‘copy’ icon, an ‘x’, an ‘open’ icon, and a drop-down arrow. Click the drop-down arrow to reveal the following menu. Now click on ‘BibTeX’. A new window will be displayed with the necessary information. Click on “Copy citation to your local clipboard”.

Pour comprendre combien de champs il y a dans un fichier de bibliographie, ouvrez un nouvel onglet, puis cliquez sur « bibliographie » dans le menu, puis sur « livre ». La sortie sur votre formulaire devrait ressembler à quelque chose comme ceci :

Ne vous laissez donc pas décourager par la sortie bib que vous obtenez sur une page Web.

Pour vous montrer où regarder, ouvrez cette page Web : https://www.bibsonomy.org/bibtex/226d84980b959304913f957400bb993e5/droessler.

À droite de la page, vous verrez une icône « copier », un « x », une icône « ouvrir » et une flèche déroulante. Cliquez sur la flèche déroulante pour faire apparaître le menu suivant.

Cliquez maintenant sur « BibTeX ». Une nouvelle fenêtre s'affiche avec les informations nécessaires. Cliquez sur « Copy citation to your local clipboard » (Copiez la citation dans votre presse-papier local).

The manual way Create a new file and make sure the extension is ‘.bib’. Even if Linux does not care about extensions, TeX does! Explanation from Wikipedia: “ In the words of the program's author Oren Patashnik: Here's how BibTeX works. It takes as input: • an .aux file produced by LaTeX on an earlier run; • a .bst file (the style file), which specifies the general reference-list style and specifies how to format individual entries, and which is written by a style designer [..] in a special-purpose language [..], and • .bib file(s) constituting a database of all reference-list entries the user might ever hope to use. BibTeX chooses from the .bib file(s) only those entries specified by the .aux file (that is, those given by LaTeX's \cite or \nocite commands), and creates as output a .bbl file containing these entries together with the formatting commands specified by the .bst file [..]. LaTeX will use the .bbl file, perhaps edited by the user, to produce the reference list. “

La méthode manuelle

Créez un nouveau fichier et assurez-vous que l'extension est « .bib ». Même si Linux ne se soucie pas des extensions, TeX s'en soucie ! Explication de Wikipedia (traduction du site en anglais) :

« Selon les mots de l'auteur du programme, Oren Patashnik :

Voici comment BibTeX fonctionne. Il prend en entrée : ••un fichier .aux produit par LaTeX lors d'une exécution antérieure ; ••un fichier .bst (le fichier de style), qui spécifie le style général de la liste de référence et la façon de formater les entrées individuelles, et qui est écrit par un concepteur de style […] dans un langage spécialisé […], et ••le(s) fichier(s) .bib constituant une base de données de toutes les entrées de listes de référence que l'utilisateur peut espérer utiliser.

BibTeX ne sélectionne dans le(s) fichier(s) .bib que les entrées spécifiées par le fichier .aux (c'est-à-dire celles données par les commandes \cite ou \nocite de LaTeX), et crée en sortie un fichier .bbl contenant ces entrées ainsi que les commandes de formatage spécifiées par le fichier .bst […]. LaTeX utilisera le fichier .bbl, éventuellement édité par l'utilisateur, pour produire la liste de référence. »

OK, time for some hands-on. Create two new tabs and save them as ref.tex and ref.bib so we can get going. Copy the output from the website above into ref.bib and save it. Then add the “code” (top right) to ref.tex so I can get to explaining. You should be familiar with everything up to \cite. I have cited the article in my reference (ref.bib) by the unique id, which is the first part after the “type of reference” (@article{Lehman2015, Masters2014). Not all references will look this way, so understand where it goes. If you need to cite multiple documents or articles, simply separate your references by commas.

OK, il est temps de mettre la main à la pâte.

Créez deux nouveaux onglets et enregistrez-les sous les noms de ref.tex et ref.bib pour pouvoir commencer.

Copiez le résultat du site Web ci-dessus dans ref.bib et enregistrez-le.

Ajoutez ensuite le « code » (en haut à droite) à ref.tex pour que je puisse commencer à expliquer.

Vous devriez être à l'aise avec tout ce qui va jusqu'à \cite. J'ai cité l'article dans ma référence (ref.bib) par son identifiant unique, qui est la première partie après le « type de référence » (@article{Lehman2015, Masters2014). Toutes les références ne se présentent pas de cette façon, alors comprenez bien où les mettre. Si vous devez citer plusieurs documents ou articles, séparez simplement vos références par des virgules.

Are you with me? Ok, this is where you need to pay attention; bibliographies have style. Yes, you heard me, \bibliographystyle{style}, I use plain, but there are many types: https://www.overleaf.com/learn/latex/Bibtex_bibliography_styles, https://www.bibtex.com/s/bibliography-style-base-plain/ To understand the \bibliography{ref}, I want you to remove it and recompile your document. Seeing is believing. ;) I suggest first getting the ‘how’ down before you start messing with styles; as for newbies, they will not make much sense. As always, please feel free to change anything, make mistakes, have fun. This is how we learn. You know where to send emails: misc@fullcirclemagazine.org

Vous me suivez ? Ok, c'est là où vous devez faire attention ; les bibliographies ont un style. Oui, vous m'avez entendu, \bibliographystyle{style}, j'utilise un style simple (« plain »), mais il en existe plusieurs types : https://www.overleaf.com/learn/latex/Bibtex_bibliography_styles, https://www.bibtex.com/s/bibliography-style-base-plain/

Pour comprendre ce que fait le « \bibliographie{ref} », je veux que vous le supprimiez et recompiliez votre document. Le voir, c'est y croire. ;)

Je vous suggère d'apprendre d'abord le « comment » avant de commencer à jouer avec les styles ; pour les débutants, ils n'auront pas beaucoup de sens. Comme toujours, n'hésitez pas à changer ce que vous voulez, à faire des erreurs, à vous amuser. C'est ainsi que nous apprenons.

Vous savez où envoyer vos e-mails : misc@fullcirclemagazine.org

issue173/tutoriel1.txt · Dernière modification : 2021/09/30 12:01 de auntiee