Change indentation of all blocks.

Use (setq org-src-preserve-indentation t) for Emacs.
This commit is contained in:
2021-01-08 01:26:27 +01:00
parent e7288abcac
commit 3e97711adc
44 changed files with 16060 additions and 15852 deletions

View File

@@ -5,29 +5,29 @@
#+name: get-password
#+begin_src bash :var passname="""
pass $passname | sed -n 1p
pass $passname | sed -n 1p
#+end_src
* =pdf2svg= - Export to pdf/png/svg at the same time
#+name: pdf2svg
#+begin_src sh :var file="" :var ext="svg" :results output
_mydir="$(pwd)";
file=$(echo "$file" | cut -f 2- -d ':');
_figdir=$(dirname "$file");
cd $_figdir;
filename=$(echo "${file##*/}" | cut -f 1 -d '.');
pdftocairo -png -transp -singlefile "$filename.pdf";
pdftocairo -svg "$filename.pdf";
cd "$_mydir";
echo "[[file:$_figdir/$filename.$ext]]"
_mydir="$(pwd)";
file=$(echo "$file" | cut -f 2- -d ':');
_figdir=$(dirname "$file");
cd $_figdir;
filename=$(echo "${file##*/}" | cut -f 1 -d '.');
pdftocairo -png -transp -singlefile "$filename.pdf";
pdftocairo -svg "$filename.pdf";
cd "$_mydir";
echo "[[file:$_figdir/$filename.$ext]]"
#+end_src
* =addhdr= - Add hline to tables
#+name: addhdr
#+begin_src emacs-lisp :var tbl=""
(cons (car tbl) (cons 'hline (cdr tbl)))
(cons (car tbl) (cons 'hline (cdr tbl)))
#+end_src
* Matlab Related
@@ -35,22 +35,22 @@
#+name: matlab-dir
#+begin_src matlab :tangle no :results none :exports none :var current_dir=""
%% Go to current Directory
cd(current_dir);
%% Go to current Directory
cd(current_dir);
%% Initialize ans with org-babel
ans = 0;
%% Initialize ans with org-babel
ans = 0;
#+end_src
** =matlab-init= Initialize matlab
#+name: matlab-init
#+begin_src matlab :results none :exports none
%% Clear Workspace and Close figures
clear; close all; clc;
%% Clear Workspace and Close figures
clear; close all; clc;
%% Intialize Laplace variable
s = zpk('s');
%% Intialize Laplace variable
s = zpk('s');
#+end_src
** =plt-matlab= Plot figures
@@ -60,13 +60,13 @@ Some variable can be set by block that expands this org source code block:
#+name: plt-matlab
#+begin_src matlab :results value raw replace :exports code :var filepath="" :var figsize="normal-normal"
if ~exist('filepath') || length(filepath) < 2
symbols = ['a':'z' 'A':'Z' '0':'9'];
random_string = symbols(randi(numel(symbols),[1 5]));
filepath = ['/tmp/matlab-fig-', random_string];
end
if ~exist('filepath') || length(filepath) < 2
symbols = ['a':'z' 'A':'Z' '0':'9'];
random_string = symbols(randi(numel(symbols),[1 5]));
filepath = ['/tmp/matlab-fig-', random_string];
end
size_strings = strsplit(figsize, '-');
size_strings = strsplit(figsize, '-');
ans = exportFig(filepath, 'width', size_strings{1}, 'height', size_strings{2});
ans = exportFig(filepath, 'width', size_strings{1}, 'height', size_strings{2});
#+end_src