Draw and Scribble Notes in GNU Emacs

 


 

SVG seems to be quite handy for quick note-taking. You can easily draw simple shapes and augment it with some freehand drawing. Combined with excellent keyboard editing of Emacs, you'll not miss anything while taking notes.

Note: These instructions are for the development version of package and hence might change.
 

Installation

Till my patch is merged in Emacs core (see https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00798.html), you'll need to add following commands in your init file (~/.emacs) to use it.
 
;; Assuming you have downloaded svg.el to ~/
(load "~/svg.el")
(require 'svg)


Usage

  1. Run M-x canvas-mode .This will insert an SVG image (400x400 pixels) at the point. If the point already contains an SVG image, it will use the same for drawing.
If you want to edit an existing SVG file, run C-u M-x canvas-mode.
  1. Minibuffer shows the current active shape (default is polyline).

  2. Use keyboard to select appropriate shape, stroke-color, fill-color or stroke width.
  3. Use mouse click and drag to draw the shape.
  4. Selection: Use mouse to draw a rectangular region containing the objects to be selected. Use ESC to cancel selection.
  5. Undo: Undo the last drawn object. If selection is active, deletes the selected objects.
  6. Eraser: Use x to select eraser. However, do remember that erasing in SVG is more like erasing a painting. You are not really removing anything - only adding a white paint in certain regions. You can use polyline with desired fill color and stroke width for finer control.
  7. Zoom: Use selection to zoom in. Use 0 to reset zoom. Use +/- to zoom in/out.
  8. Use s to save the SVG file. Important: Emacs save buffer action will only save the text content. You must save SVG file separately.
  9. Enter q or RETURN to exit the mode.
 
Keyboard commands
l     Line         
c     Circle       
r     Rectangle    
e     Ellipse      
t     Text         
p     Polyline     
w    
Stroke Width      
f    
Fill color     
C    
Stroke color     
z  (+, -, 0)
Zoom
x
Eraser
y    
Selection mode
ESC    
Cancel Selection
s     Save SVG     
u     Undo  
q/RETURN    Quit  

 

FAQ

  • Can text and images be intermixed in a buffer? Yes.
  • Is there an eraser tool? Yes.
  • You need GTK (on Linux) and librsvg support compiled in Emacs for this to work.

 

Comments

Popular posts from this blog

Basic WYSIWYG printing in GNU Emacs

Sheet music in GNU Emacs