Set up a chunk hook for manually saved plots.

library(knitr)
knit_hooks$set(custom.plot = hook_plot_custom)

A single plot.

library(ggplot2)
qplot(speed, dist, data = cars)
gridSVG::grid.export(fig_path(".svg"))

plot of chunk test-a

library(ggplot2)
p = qplot(speed, dist, data = cars)
p + geom_smooth()
gridSVG::grid.export(fig_path("1.svg"))
p + geom_jitter()
gridSVG::grid.export(fig_path("2.svg"))

plot of chunk test-bplot of chunk test-b

See the source document of this post at http://stackoverflow.com/q/23852753/559676