Skip to content
Snippets Groups Projects

Insert a screenshot image in latex-mode with the help of org-download

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    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:

    1. takes a screenshot (all the details are delegated to org-download)
    2. saves it in the current working directory
    3. inserts an \includegraphics with the saved image
    Edited
    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)
                                          "}")
                                  )))
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment