aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorNathan Gass <gass@search.ch>2010-12-15 11:40:53 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-15 10:21:47 -0800
commit43fee5e7f797b442e0290e9f6e788a6ad67a18b5 (patch)
treee5c36d5abad985d43e319e74ffd354e41a76316d /src/Text/Pandoc
parent63d5e0c5f97ed9b1063187b73e77cd25508a0294 (diff)
downloadpandoc-43fee5e7f797b442e0290e9f6e788a6ad67a18b5.tar.gz
Support multiple bibliography files with natbib and biblatex output.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Shared.hs4
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 6134d879c..f0c6eb378 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -566,7 +566,7 @@ data WriterOptions = WriterOptions
, writerSourceDirectory :: FilePath -- ^ Directory path of 1st source file
, writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
, writerCiteMethod :: CiteMethod -- ^ How to print cites
- , writerBiblioFile :: String -- ^ Biblio file to use for citations
+ , writerBiblioFiles :: [FilePath] -- ^ Biblio files to use for citations
} deriving Show
-- | Default writer options.
@@ -594,7 +594,7 @@ defaultWriterOptions =
, writerSourceDirectory = "."
, writerUserDataDir = Nothing
, writerCiteMethod = Citeproc
- , writerBiblioFile = ""
+ , writerBiblioFiles = []
}
--
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index e791d1332..9ddfc8b84 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -36,6 +36,7 @@ import Data.List ( (\\), isSuffixOf, isPrefixOf, intersperse, intercalate )
import Data.Char ( toLower )
import Control.Monad.State
import Text.PrettyPrint.HughesPJ hiding ( Str )
+import System.FilePath (dropExtension)
data WriterState =
WriterState { stInNote :: Bool -- @True@ if we're in a note
@@ -76,7 +77,7 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
body <- blockListToLaTeX blocks
let main = render body
st <- get
- let biblio = takeWhile ((/=) '.') $ writerBiblioFile options
+ let biblio = intercalate "," $ map dropExtension $ writerBiblioFiles options
citecontext = case writerCiteMethod options of
Natbib -> [ ("biblio", biblio)
, ("natbib", "yes")