Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
fr:dev:citation_styles:style_editing_step-by-step [2013/06/27 12:05] – [L'éditeur visuel: CSL Visual Editor] gracilefr:dev:citation_styles:style_editing_step-by-step [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-======Modifier les styles CSL - Guide pas-à-pas====== 
  
- 
-=====L'éditeur visuel: "CSL Visual Editor"===== 
- 
-Un éditeur visuel de style CSL a été développé (open-source, il est le fruit d'une collaboration entre la bibliothèque de l'Université Columbia et Mendeley). Il se trouve [[http://editor.citationstyles.org/about/|ici]]. 
-Un guide sommaire d'utilisation est en création (en anglais) [[https://github.com/citation-style-editor/csl-editor/wiki/User-guide-for-the-CSL-Editor|ici]]. Si vous avez toutefois des difficultés à modifier des styles avec l'éditeur visuel, vous pouvez demander de l'aide sur le forum Zotero. Vous pouvez rapporter les bogues [[https://github.com/citation-style-editor/csl-editor/issues|ici]] - assurez-vous de rapporter des erreurs reproductibles par quiconque. (Par ailleurs, le tracker GitHub n'est pas le lieu où poser des questions.) 
- 
-=====Modification manuelle des styles CSL===== 
-Dans un certain nombre de cas, il est plus rapide de modifier manuellement un style. Ce guide indique quels étapes suivre. 
- 
-==== 1 - Commencez par choisir le bon style ==== 
- 
-Commencez par jeter un œil au [[/styles|dépôt des styles Zotero]]. Si vous voulez améliorer un style existant, assurez-vous que vous avez la version la plus récente (le dépôt indique la date et l'heure auxquelles chaque style ont été mis à jour). Si vous voulez créer un nouveau style, trouvez le style qui est le plus proche de vos besoins en utilisant la fonction de prévisualisation (en passant la souris au-dessus du nom du style). 
-La façon la plus simple d'identifier le style le plus proche est d'utiliser la fonction "[[http://editor.citationstyles.org/searchByExample/|Recherche par l'exemple]]" (search by Example) de l'éditeur visuel. 
- 
-**Important** Si vous avez utilisé Zotero 2.0 ou une version antérieure sur votre ordinateur, votre [[/support/zotero_data|répertoire de données Zotero]] contient probablement encore des styles au format CSL 0.8.1. Bien que Zotero 2.1 (et suivants) supporte encore ce vieux format, il est fortement recommandé de toujours commencer avec une version à jour d'un style CSL 1.0 du [[/styles|dépôt des styles Zotero]] ou, si vous voulez modifier un style CSL 0.8.1 non présent dans le dépôt, de commencer par le [[http://citationstyles.org/downloads/upgrade-notes.html#updating-csl-0-8-styles|mettre à jour vers CSL 1.0]]. 
- 
- 
-==== 2 - Edit the Style ==== 
- 
-Download the style you want to edit to your computer, and open it in a (plain) text editor like Notepad on Windows, TextEdit on Mac OS X (select "Make Plain Text" under "Format"), or gedit in Linux. Other options are [[http://notepad-plus-plus.org/|Notepad++]] for Windows, [[http://www.barebones.com/products/TextWrangler/|TextWrangler]] for Mac OS X, [[http://www.oxygenxml.com/|oXygen XML Editor]], [[http://www.thaiopensource.com/nxml-mode/|Emacs in nXML mode]], and [[http://www.jedit.org/|jEdit]], which all support XML syntax highlighting (CSL is an XML-based language) and in some cases also real-time [[https://github.com/citation-style-language/styles/wiki/Validation|validation against the CSL schema]]. 
- 
-Paste the style code into the [[/support/dev/citation_styles/reference_test_pane|Zotero Reference Test pane]], so you instantly see the effect of code changes on the style output. If you make your edits directly in the test pane, save your edits often via your text editor, as changes in the test pane get easily lost. 
- 
-See the [[http://citationstyles.org/citation-style-language/documentation/|documentation page]] of the CSL project website for information on making CSL changes (in particular, make sure to take a look at the [[http://citationstyles.org/downloads/specification.html|CSL specification]]. Below we discuss a few common and simple style edits to get you started. 
- 
-=== Examples Edits ==== 
- 
-==Changing Punctuation== 
- 
-In this example, we want to display the publisher ("CSHL Press") and the location of the publisher ("Cold Spring Harbor, NY") in a bibliographic entry. While this can be achieved with the code 
- 
-<code> 
-<text variable="publisher"/> 
-<text variable="publisher-place"/> 
-</code> 
- 
-this would result in "CSHL PressCold Spring Harbor, NY". Fortunately, we can add some punctuation with the ''prefix'', ''suffix'' and ''delimiter'' attributes. Let's say we want to separate the ''publisher'' and ''publisher-place'' by a comma-space, and wrap the whole in parentheses, i.e. "(CSHL Press, Cold Spring Harbor, NY)". This can be done with: 
- 
-<code> 
-<group delimiter=", " prefix="(" suffix=")"> 
-  <text variable="publisher"/> 
-  <text variable="publisher-place"/> 
-</group> 
-</code> 
- 
-The advantage of use a ''group'' element is that whenever you have a ''publisher'', but no ''publisher-place'', you don't end up with incorrect punctuation: the output would become "(CSHL Press)". If you would set the punctuation directly onto the ''text'' elements, e.g. 
- 
-<code xml> 
-<text variable="publisher" prefix="("/> 
-<text variable="publisher-place" prefix=", " suffix=")"/> 
-</code> 
- 
-you would lose the closing bracket, i.e. "(CSHL Press". 
- 
-== Changing Et-al Abbreviation == 
- 
-There are two main settings for et-al abbreviation (e.g., rendering the names "Doe, Smith & Johnson" as "Doe et al."). The minimum number of names that activates et-al abbreviation, and the number of names shown before "et al.". 
- 
-In CSL, these settings can appear on the ''style'', ''citation'', ''bibliography'' or ''names'' elements in the form of the ''et-al-min'' and ''et-al-use-first'' attributes (it is possible to have separate settings for items that have been cited previously by using the ''et-al-subsequent-min'' and ''et-al-subsequent-use-first'' attributes). 
- 
-For example, 
- 
-<code xml> 
-<citation et-al-min="3" et-al-use-first="1"> 
-  ... 
-</citation> 
-</code> 
- 
-will result in name lists like "Doe", "Doe & Smith" and, if there are three or more names, "Doe et al.". Try changing these numbers and observe the effect. 
- 
-==Changing Disambiguation== 
- 
-CSL offers multiple methods to disambiguate cites or names. For example, a style might normally render only the family name (e.g., "(Doe 1999, Doe 2002)"). If the authors are Jane Doe and Thomas Doe, these names can be disambiguated by adding initials or the full given names (e.g., "(J. Doe 1999, T. Doe 2002)"). 
- 
-Disambiguation methods are selected on the ''citation'' element. For example, to disable [[kb/given_name_disambiguation|given name disambiguation]], delete the ''disambiguate-add-givenname'' attribute, e.g. change 
- 
-<code xml> 
-<citation disambiguate-add-givenname="true"> 
-  ... 
-</citation> 
-</code> 
- 
-to 
- 
-<code xml> 
-<citation> 
-  ... 
-</citation> 
-</code> 
- 
-=== Change the Style Title and ID === 
- 
-Before installing your edited style, change the title and ID of your style if you don't want your modified style to overwrite the original style. 
- 
-The style title and ID are stored within the ''<title/>'' and ''<id/>'' elements near the top of the style. For example, 
- 
-<code><title>Harvard Reference format 1 (Author-Date)</title>  
-<id>http://www.zotero.org/styles/harvard1</id></code> 
- 
-can be changed to 
- 
-<code><title>Harvard Style Modified</title> 
-<id>http://www.zotero.org/styles/harvard-modified</id></code> 
- 
-The URLs that you put in as an ID do not have to exist, i.e. you can use a zotero.org/style/mystyle type ID even if the style will not be posted on the Zotero repository. 
- 
-=== Validation === 
- 
-Before installing a modified style, always make sure it is valid XML and CSL by [[https://github.com/citation-style-language/styles/wiki/Validation|validating against the CSL schema]]. 
- 
-==== 3 - Install your Edited Style with Zotero ==== 
-===Zotero for Firefox=== 
-Save the style with a ".csl" file extension (you can generally do this by simply typing ".csl" after the name of your file) , and drag-and-drop the CSL style file onto an open Firefox browser window, and click the "Install" button (you can ignore the grey bar at the top of the window ("This XML style does not appear...")). 
- 
-{{:style_install.png?600}} 
- 
-===Zotero Standalone=== 
-Save the style with a ".csl" file extension (you can generally do this by simply typing ”.csl” after the name of your file). Then, go to the [[/support/preferences/cite|"Cite" tab]] in the Zotero [[/support/preferences|preferences]]. Click on the + sign below the list of installed styles. In the file selection dialogue that opens, navigate to the .csl file you just created and open it. This will install your new style. 
-==== 4 - Sharing Styles ==== 
- 
-If you think that your modified style might be useful to other people, consider [[https://github.com/citation-style-language/styles/blob/master/CONTRIBUTING.md|submitting]] it to the [[/styles|Zotero Style Repository]]. 
- 
-==== Getting Help ==== 
- 
-If you get stuck at any point, try searching the [[/forum/|Zotero forums]], or, if that doesn't give an answer, post in the forum's [[/forum/11/|styles section]].  
fr/dev/citation_styles/style_editing_step-by-step.1372349151.txt.gz · Last modified: 2013/06/27 12:05 by gracile