This approach for storing dotfiles was inspired by https://www.atlassian.com/git/tutorials/dotfiles.
I added an alias for make to potential automatically run it with my generic Makefile. Below is a summary of the various situations that can occur:
| Makefile exists | Template Makefile exists | Run |
|---|---|---|
| yes | yes | Regular make |
| yes | no | Regular make |
| no | yes | Make with Template Makefile |
| no | no | Regular make |
For automatic recipe of Matlab scripts, include a comment block starting with % !build and ending with % !end-build. For example, the following:
% !build
% depends: src/script1.m
% to: figure.eps table.md
% !end-buildwhere:
depends: src/script1.mmeans that the artifacts produced by the script depend on thescript1.m. In other words,makewill automatically reproduce the artifacts if there is a change inscript1.meven if no changes were made to the original script. To determine the dependencies of a script, Matlab has a built-in command:
fList = matlab.codetools.requiredFilesAndProducts('myScript.m');
for ind = 1:numel(fList)-1
disp(fList{ind});
endwhich produces a list of user-generated dependencies (does not include built-in or toolbox commands). The list of dependencies can be generated at the command line via:
DEPS=`matlab -batch "fList = matlab.codetools.requiredFilesAndProducts('script.m'); \
for ind = 1:numel(fList)-1; disp(fList{ind}); end; exit;"
| sed 's/MATLAB is selecting SOFTWARE OPENGL rendering.//'This command takes some time to open Matlab and so is not included in the automatic recipe generation process. In the future, perhaps, this could be modified to find all Matlab source files and then, call Matlab once.
to: figure.eps table.mdmeans that the artifacts produced by the script arefigure.epsandtable.md.
The recipe generation currently supports automatically adding dependencies by reading the file.
- Figure via Pandoc Markdown
This will add the dependency

fig.pngto the recipe - Figure/file via Latex command:
\include{file.tex} \includegraphics[width=0.5\columnwidth]{fig/fig.eps}
- File via
!include:!include("file.txt") - Input Latex command:
\input{file.tex}
- If the source file has CRLF line terminators, the recipe generation may give unexpected results.
- To check for CRLF Line Terminators, run:
file test.m- If the command returns
test.m: ASCII text, with CRLF line terminators, the file has CRLF line terminators. - Currently,
getmakerecipedoes not automatically get rid of CRLF line terminators. There many ways to get rid of them. Here are two examples:- Open source file in
vimand run the command::set fileformat=unixand save the file. - Overwrite all CRLF line terminators:
ortr '^M' '\n' <test.m >test.m
tr '\r' '\n' <test.m >test.m
- Open source file in
# pacman -S powerline powerline-fonts
# pip3 install powerline-statusThe fonts might not work, so use the git repo.