Update Doom Emacs config, snippets and babel library
This commit is contained in:
@@ -30,6 +30,16 @@ echo "[[file:$_figdir/$filename.$ext]]"
|
||||
(cons (car tbl) (cons 'hline (cdr tbl)))
|
||||
#+end_src
|
||||
|
||||
* Python Related
|
||||
** =python-dir= Go to current directory
|
||||
|
||||
#+name: python-dir
|
||||
#+begin_src python :tangle no :results none :exports none :var current_dir=""
|
||||
# Go to current Directory
|
||||
import os
|
||||
os.chdir(current_dir)
|
||||
#+end_src
|
||||
|
||||
* Matlab Related
|
||||
** =matlab-dir= Go to current directory
|
||||
|
||||
|
||||
@@ -424,19 +424,23 @@ $0
|
||||
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
|
||||
#name :Python-Figure
|
||||
# --
|
||||
,#+begin_src jupyter-python :file ${2:filename}.png :results none
|
||||
# Figure - ${1:description}
|
||||
plt.figure(figsize=(${3:1200}/150, ${4:800}/150), dpi=150)
|
||||
plt.clf
|
||||
,#+begin_src python :exports none :results none
|
||||
# ${1:description}
|
||||
fig = plt.figure()
|
||||
$0
|
||||
plt.savefig('figs/$2.pdf', transparent=True, bbox_inches='tight', pad_inches=0)
|
||||
,#+end_src
|
||||
|
||||
,#+begin_src python :tangle no :results output file replace :file
|
||||
plt.savefig('figs/${2:filename}.pdf', bbox_inches='tight', pad_inches=0)
|
||||
,#+end_src
|
||||
|
||||
,#+name: fig:$2
|
||||
,#+caption: $1
|
||||
,#+RESULTS:
|
||||
[[file:figs/$2.png]]
|
||||
#+end_src
|
||||
|
||||
|
||||
** Matlab Specific
|
||||
*** Mconfig
|
||||
#+begin_src conf :tangle ~/.config/doom/snippets/org-mode/mconfig
|
||||
|
||||
Reference in New Issue
Block a user