Insert a screenshot image in latex-mode with the help of org-download
The snippet can be accessed without any authentication.
Authored by
Mattia Monga
This snippet binds a key in latex-mode
in spacemacs to a function which:
- takes a screenshot (all the details are delegated to
org-download
) - saves it in the current working directory
- inserts an
\includegraphics
with the saved image
custom.el 591 B
(spacemacs/set-leader-keys-for-major-mode 'latex-mode "is"
'("Take a screenshot" . (lambda ()
"Save a screenshot in the working dir and includegraphics it"
(interactive)
(require 'org-download)
(org-download-screenshot)
(insert "\\includegraphics[width=\\columnwidth]{"
(file-name-nondirectory org-download-path-last-file)
"}")
)))
Please register or sign in to comment