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.
This commit is contained in:
parent
26dfab2e61
commit
11810edb2f
1 changed files with 5 additions and 3 deletions
|
@ -1449,9 +1449,11 @@ include name = do
|
|||
fs <- (map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .
|
||||
untokenize) <$> braced
|
||||
let addExt f = case takeExtension f of
|
||||
"" | name == "usepackage" -> addExtension f ".sty"
|
||||
| otherwise -> addExtension f ".tex"
|
||||
_ -> f
|
||||
".tex" -> f
|
||||
".sty" -> f
|
||||
-- note, we can have cc_by_4.0 for example...
|
||||
_ | name == "usepackage" -> addExtension f ".sty"
|
||||
| otherwise -> addExtension f ".tex"
|
||||
dirs <- (splitBy (==':') . fromMaybe ".") <$> lookupEnv "TEXINPUTS"
|
||||
mapM_ (insertIncluded dirs) (map addExt fs)
|
||||
return mempty
|
||||
|
|
Loading…
Add table
Reference in a new issue