]> git.lyx.org Git - features.git/commitdiff
New tag MaxCiteNames
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 7 Jan 2017 15:44:27 +0000 (16:44 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 7 Jan 2017 15:44:27 +0000 (16:44 +0100)
This determines the number of authors before "et al.". We had it
hardcoded to 2, but actually the nuumber differs.

lib/citeengines/basic.citeengine
lib/citeengines/jurabib.citeengine
lib/citeengines/natbib.citeengine
lib/scripts/layout2layout.py
src/TextClass.cpp
src/TextClass.h

index e16d466b1dc18abd88aa4140b24eb09b19816c02..a850f07f98e1a72582be1f9dd7bbd06c084a0ced 100644 (file)
@@ -7,7 +7,7 @@
 
 # Author: Julien Rioux <jrioux@lyx.org>
 
-Format 62
+Format 63
 
 # The framework (biblatex|bibtex)
 CiteFramework bibtex
index c0c5b9748a791f7c72bc309831aaa8e83a9e0549..50c74bdb050003c6af79572a7511143a66c95fda 100644 (file)
@@ -8,7 +8,7 @@
 
 # Author: Julien Rioux <jrioux@lyx.org>
 
-Format 62
+Format 63
 
 Requires jurabib
 
@@ -22,6 +22,9 @@ CiteEngineType authoryear
 # Default style file
 DefaultBiblio  jurabib
 
+# Maximum number of names before "et al." chimes in
+MaxCiteNames 3
+
 
 # The syntax of the cite command definitions below is:
 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
index ca6c8b829fb5c92635bde68739f0e4aa782cb889..0eee3cc840a0c9a68b7bbef86b81ced3492fbca8 100644 (file)
@@ -9,7 +9,7 @@
 
 # Author: Julien Rioux <jrioux@lyx.org>
 
-Format 62
+Format 63
 
 Requires natbib
 
@@ -23,6 +23,9 @@ CiteEngineType authoryear|numerical
 # Default style files for either engine type
 DefaultBiblio  authoryear:plainnat|numerical:plainnat
 
+# Maximum number of names before "et al." chimes in
+MaxCiteNames 2
+
 
 # The syntax of the cite command definitions below is:
 # LyXName|alias*<!_stardesc!_stardesctooltip>[][]=latexcmd
index c0829e6cd46009292d2c2c9e7f4e09b14eaced33..d932700bb4771025c286e3497067209e4595085f 100644 (file)
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 62
+currentFormat = 63
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -208,6 +208,10 @@ currentFormat = 62
 # Incremented to format 62, 21 October 2016 by spitz
 # New Layout argument tag "PassThru"
 
+# Incremented to format 63, 7 January 2017 by spitz
+# - New textclass tags CiteFramework, MaxCiteNames (for cite engines)
+# - Extended InsetCite syntax.
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -451,7 +455,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if format >= 60 and format <= 61:
+        if format >= 60 and format <= 62:
             # nothing to do.
             i += 1
             continue
index 9e71e1c9a769f480457d8426d432cd8767b2eced..9a51fb0d093ec1561fd9905e99849a5f0a0e4ad9 100644 (file)
@@ -62,7 +62,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 62; //spitz PassThru for arguments.
+int const LAYOUT_FORMAT = 63; //spitz: new tags CiteFramework, MaxCiteNames, extended InsetCite syntax.
 
 
 // Layout format for the current lyx file format. Controls which format is
@@ -155,7 +155,7 @@ TextClass::TextClass()
          outputType_(LATEX), outputFormat_("latex"),
          defaultfont_(sane_font),
          titletype_(TITLE_COMMAND_AFTER), titlename_("maketitle"),
-         min_toclevel_(0), max_toclevel_(0),
+         min_toclevel_(0), max_toclevel_(0), maxcitenames_(2),
          cite_full_author_list_(true)
 {
 }
@@ -222,6 +222,7 @@ enum TextClassTags {
        TC_CITEENGINETYPE,
        TC_CITEFORMAT,
        TC_CITEFRAMEWORK,
+       TC_MAXCITENAMES,
        TC_DEFAULTBIBLIO,
        TC_FULLAUTHORLIST,
        TC_OUTLINERNAME
@@ -256,6 +257,7 @@ LexerKeyword textClassTags[] = {
        { "input",             TC_INPUT },
        { "insetlayout",       TC_INSETLAYOUT },
        { "leftmargin",        TC_LEFTMARGIN },
+       { "maxcitenames",      TC_MAXCITENAMES },
        { "modifystyle",       TC_MODIFYSTYLE },
        { "nocounter",         TC_NOCOUNTER },
        { "nofloat",           TC_NOFLOAT },
@@ -765,6 +767,11 @@ TextClass::ReturnValues TextClass::read(Lexer & lexrc, ReadType rt)
                        citeframework_ = rtrim(lexrc.getString());
                        break;
 
+               case TC_MAXCITENAMES:
+                       lexrc.next();
+                       maxcitenames_ = size_t(lexrc.getInteger());
+                       break;
+
                case TC_DEFAULTBIBLIO:
                        if (lexrc.next()) {
                                vector<string> const dbs =
index 319ea96bd8f67e3b07a330a86bbf7488fc74d3a0..dbfb97436e890f55cc6f92d64b099400feb63cfb 100644 (file)
@@ -335,6 +335,8 @@ protected:
        std::map<std::string, std::string> cite_default_biblio_style_;
        /// Citation command aliases
        std::map<std::string, std::string> cite_command_aliases_;
+       /// The maximum number of citations before "et al."
+       size_t maxcitenames_;
        /// Whether full author lists are supported
        bool cite_full_author_list_;
        /// The possible citation styles
@@ -498,6 +500,8 @@ public:
        ///
        std::map<std::string, std::string> const & citeCommandAliases() const
        { return cite_command_aliases_; }
+       /// The maximum number of citations before "et al."
+       size_t max_citenames() const { return maxcitenames_; }
        ///
        bool const & fullAuthorList() const { return cite_full_author_list_; }
 protected: