New paste Repaste Download
% define a lua macro to print graphic
% #1 = filename stem
% #2= figure width
% #3 = figure height
% #4 = graphic type: pdf, png, etc.
\def\luagraphic#1#2#3#4{%
\directlua{
a = img.new({filename="#1.#4",width="#2",height="#3"})
img.write(a)
}}
hi
\luagraphic{example-image-a}{2cm}{3cm}{pdf}
\bye
Filename: report.tex. Size: 311b. View raw, , hex, or download this file.

This paste expires on 2025-08-10 16:28:14.263277. Pasted through web.