more bibtex fields;
authorwenzelm
Thu May 02 14:31:22 2019 +0200 (6 months ago)
changeset 702308ba266889dee
parent 70229 c03f381fd373
child 70231 cdbc8d92c349
more bibtex fields;
src/Pure/Thy/bibtex.scala
     1.1 --- a/src/Pure/Thy/bibtex.scala	Thu May 02 14:05:59 2019 +0200
     1.2 +++ b/src/Pure/Thy/bibtex.scala	Thu May 02 14:31:22 2019 +0200
     1.3 @@ -240,11 +240,17 @@
     1.4      optional_crossref: List[String],
     1.5      optional_other: List[String])
     1.6    {
     1.7 +    val optional_standard: List[String] = List("url", "doi", "ee")
     1.8 +
     1.9      def is_required(s: String): Boolean = required.contains(s.toLowerCase)
    1.10      def is_optional(s: String): Boolean =
    1.11 -      optional_crossref.contains(s.toLowerCase) || optional_other.contains(s.toLowerCase)
    1.12 +      optional_crossref.contains(s.toLowerCase) ||
    1.13 +      optional_other.contains(s.toLowerCase) ||
    1.14 +      optional_standard.contains(s.toLowerCase)
    1.15  
    1.16 -    def fields: List[String] = required ::: optional_crossref ::: optional_other
    1.17 +    def fields: List[String] =
    1.18 +      required ::: optional_crossref ::: optional_other ::: optional_standard
    1.19 +
    1.20      def template: String =
    1.21        "@" + kind + "{,\n" + fields.map(x => "  " + x + " = {},\n").mkString + "}\n"
    1.22    }