[NTG-context] Simple rings with svg
Aditya Mahajan
adityam at umich.edu
Thu May 10 18:50:42 CEST 2012
On Thu, 10 May 2012, Hans Hagen wrote:
> On 10-5-2012 16:59, Aditya Mahajan wrote:
>> On Thu, 10 May 2012, Ian Lawrence wrote:
>>
>>> I read on the wiki that now svg is natively supported. Hmm.
>>
>> No. You need to have inkscape installed (and in your PATH) for svg to
>> pdf conversion to work.
>>
>>> FWIW, I cannot find the intermediate file
>>> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
>>> are in the same location, both exist, both are named correctly….
>>
>> @Hans, could we change the conversion so that it checks for inkscape and
>> gives a more sensible warning if inkscape is absent?
>
> so what is a robust check ...
How about just implementing the unix which command in lua?
(untested code)
function which(string file)
local path = os.getenv("PATH")
local splitter = lpeg.splitat(io.fileseparator)
local directories = lpeg.match(splitter, path)
for dir in directories
if io.exists(file.join(dir,file)) then
return true
end
end
return false
end
More information about the ntg-context
mailing list