Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Bibtex: Use type field to further specify mastersthesis or phdthesis.
Browse files Browse the repository at this point in the history
See #98.
  • Loading branch information
jgm committed May 6, 2015
1 parent 6bc2923 commit 5cf38dd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Text/CSL/Input/Bibtex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ itemToReference lang locale bibtex = bib $ do
isEvent <- (True <$ (getRawField "eventdate"
<|> getRawField "eventtitle"
<|> getRawField "venue")) <|> return False
reftype' <- resolveKey lang <$> getField "type" <|> return mempty
let (reftype, refgenre) = case et of
"article"
| st == "magazine" -> (ArticleMagazine,mempty)
Expand All @@ -775,7 +776,9 @@ itemToReference lang locale bibtex = bib $ do
"inreference" -> (EntryEncyclopedia,mempty)
"inproceedings" -> (PaperConference,mempty)
"manual" -> (Book,mempty)
"mastersthesis" -> (Thesis, Formatted [Str $ resolveKey' lang "mathesis"])
"mastersthesis" -> (Thesis, if reftype' == mempty
then Formatted [Str $ resolveKey' lang "mathesis"]
else reftype')
"misc" -> (NoType,mempty)
"mvbook" -> (Book,mempty)
"mvcollection" -> (Book,mempty)
Expand All @@ -787,7 +790,9 @@ itemToReference lang locale bibtex = bib $ do
| st == "magazine" -> (ArticleMagazine,mempty)
| st == "newspaper" -> (ArticleNewspaper,mempty)
| otherwise -> (ArticleJournal,mempty)
"phdthesis" -> (Thesis, Formatted [Str $ resolveKey' lang "phdthesis"])
"phdthesis" -> (Thesis, if reftype' == mempty
then Formatted [Str $ resolveKey' lang "phdthesis"]
else reftype')
"proceedings" -> (Book,mempty)
"reference" -> (Book,mempty)
"report" -> (Report,mempty)
Expand Down Expand Up @@ -822,7 +827,6 @@ itemToReference lang locale bibtex = bib $ do
"letters" -> (PersonalCommunication,mempty)
"newsarticle" -> (ArticleNewspaper,mempty)
_ -> (NoType,mempty)
reftype' <- resolveKey lang <$> getField "type" <|> return mempty

-- hyphenation:
let defaultHyphenation = case lang of
Expand Down

0 comments on commit 5cf38dd

Please # to comment.