2.0 KiB
2.0 KiB
My Own Library of Babel
get-password
- Get Password frompass
pdf2svg
- Export to pdf/png/svg at the same timeaddhdr
- Add hline to tables- Matlab Related
get-password
- Get Password from pass
pass $passname | sed -n 1p
pdf2svg
- Export to pdf/png/svg at the same time
_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]]"
addhdr
- Add hline to tables
(cons (car tbl) (cons 'hline (cdr tbl)))
Matlab Related
matlab-dir
Go to current directory
matlab-init
Initialize matlab
plt-matlab
Plot figures
Some variable can be set by block that expands this org source code block:
path
: specify the path of the figure including the file extension. Can be relative or absolute. If not provided, it will create the figure in the/tmp
folderfig_size
: can specify the size of the figure. If not specify, default will be applied.
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, '-');
ans = exportFig(filepath, 'width', size_strings{1}, 'height', size_strings{2});