git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: allow includes with dots like cc_by_4.0.

Previously the `.0` was interpreted as a file extension, leading pandoc not to add `.tex` (and thus not to find the file). The new behavior matches tex more closely.

commit11810edb2f51fa54af4d5a9a4b3e57a189077919 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 20 Jan 2019, 18:22 (8 years ago) parent26dfab2
1 file changed+5−3
src/Text/Pandoc/Readers/LaTeX.hs+5−3
src/Text/Pandoc/Readers/LaTeX.hs+5−3
@@ -1449,9 +1449,11 @@ include name = do
14491449 fs <- (map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .
14501450 untokenize) <$> braced
14511451 let addExt f = case takeExtension f of
1452− "" | name == "usepackage" -> addExtension f ".sty"
1453− | otherwise -> addExtension f ".tex"
1454− _ -> f
1452+ ".tex" -> f
1453+ ".sty" -> f
1454+ -- note, we can have cc_by_4.0 for example...
1455+ _ | name == "usepackage" -> addExtension f ".sty"
1456+ | otherwise -> addExtension f ".tex"
14551457 dirs <- (splitBy (==':') . fromMaybe ".") <$> lookupEnv "TEXINPUTS"
14561458 mapM_ (insertIncluded dirs) (map addExt fs)
14571459 return mempty