# NOT RUN {
pdf("MPG.pdf", height=4, width=4)
hist(mtcars$mpg)
dev.off()
lazy.figure("MPG.pdf")
lazy.write(
lazy.file.start(),
lazy.figure("MPG.pdf",
caption="Distribution of Miles per Gallon in mtcars dataset",
height=5, width=5, label="MPGgraph"),
lazy.file.end(),
OutFile="Example-1.tex")
unlink("MPG.pdf")
unlink("Example-1.tex")
unlink("Example-1.pdf")
# }
Run the code above in your browser using DataLab