From anonymous, 2 Months ago, written in Plain Text.
Embed
  1.   (defun LaTex-screenshot ()
  2.     "Take a screenshot and insert it into the current LaTex file."
  3.     (interactive)
  4.     (let ((filename (concat (read-file-name "Enter file name:") ".png")))
  5.       (message "Select region...")
  6.       (call-process "/usr/bin/scrot" nil nil nil "-zs" filename)
  7.       (insert (concat "\\includegraphics[width=\\linewidth]{" (file-name-nondirectory filename) "}"))
  8.     ))
  9.   (spacemacs/set-leader-keys-for-major-mode 'latex-mode "is" 'LaTex-screenshot)
  10.