I installed texlive-bin for pdftolatex binary and texlive-latexextra
because without it inkscape complains that standalone.cls is missing and
fails to render LaTex equation.
I use inkscape to create diagrams in the notes I type in markdown. The diagram
creation process actually begins from neovim, with the keybinding <C-s> which
copies svg template file (which is just an A4 landscape page created with
inkscape itself) at ~/.config/inkscape/templates/A4_landscape.svg. The second
tab below contains the code that creates the function and the binding.
vim.keymap.set({"i"},"<C-s>",function()localdirpath=vim.fn.expand("%:p:h").."/img"localimgname=os.time()..".svg"-- A shell script to paste image from clipboard into subdir imglocalshell_script=string.format([[ DIRPATH=%s IMGFNAME=%s if ! [ -d $DIRPATH ] then mkdir $DIRPATH fi cp ~/.config/inkscape/templates/A4_landscape.svg $DIRPATH/$IMGFNAME ]],dirpath,imgname)vim.fn.system(shell_script)-- All this is just to insert markdown image linklocalrow,col=unpack(vim.api.nvim_win_get_cursor(0))locallines=vim.api.nvim_buf_get_lines(0,row-1,row,false)localmarkdown_link=string.format("",imgname,imgname)-- Check if the 'lines' table is emptylocalline=""if#lines~=0thenline=lines[1]:gsub("\n"," ")endlocalnew_line=line..markdown_linkvim.api.nvim_buf_set_lines(0,row-1,row,false,{new_line})vim.api.nvim_win_set_cursor(0,{row,col+#markdown_link})end,{desc="Copy SVG template into img directory"})
The bezier pen tool combined with node tool is how you create shapes. Prefer the
Fill and Stroke (Object > Fill and Stroke) which appears on RHS for setting the colors
and boundary appearance —whether you want it dotted, solid, dashed etc. Fill and Stroke
enables you to specify exact color values in HSL/HSV/RGB.