Skip to content

Commit

Permalink
[fastgraphics] Support PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRobitaille committed Jun 14, 2022
1 parent cec7cf2 commit 3498aa6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions latex_templates/fastgraphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function string:starts_with(substr)
return self:sub(1, string.len(substr)) == substr
end

function string:ends_with(ending)
return ending == "" or self:sub(-#ending) == ending
end

local function fastincludegraphics(draft, paths, optional, filename)
-- print()
Expand Down Expand Up @@ -104,6 +107,10 @@ local function fastincludegraphics(draft, paths, optional, filename)
return includegraphics(filename)
end

if filename:ends_with('.pdf') then
return includegraphics(filename)
end

if filename:starts_with('/') then
return process_absolute_file(filename)
end
Expand Down

0 comments on commit 3498aa6

Please sign in to comment.