literate-dotfiles/docs/doom.html

4495 lines
454 KiB
HTML
Raw Normal View History

2020-01-11 22:04:45 +01:00
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
2020-01-12 00:19:16 +01:00
<?xml version="1.0" encoding="utf-8"?>
2020-01-11 22:04:45 +01:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
2020-01-12 00:19:16 +01:00
<!-- 2020-01-12 dim. 00:18 -->
2020-01-11 22:04:45 +01:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Doom Emacs Configuration</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="Dehaeze Thomas" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center;
margin-bottom: .2em; }
.subtitle { text-align: center;
font-size: medium;
font-weight: bold;
margin-top:0; }
.todo { font-family: monospace; color: red; }
.done { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
in ob-*.el */
pre.src-cpp:before { content: 'C++'; }
pre.src-abc:before { content: 'ABC'; }
pre.src-coq:before { content: 'Coq'; }
pre.src-groovy:before { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
ob-shell.el: ob-shell is the only babel language using a lambda to put
the execution function name together. */
pre.src-bash:before { content: 'bash'; }
pre.src-csh:before { content: 'csh'; }
pre.src-ash:before { content: 'ash'; }
pre.src-dash:before { content: 'dash'; }
pre.src-ksh:before { content: 'ksh'; }
pre.src-mksh:before { content: 'mksh'; }
pre.src-posh:before { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.org-right { text-align: center; }
th.org-left { text-align: center; }
th.org-center { text-align: center; }
td.org-right { text-align: right; }
td.org-left { text-align: left; }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { width: 90%; }
/*]]>*/-->
</style>
2020-01-12 00:19:16 +01:00
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
<script type="text/javascript" src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="./js/readtheorg.js"></script>
2020-01-11 22:04:45 +01:00
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
2020-01-11 22:22:46 +01:00
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content">
2020-01-11 22:04:45 +01:00
<h1 class="title">Doom Emacs Configuration</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org1e5264a">Useful Bindings</a></li>
<li><a href="#orgd49c2db">Personal Information</a></li>
<li><a href="#orgcf3b44c">Doom Config</a></li>
<li><a href="#orga2ab779">Evil</a></li>
<li><a href="#orgb339871">Basic</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org0272904">Visual</a></li>
<li><a href="#orgfa0f4d4">Change default alert backend</a></li>
<li><a href="#orgab0c401">Lockfiles</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgc047155">Magit</a></li>
<li><a href="#org13468c6">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org8eadfc6">Make sure to load Org</a></li>
<li><a href="#orge682476">Org General Config</a></li>
<li><a href="#org51f6b69">Org latex fragment</a></li>
<li><a href="#org8afc2de">Org Links</a></li>
<li><a href="#orgcd26239">Org Tagging</a></li>
<li><a href="#org65d0f06">Org Refile</a></li>
<li><a href="#org25ed4f3">Org TODO</a></li>
<li><a href="#org75c66a7">Archive subtrees under the same hierarchy as original in the archive files</a></li>
<li><a href="#orga36def8">Org Agenda</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgf9708e1">General configuration</a></li>
<li><a href="#orgec0c6c0">Org Agenda Custom Views</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb9fc96d">Org Notification based on calendar event</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org1199365">appt-notification script</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org3c5e1f3">Org Structure Template</a></li>
<li><a href="#org9713b96">Org Capture</a></li>
<li><a href="#org839d7a9">Org Export</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgedb7fc4">Basic</a></li>
<li><a href="#org3480957">Ox Latex Subfigure package</a></li>
<li><a href="#org44cf309">Clear page before heading</a></li>
<li><a href="#org253b1f3"><span class="todo TODO">TODO</span> HTML Export</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgfe81dca">MathJax</a></li>
<li><a href="#org9c905cc">Export with css class instead of inline css</a></li>
<li><a href="#org8cdad1c"><span class="todo TODO">TODO</span> MP4 movies</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org1a43ae2">Org LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgac3afe0">Org CdLatex</a></li>
<li><a href="#orgaa26736">LaTeX Classes</a></li>
<li><a href="#org34ec6e9">Basic</a></li>
<li><a href="#orgce10c33">Beamer</a></li>
<li><a href="#org41a7583"><span class="todo TODO">TODO</span> Latex Fragments</a></li>
<li><a href="#org7d55947"><span class="todo TODO">TODO</span> Custom Export - Add Page and Label for LaTeX export</a></li>
<li><a href="#org9d2764e">Number Equations</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org3f8f62d"><span class="todo TODO">TODO</span> View PDF in org mode</a></li>
<li><a href="#org0c85e50">Org Ref</a></li>
<li><a href="#orgbeb4320">Org Noter</a></li>
<li><a href="#org7d49361">Custom key bindings</a></li>
<li><a href="#org9fac18d"><span class="todo TODO">TODO</span> Org-Contacts</a></li>
<li><a href="#org214488a"><span class="todo TODO">TODO</span> Org-Wunderlist</a></li>
<li><a href="#org0a79d9f">Automatically run <code>startblock</code> when opening org-mode files</a></li>
<li><a href="#orga1fc443"><span class="todo TODO">TODO</span> Insert ScreenShot or Picture from Phone</a></li>
<li><a href="#org7902aff"><span class="todo TODO">TODO</span> Render Tables</a></li>
<li><a href="#org66f0a8a">Org Gcal</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org38a8163">Org Babel</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org97bf4fc">Main configuration</a></li>
<li><a href="#orgaf1f268">Special Shortcuts</a></li>
<li><a href="#orgee4e789">Library of Babel</a></li>
<li><a href="#org232fea8">Org-Babel Matlab</a></li>
<li><a href="#orgb2af97c">Default options for Matlab code</a></li>
<li><a href="#org67870de"><span class="todo TODO">TODO</span> Asynchronous execution</a></li>
<li><a href="#org23285e9"><span class="todo TODO">TODO</span> Theme</a></li>
<li><a href="#org737e623">Indentation</a></li>
<li><a href="#org24e5955">Some functions for using Matlab with Org Babel</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org3715862"><code>whos</code> matlab function</a></li>
<li><a href="#org898067f"><code>help</code> matlab function</a></li>
<li><a href="#org393d3e4">Execute selected text</a></li>
<li><a href="#org2d6198d">Specify a Matlab command to run</a></li>
<li><a href="#orgc4aecc0">Execute the current source block with no output</a></li>
<li><a href="#orgdac97cf">Execute the source block and go to the next one</a></li>
<li><a href="#org45afc29">Org-Babel Tangle Subtree</a></li>
<li><a href="#org6a42fd3">Org-Babel Jump to Tangle File</a></li>
<li><a href="#org77395e8">Org-Babel Tangle File and Execute</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgba4e015">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org40b5f06">Basic LaTeX configuration</a></li>
<li><a href="#org0822b20">Master file</a></li>
<li><a href="#orga5f09b3">Pdf Viewer</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgfa81b45">Helm-Bibtex</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org1f30ffc">General Config</a></li>
<li><a href="#org736240d">Open pdf externally</a></li>
<li><a href="#orge872f2d">Special Commands</a></li>
<li><a href="#org29f4b2d">List all element of the bibliography without pdf associated</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org254cc52"><span class="todo TODO">TODO</span> Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb915baf">Setup Matlab Mode</a></li>
<li><a href="#orgb8a016c">Setup Flycheck</a></li>
<li><a href="#org75a9b08"><span class="todo TODO">TODO</span> Setup Company - not working</a></li>
<li><a href="#orgace4163"><span class="todo TODO">TODO</span> Beautify code</a></li>
<li><a href="#orgb85ca7e">Key Bindings</a></li>
<li><a href="#orgc7b5f09">Wrong highlight of comments</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org1e568d2"><span class="todo TODO">TODO</span> Mails With Mu4e</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org5bfee6e">Set default mail user agent to mu4e</a></li>
<li><a href="#orgda797c0">Default config</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org2135bdf">Default behavior</a></li>
<li><a href="#org351ec11">Default folders</a></li>
<li><a href="#org209e099">Default signature and email address</a></li>
<li><a href="#org40bed5b">Saving the attachment to Downloads directory</a></li>
<li><a href="#orgf8442ad">A list of user&rsquo;s e-mail addresses</a></li>
<li><a href="#org7d18a7c">Mail directory shortcuts</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orged0bdad"><span class="todo TODO">TODO</span> Contexts - Email accounts</a></li>
<li><a href="#org292e66b">Receiving emails - Mbsync</a></li>
<li><a href="#org1e17fcb">Sending emails - Msmtp</a></li>
<li><a href="#orgeb454c4">Bookmarks</a></li>
<li><a href="#orge273d2e"><span class="todo TODO">TODO</span> Notifications</a></li>
<li><a href="#orgff62bae">Use Org-Mode Tables In Emails</a></li>
<li><a href="#org21199fc"><span class="todo TODO">TODO</span> Integration with Org-Mode</a></li>
<li><a href="#orga72de06"><span class="todo TODO">TODO</span> When putting something on the Trash, it will be in the archive folder on gmail</a></li>
<li><a href="#orga137f62"><span class="todo TODO">TODO</span> Verify that sending mails with gmail account works and that there is no duplicate</a></li>
<li><a href="#orgdf9660c"><span class="todo TODO">TODO</span> Cheatsheet</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgd5fd766">PDF-Tools</a></li>
<li><a href="#org9828815">Custom command and leader keys</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb4f71cc">Watch LaTeX file using latexmk</a></li>
<li><a href="#org76cc82e">Helm-Bibtex</a></li>
<li><a href="#org2d6c0fe">Open terminal in current directory</a></li>
<li><a href="#orgbefa4d1">Open ranger in current directory</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org3ef34ce">Yassnippets</a></li>
<li><a href="#org59bb8b7">Path for Shell</a></li>
<li><a href="#org6fc5eda">Proxy</a></li>
<li><a href="#org2788625"><span class="todo TODO">TODO</span> Slack</a></li>
<li><a href="#org12d5691"><span class="todo TODO">TODO</span> Neomutt connection</a></li>
<li><a href="#orgdc9453d">Abbreviations</a></li>
<li><a href="#orgda861fb">Other</a></li>
<li><a href="#org0b90463">Doom <code>init.el</code></a></li>
<li><a href="#org973006b">Doom <code>packages.el</code></a></li>
<li><a href="#org2825322">Snippets</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org5528118">LaTeX</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#org4373943">Coordinate</a></li>
<li><a href="#orgd34961c">Draw</a></li>
<li><a href="#org181d202">Node</a></li>
<li><a href="#org9f72371">Path</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#orgf1443b6">Matlab</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orge9ad144">Clear</a></li>
<li><a href="#org92008ce">Function</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
2020-01-12 00:19:16 +01:00
<li><a href="#org3ffdc27">Org Mode</a>
2020-01-11 22:04:45 +01:00
<ul>
2020-01-12 00:19:16 +01:00
<li><a href="#orgb14fbd1">Begin</a></li>
<li><a href="#org259484c">Block</a></li>
<li><a href="#org80d6477">Custom Box</a></li>
<li><a href="#orgb55b3fb">Latex Class</a></li>
<li><a href="#orgad6980c">Name Caption Figure</a></li>
<li><a href="#org95537ff">Bibliography with completion</a></li>
<li><a href="#orge9c5c7e">Cite</a></li>
<li><a href="#orgab1efe3">Ref</a></li>
<li><a href="#orgd15fe60">Beamer - CBOX</a></li>
<li><a href="#orgc07c6da">Code</a></li>
<li><a href="#org2639fc5">Equation</a></li>
<li><a href="#org1d1ff55">Figure</a></li>
<li><a href="#org5751d1a">Frac</a></li>
<li><a href="#org92e9729">Left</a></li>
<li><a href="#org23f90e8">Mconfig</a></li>
<li><a href="#org4b1e650">Mdescription</a></li>
<li><a href="#orgb2291e3">Mfigure</a></li>
<li><a href="#orgf3cbfa9">Mfunction</a></li>
<li><a href="#orgf7999f5">Mheader</a></li>
<li><a href="#org5a5cef9">Minipage</a></li>
<li><a href="#org70b733c">Minit</a></li>
<li><a href="#org30f89d0">Mtable</a></li>
<li><a href="#orgfd7a1cd">Multicolumn</a></li>
<li><a href="#orgc2373d1">Subfigure</a></li>
<li><a href="#orgb52e91a">Table</a></li>
<li><a href="#orge7e429b">Tikz</a></li>
<li><a href="#orgd8391f5">Tikzfig</a></li>
<li><a href="#org9c62abd">Tikzheader</a></li>
<li><a href="#org3e7452d">User-config</a></li>
<li><a href="#org21f61c6">User-init</a></li>
<li><a href="#org61d3113">Wrap</a></li>
2020-01-11 22:04:45 +01:00
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<p>
<a href="https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b">https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b</a>
<a href="https://noelwelsh.com/posts/2019-01-10-doom-emacs.html">https://noelwelsh.com/posts/2019-01-10-doom-emacs.html</a>
<a href="https://dotdoom.netlify.com/config.html">https://dotdoom.netlify.com/config.html</a>
</p>
<p>
Documentation:
</p>
<ul class="org-ul">
<li><a href="https://github.com/hlissner/doom-emacs/blob/develop/docs/index.org">https://github.com/hlissner/doom-emacs/blob/develop/docs/index.org</a></li>
</ul>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1e5264a" class="outline-2">
<h2 id="org1e5264a">Useful Bindings</h2>
<div class="outline-text-2" id="text-org1e5264a">
2020-01-11 22:04:45 +01:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left"><code>spc :</code></th>
<th scope="col" class="org-left">Execute command</th>
</tr>
<tr>
<th scope="col" class="org-left"><code>spc &lt;</code></th>
<th scope="col" class="org-left">Switch to buffer</th>
</tr>
<tr>
<th scope="col" class="org-left"><code>spc X</code></th>
<th scope="col" class="org-left">org-capture</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>spc s s</code></td>
<td class="org-left">Search in buffer with swiper</td>
</tr>
<tr>
<td class="org-left"><code>spc s p</code></td>
<td class="org-left">Search in project</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc p p</code></td>
<td class="org-left">Switch project</td>
</tr>
<tr>
<td class="org-left"><code>spc p t</code></td>
<td class="org-left">TODOs in project</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc o f</code></td>
<td class="org-left">Create frame</td>
</tr>
<tr>
<td class="org-left"><code>spc o e</code></td>
<td class="org-left">Toggle Eshell</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc n l</code></td>
<td class="org-left">Store link</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc g g</code></td>
<td class="org-left">Magit status</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc f r</code></td>
<td class="org-left">Open recent file</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc b B</code></td>
<td class="org-left">Switch to buffer</td>
</tr>
<tr>
<td class="org-left"><code>spc b d</code></td>
<td class="org-left">Kill current buffer</td>
</tr>
<tr>
<td class="org-left"><code>spc b i</code></td>
<td class="org-left">ibuffer</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc tab .</code></td>
<td class="org-left">Switch to workspace</td>
</tr>
<tr>
<td class="org-left"><code>spc tab n</code></td>
<td class="org-left">New workspace</td>
</tr>
<tr>
<td class="org-left"><code>spc tab r</code></td>
<td class="org-left">Rename workspace</td>
</tr>
</tbody>
<tbody>
<tr>
<td class="org-left"><code>spc m A</code></td>
<td class="org-left">org-archive-subtree</td>
</tr>
<tr>
<td class="org-left"><code>spc m I</code></td>
<td class="org-left">org-toggle-inline-images</td>
</tr>
<tr>
<td class="org-left"><code>spc m d</code></td>
<td class="org-left">org-deadline</td>
</tr>
<tr>
<td class="org-left"><code>spc m e</code></td>
<td class="org-left">org-export-dispatch</td>
</tr>
<tr>
<td class="org-left"><code>spc m o</code></td>
<td class="org-left">org-set-property</td>
</tr>
<tr>
<td class="org-left"><code>spc m s</code></td>
<td class="org-left">org-schedule</td>
</tr>
<tr>
<td class="org-left"><code>spc m t</code></td>
<td class="org-left">org-todo</td>
</tr>
</tbody>
</table>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">C-c C-v p</td>
<td class="org-left">org-babel-previous-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v n</td>
<td class="org-left">org-babel-next-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v e</td>
<td class="org-left">org-babel-execute-maybe</td>
</tr>
<tr>
<td class="org-left">C-c C-v o</td>
<td class="org-left">org-babel-open-src-block-result</td>
</tr>
<tr>
<td class="org-left">C-c C-v v</td>
<td class="org-left">org-babel-expand-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v u</td>
<td class="org-left">org-babel-goto-src-block-head</td>
</tr>
<tr>
<td class="org-left">C-c C-v g</td>
<td class="org-left">org-babel-goto-named-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v r</td>
<td class="org-left">org-babel-goto-named-result</td>
</tr>
<tr>
<td class="org-left">C-c C-v b</td>
<td class="org-left">org-babel-execute-buffer</td>
</tr>
<tr>
<td class="org-left">C-c C-v s</td>
<td class="org-left">org-babel-execute-subtree</td>
</tr>
<tr>
<td class="org-left">C-c C-v d</td>
<td class="org-left">org-babel-demarcate-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v t</td>
<td class="org-left">org-babel-tangle</td>
</tr>
<tr>
<td class="org-left">C-c C-v f</td>
<td class="org-left">org-babel-tangle-file</td>
</tr>
<tr>
<td class="org-left">C-c C-v c</td>
<td class="org-left">org-babel-check-src-block</td>
</tr>
<tr>
<td class="org-left">C-c C-v j</td>
<td class="org-left">org-babel-insert-header-arg</td>
</tr>
<tr>
<td class="org-left">C-c C-v l</td>
<td class="org-left">org-babel-load-in-session</td>
</tr>
<tr>
<td class="org-left">C-c C-v i</td>
<td class="org-left">org-babel-lob-ingest</td>
</tr>
<tr>
<td class="org-left">C-c C-v I</td>
<td class="org-left">org-babel-view-src-block-info</td>
</tr>
<tr>
<td class="org-left">C-c C-v z</td>
<td class="org-left">org-babel-switch-to-session-with-code</td>
</tr>
<tr>
<td class="org-left">C-c C-v a</td>
<td class="org-left">org-babel-sha1-hash</td>
</tr>
<tr>
<td class="org-left">C-c C-v h</td>
<td class="org-left">org-babel-describe-bindings</td>
</tr>
<tr>
<td class="org-left">C-c C-v x</td>
<td class="org-left">org-babel-do-key-sequence-in-edit-buffer</td>
</tr>
</tbody>
</table>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgd49c2db" class="outline-2">
<h2 id="orgd49c2db">Personal Information</h2>
<div class="outline-text-2" id="text-orgd49c2db">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">These are used for a number of things, particularly for GPG configuration,</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">some email clients, file templates and snippets.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">user-full-name</span> <span class="org-string">"Dehaeze Thomas"</span>
<span class="org-variable-name">user-mail-address</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgcf3b44c" class="outline-2">
<h2 id="orgcf3b44c">Doom Config</h2>
<div class="outline-text-2" id="text-orgcf3b44c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">doom-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">12</span> <span class="org-builtin">:weight</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">semi-light</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-variable-pitch-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-unicode-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">12</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-variable-name">doom-big-font</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">font-spec</span> <span class="org-builtin">:family</span> <span class="org-string">"Hack Nerd Font Mono"</span> <span class="org-builtin">:size</span> <span class="org-highlight-numbers-number">19</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">There are two ways to load a theme. Both assume the theme is installed and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">available. You can either set `</span><span class="org-comment"><span class="org-constant">doom-theme</span></span><span class="org-comment">' or manually load a theme with the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">load-theme</span></span><span class="org-comment">' function. These are the defaults.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">doom-theme</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">doom-gruvbox</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">display-line-numbers-type</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga2ab779" class="outline-2">
<h2 id="orga2ab779">Evil</h2>
<div class="outline-text-2" id="text-orga2ab779">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> evil
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:m</span> <span class="org-string">"-"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">dired-jump</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:after</span> evil
<span class="org-builtin">:en</span> <span class="org-string">"C-h"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-left</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-j"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-down</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-k"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-up</span>
<span class="org-builtin">:en</span> <span class="org-string">"C-l"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">evil-window-right</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> which-key
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">which-key-idle-delay</span> <span class="org-highlight-numbers-number">0.5</span>
<span class="org-variable-name">which-key-idle-secondary-delay</span> <span class="org-highlight-numbers-number">0.01</span>
<span class="org-variable-name">which-key-sort-order</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">which-key-key-order-alpha</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb339871" class="outline-2">
<h2 id="orgb339871">Basic</h2>
<div class="outline-text-2" id="text-orgb339871">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0272904" class="outline-3">
<h3 id="org0272904">Visual</h3>
<div class="outline-text-3" id="text-org0272904">
2020-01-11 22:04:45 +01:00
<p>
Automatic line wrap.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">global-visual-line-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Turn off auto-fill mode that add line breaks.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">auto-fill-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgfa0f4d4" class="outline-3">
<h3 id="orgfa0f4d4">Change default alert backend</h3>
<div class="outline-text-3" id="text-orgfa0f4d4">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> alert-default-style <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">libnotify</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgab0c401" class="outline-3">
<h3 id="orgab0c401">Lockfiles</h3>
<div class="outline-text-3" id="text-orgab0c401">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">create-lockfiles</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgc047155" class="outline-2">
<h2 id="orgc047155">Magit</h2>
<div class="outline-text-2" id="text-orgc047155">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">setenv</span> <span class="org-string">"GIT_ASKPASS"</span> <span class="org-string">"git-gui--askpass"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">magit-diff-refine-hunk</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">all</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org13468c6" class="outline-2">
<h2 id="org13468c6">Org Mode</h2>
<div class="outline-text-2" id="text-org13468c6">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="http://cachestocaches.com/2016/9/my-workflow-org-agenda/">http://cachestocaches.com/2016/9/my-workflow-org-agenda/</a></li>
<li><a href="http://doc.norang.ca/org-mode.html#TodoKeywords">http://doc.norang.ca/org-mode.html#TodoKeywords</a></li>
<li><a href="https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html">https://emacs.cafe/emacs/orgmode/gtd/2017/06/30/orgmode-gtd.html</a></li>
</ul>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org8eadfc6" class="outline-3">
<h3 id="org8eadfc6">Make sure to load Org</h3>
<div class="outline-text-3" id="text-org8eadfc6">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge682476" class="outline-3">
<h3 id="orge682476">Org General Config</h3>
<div class="outline-text-3" id="text-orge682476">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-directory</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-default-notes-file</span> <span class="org-string">"~/Cloud/org/refile.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Highligh latex parts in org mode</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highlight-latex-and-related</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>native<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">The following setting hides blank lines between headings which keeps folded view nice and compact.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-cycle-separator-lines</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Indent according to the outline structure</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-startup-indented</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Record the information of when the task was marked as DONE</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-log-done</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">time</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with:
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> evil-org
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-tab-first-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">+org-cycle-only-current-subtree-h</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org51f6b69" class="outline-3">
<h3 id="org51f6b69">Org latex fragment</h3>
<div class="outline-text-3" id="text-org51f6b69">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highlight-latex-and-related</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>native<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> nil
<span class="org-doc">"Holds last fragment/environment you were on."</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-in-latex-fragment-p</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Return the point where the latex fragment begins, if inside</span>
<span class="org-doc"> a latex fragment. Else return false"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>el <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-context</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>el-type <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> el<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-fragment</span> el-type<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-environment</span> el-type<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> el<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-latex-fragment-toggle</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Toggle a latex fragment image "</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-mode</span> <span class="org-variable-name">major-mode</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>begin <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">were on a fragment and now on a new fragment</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">fragment we were on</span>
<span class="org-variable-name">tdh/org-latex-fragment-last</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">and are on a fragment now</span>
begin
<span class="org-comment-delimiter">;; </span><span class="org-comment">but not on the last one this is a little tricky. as you edit the</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">fragment, it is not equal to the last one. We use the begin</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">property which is less likely to change for the comparison.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> begin
<span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">go back to last one and put image back, provided there is still a fragment there</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-preview-latex-fragment</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">now remove current image</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> begin<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>ov <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for ov in <span class="org-rainbow-delimiters-depth-2">(</span>org--list-latex-overlays<span class="org-rainbow-delimiters-depth-2">)</span>
if
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span>
r <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&lt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-start</span> ov<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&gt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-end</span> ov<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
return ov<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> ov
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete-overlay</span> ov<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">and save new fragment</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> begin<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">were on a fragment and now are not on a fragment</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">not on a fragment now</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> begin<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">but we were on one</span>
<span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">put image back on, provided that there is still a fragment here.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh/org-in-latex-fragment-p</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-preview-latex-fragment</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">unset last fragment</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> nil<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">were not on a fragment, and now are</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">we were not one one</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">but now we are</span>
begin<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">remove image</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> begin<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>ov <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for ov in <span class="org-rainbow-delimiters-depth-2">(</span>org--list-latex-overlays<span class="org-rainbow-delimiters-depth-2">)</span>
if
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&lt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-start</span> ov<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&gt;=</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-end</span> ov<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
return ov<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> ov
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete-overlay</span> ov<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">tdh/org-latex-fragment-last</span> begin<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org8afc2de" class="outline-3">
<h3 id="org8afc2de">Org Links</h3>
<div class="outline-text-3" id="text-org8afc2de">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-string">"C-c l"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-store-link</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgcd26239" class="outline-3">
<h3 id="orgcd26239">Org Tagging</h3>
<div class="outline-text-3" id="text-orgcd26239">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Align Tags and flush right</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tags-column</span> <span class="org-highlight-numbers-number">-80</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-tag-alist</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@home"</span> . ?h<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@work"</span> . ?w<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@christophe"</span> . ?c<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"@veijo"</span> . ?v<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org65d0f06" class="outline-3">
<h3 id="org65d0f06">Org Refile</h3>
<div class="outline-text-3" id="text-org65d0f06">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-refile-targets</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">org-agenda-files</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:maxlevel</span> . <span class="org-highlight-numbers-number">6</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org25ed4f3" class="outline-3">
<h3 id="org25ed4f3">Org TODO</h3>
<div class="outline-text-3" id="text-org25ed4f3">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Tags with fast selection keys</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-todo-keywords</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>
<span class="org-rainbow-delimiters-depth-3">(</span>sequence <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">(t)"</span> <span class="org-string">"NEXT(n)"</span> <span class="org-string">"MAIL(m)"</span> <span class="org-string">"|"</span> <span class="org-string">"DONE(d)"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>sequence <span class="org-string">"READ(r)"</span> <span class="org-string">"BKMK(b)"</span> <span class="org-string">"EXER(x)"</span> <span class="org-string">"|"</span> <span class="org-string">"DONE(d)"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>sequence <span class="org-string">"WAIT(w@/!)"</span> <span class="org-string">"SDAY(s)"</span> <span class="org-string">"|"</span> <span class="org-string">"CANC(c@/!)"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>sequence <span class="org-string">"QUES(q)"</span> <span class="org-string">"|"</span> <span class="org-string">"ANSW(a)"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>sequence <span class="org-string">"EXAM(e)"</span> <span class="org-string">"IDEA(i)"</span> <span class="org-string">"|"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display of the keywords</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-todo-keyword-faces</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"EXER"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"NEXT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"MAIL"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"READ"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#cc241d"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">red</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"ANSW"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"DONE"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#689d6a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">aqua</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"WAIT"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d65d0e"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">orange</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"QUES"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#d79921"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">yellow</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"CANC"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#a89984"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">grey</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"SDAY"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"BKMK"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"IDEA"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"EXAM"</span> . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#98971a"</span> <span class="org-builtin">:weight</span> bold<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">green</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org75c66a7" class="outline-3">
<h3 id="org75c66a7">Archive subtrees under the same hierarchy as original in the archive files</h3>
<div class="outline-text-3" id="text-org75c66a7">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb">https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defadvice</span> <span class="org-function-name">org-archive-subtree</span> <span class="org-rainbow-delimiters-depth-2">(</span>around fix-hierarchy activate<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>fix-archive-p <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-variable-name">current-prefix-arg</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-12 00:19:16 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span>location <span class="org-rainbow-delimiters-depth-2">(</span>org-archive--compute-location <span class="org-variable-name">org-archive-location</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
2020-01-11 22:04:45 +01:00
<span class="org-rainbow-delimiters-depth-1">(</span>afile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> location<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>offset <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">=</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">length</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> location<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-highlight-numbers-number">1</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1+</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">*]"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> location<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>buffer <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-buffer-visiting</span> afile<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">find-file-noselect</span> afile<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
ad-do-it
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> fix-archive-p
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-current-buffer</span> buffer
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">&gt;</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-current-level</span><span class="org-rainbow-delimiters-depth-1">)</span> offset<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-up-heading-safe</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>olpath <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-entry-get</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"ARCHIVE_OLPATH"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>path <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> olpath <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">split-string</span> olpath <span class="org-string">"/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>level offset<span class="org-rainbow-delimiters-depth-1">)</span>
tree-text<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> olpath
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-mark-subtree</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> tree-text <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">this-command</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-cut-subtree</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">-each</span> path
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>heading<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">re-search-forward</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">rx-to-string</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-1">(</span>: bol <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">repeat</span> ,level <span class="org-string">"*"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">1+</span> <span class="org-string">" "</span><span class="org-rainbow-delimiters-depth-2">)</span> ,heading<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-warning">nil t</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-narrow-to-subtree</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">unless</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">looking-at</span> <span class="org-string">"^"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">make-string</span> level ?*<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">" "</span>
heading
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cl-incf</span> level<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-end-of-subtree</span> t t<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-paste-subtree</span> level tree-text<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga36def8" class="outline-3">
<h3 id="orga36def8">Org Agenda</h3>
<div class="outline-text-3" id="text-orga36def8">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgf9708e1" class="outline-4">
<h4 id="orgf9708e1">General configuration</h4>
<div class="outline-text-4" id="text-orgf9708e1">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-string">"C-c a"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-agenda</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">File to save todo items</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-files</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Include archived files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-archives-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set priority range from A to C with default A</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highest-priority</span> ?A<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-lowest-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-default-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-priority-faces</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>?A . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#CC241D"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?B . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D65D0E"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?C . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D79921"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Open agenda in current window</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-window-setup</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">current-window</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-prefix-format</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>agenda . <span class="org-string">" %-12:c %?-12t% s"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Don't show the filename for reading agenda</span>
<span class="org-rainbow-delimiters-depth-3">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-string">"C-c a"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-agenda</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">File to save todo items</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-files</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Include archived files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-archives-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set priority range from A to C with default A</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-highest-priority</span> ?A<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-lowest-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-default-priority</span> ?C<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Set colours for priorities</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-priority-faces</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>?A . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#CC241D"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?B . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D65D0E"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>?C . <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-builtin">:foreground</span> <span class="org-string">"#D79921"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Open agenda in current window</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-window-setup</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">current-window</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-prefix-format</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>agenda . <span class="org-string">" %-12:c %?-12t% s"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>todo . <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Don't show the filename for reading agenda</span>
<span class="org-rainbow-delimiters-depth-3">(</span>tags . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">search</span> . <span class="org-string">" %-12:c"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgec0c6c0" class="outline-4">
<h4 id="orgec0c6c0">Org Agenda Custom Views</h4>
<div class="outline-text-4" id="text-orgec0c6c0">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html">https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-agenda-skip-scheduled</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-agenda-skip-entry-if</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">scheduled</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">deadline</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">regexp</span> <span class="org-string">"\n]+&gt;"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-agenda-custom-commands</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"w"</span> <span class="org-string">"Work"</span> tags-todo <span class="org-string">"@work"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">All todos related to work</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"h"</span> <span class="org-string">"Home"</span> tags-todo <span class="org-string">"@home"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">All todos not related to work</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"q"</span> . <span class="org-string">"Questions to ask"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"qc"</span> <span class="org-string">"Questions to Cristophe"</span> tags <span class="org-string">"@christophe/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Questions to Christophe"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"qm"</span> <span class="org-string">"Questions to Muriel"</span> tags <span class="org-string">"@muriel/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Questions to Muriel"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"qo"</span> <span class="org-string">"Questions to Olivier"</span> tags <span class="org-string">"@olivier/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Questions to Olivier"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"qq"</span> <span class="org-string">"All questions"</span> tags <span class="org-string">"/QUES"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Other questions"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"n"</span> <span class="org-string">"Next things to do"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>tags <span class="org-string">"+PRIORITY+\"A\""</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>org-agenda-skip-entry-if <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">todo</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">done</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"High-priority unfinished tasks:"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>agenda <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"NEXT"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-agenda-skip-scheduled</span><span class="org-rainbow-delimiters-depth-1">)(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Next thing to do that are not scheduled"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"MAIL"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Email to write/reply"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"WAIT"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Things Waiting"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"u"</span> <span class="org-string">"Unscheduled tasks"</span> todo <span class="org-string">"</span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string">"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-skip-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-agenda-skip-scheduled</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Unscheduled </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string"> entries: "</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"r"</span> <span class="org-string">"Things to read"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>todo <span class="org-string">"READ"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-agenda-overriding-header</span> <span class="org-string">"Things to read"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">org-agenda-files</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"~/Cloud/thesis/ressources/notes/"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb9fc96d" class="outline-3">
<h3 id="orgb9fc96d">Org Notification based on calendar event</h3>
<div class="outline-text-3" id="text-orgb9fc96d">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events">https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> appt-message-warning-time <span class="org-highlight-numbers-number">5</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-org-agenda-to-appt</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> appt-time-msg-list nil<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-agenda-to-appt</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">my-org-agenda-to-appt</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">; </span><span class="org-comment">Display appointments as a window manager notification</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> appt-disp-window-function <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-appt-display</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> appt-delete-window-function <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> my-appt-notification-app <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">getenv</span> <span class="org-string">"HOME"</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-string">"/bin/appt-notification"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-appt-display</span> <span class="org-rainbow-delimiters-depth-2">(</span>min-to-app new-time msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">atom</span> min-to-app<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">start-process</span> <span class="org-string">"my-appt-notification-app"</span> nil my-appt-notification-app min-to-app msg<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>i <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">number-sequence</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">1-</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">length</span> min-to-app<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">start-process</span> <span class="org-string">"my-appt-notification-app"</span> nil my-appt-notification-app <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i min-to-app<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> i msg<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1199365" class="outline-4">
<h4 id="org1199365">appt-notification script</h4>
<div class="outline-text-4" id="text-org1199365">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-bash"><span class="org-variable-name">TIME</span>=<span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">1</span></span><span class="org-string">"</span>TODO
<span class="org-variable-name">MSG</span>=<span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">2</span></span><span class="org-string">"</span>
dunstify --replace=<span class="org-highlight-numbers-number">85401</span> <span class="org-string">"Event in </span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">TIME</span></span><span class="org-string"> minutes"</span> <span class="org-string">"</span><span class="org-string"><span class="org-constant">$</span></span><span class="org-string"><span class="org-variable-name">MSG</span></span><span class="org-string">"</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3c5e1f3" class="outline-3">
<h3 id="org3c5e1f3">Org Structure Template</h3>
<div class="outline-text-3" id="text-org3c5e1f3">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-structure-template-alist</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"c"</span> . <span class="org-string">"center"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"C"</span> . <span class="org-string">"comment"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"i"</span> . <span class="org-string">"important"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"e"</span> . <span class="org-string">"example"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"q"</span> . <span class="org-string">"quote"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"s"</span> . <span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9713b96" class="outline-3">
<h3 id="org9713b96">Org Capture</h3>
<div class="outline-text-3" id="text-org9713b96">
2020-01-11 22:04:45 +01:00
<p>
Documentation:
</p>
<ul class="org-ul">
<li>Template elements: <a href="https://orgmode.org/manual/Template-elements.html#Template-elements">https://orgmode.org/manual/Template-elements.html#Template-elements</a></li>
<li>Template expansion: <a href="https://orgmode.org/manual/Template-expansion.html#Template-expansion">https://orgmode.org/manual/Template-expansion.html#Template-expansion</a></li>
<li>Capture protocol: <a href="https://orgmode.org/manual/capture-protocol.html">https://orgmode.org/manual/capture-protocol.html</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-string">"C-c c"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-capture</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-capture-templates</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"t"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<span class="org-string">"todo"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string"> %?\n%U\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"M"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<span class="org-string">"Meeting"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Meetings"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"m"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">key</span>
<span class="org-string">"mail"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">name</span>
entry <span class="org-comment-delimiter">; </span><span class="org-comment">type</span>
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">target</span>
<span class="org-string">"** </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-string"> [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n"</span> <span class="org-comment-delimiter">; </span><span class="org-comment">template</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pm"</span>
<span class="org-string">"Org-Protocol Mail"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Mails"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pu"</span>
<span class="org-string">"Org-Protocol Url"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* [[%:link][%:description]]\nCaptured On: %U\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pt"</span>
<span class="org-string">"Org-Protocol text"</span>
entry
<span class="org-rainbow-delimiters-depth-2">(</span>file+headline <span class="org-string">"~/Cloud/org/work-notebook.org"</span> <span class="org-string">"Inbox"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"* %:description\nSource: %:link\nCaptured On: %U\n\n#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n"</span>
<span class="org-builtin">:immediate-finish</span> t
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org839d7a9" class="outline-3">
<h3 id="org839d7a9">Org Export</h3>
<div class="outline-text-3" id="text-org839d7a9">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgedb7fc4" class="outline-4">
<h4 id="orgedb7fc4">Basic</h4>
<div class="outline-text-4" id="text-orgedb7fc4">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">How many levels of headline to export</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-headline-levels</span> <span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Authorize BIND to set local variables</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-export-allow-bind-keywords</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-odt-preferred-output-format</span> <span class="org-string">"doc"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Used to not export headings with :ignore: tag</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">ox-extra</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">ox-extras-activate</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>ignore-headlines<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3480957" class="outline-4">
<h4 id="org3480957">Ox Latex Subfigure package</h4>
<div class="outline-text-4" id="text-org3480957">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">use-package!</span> ox-latex-subfigure
<span class="org-builtin">:config</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">ox-latex-subfigure</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org44cf309" class="outline-4">
<h4 id="org44cf309">Clear page before heading</h4>
<div class="outline-text-4" id="text-org44cf309">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892">https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org/get-headline-string-element</span> <span class="org-rainbow-delimiters-depth-2">(</span>headline backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>prop-point <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">next-property-change</span> <span class="org-highlight-numbers-number">0</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> prop-point <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">plist-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">text-properties-at</span> prop-point headline<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-builtin">:parent</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org/ensure-latex-clearpage</span> <span class="org-rainbow-delimiters-depth-2">(</span>headline backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-derived-backend-p</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org/get-headline-string-element</span> headline backend info<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> elmnt <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:CLEARPAGE</span> elmnt<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"\\clearpage\n"</span> headline<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-headline-functions</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org/ensure-latex-clearpage</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org253b1f3" class="outline-4">
<h4 id="org253b1f3"><span class="todo TODO">TODO</span> HTML Export</h4>
<div class="outline-text-4" id="text-org253b1f3">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgfe81dca" class="outline-5">
<h5 id="orgfe81dca">MathJax</h5>
<div class="outline-text-5" id="text-orgfe81dca">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-mathjax-template</span>
<span class="org-string">"&lt;script type=\"text/x-mathjax-config\"&gt;</span>
<span class="org-string"> MathJax.Hub.Config({</span>
<span class="org-string"> displayAlign: \"%ALIGN\",</span>
<span class="org-string"> displayIndent: \"%INDENT\",</span>
<span class="org-string"> \"HTML-CSS\": { scale: %SCALE,</span>
<span class="org-string"> linebreaks: { automatic: \"%LINEBREAKS\" },</span>
<span class="org-string"> webFont: \"%FONT\"</span>
<span class="org-string"> },</span>
<span class="org-string"> SVG: {scale: %SCALE,</span>
<span class="org-string"> linebreaks: { automatic: \"%LINEBREAKS\" },</span>
<span class="org-string"> font: \"%FONT\"},</span>
<span class="org-string"> NativeMML: {scale: %SCALE},</span>
<span class="org-string"> TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},</span>
<span class="org-string"> MultLineWidth: \"%MULTLINEWIDTH\",</span>
<span class="org-string"> TagSide: \"%TAGSIDE\",</span>
<span class="org-string"> TagIndent: \"%TAGINDENT\",</span>
<span class="org-string"> Macros: {</span>
<span class="org-string"> bm: [\"{\\\\boldsymbol #1}\",1],</span>
<span class="org-string"> }</span>
<span class="org-string"> }</span>
<span class="org-string">});</span>
<span class="org-string">&lt;/script&gt;</span>
<span class="org-string">&lt;script type=\"text/javascript\"</span>
<span class="org-string"> src=\"%PATH\"&gt;&lt;/script&gt;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9c905cc" class="outline-5">
<h5 id="org9c905cc">Export with css class instead of inline css</h5>
<div class="outline-text-5" id="text-org9c905cc">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-htmlize-output-type</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">css</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org8cdad1c" class="outline-5">
<h5 id="org8cdad1c"><span class="todo TODO">TODO</span> MP4 movies</h5>
<div class="outline-text-5" id="text-org8cdad1c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-html5-fancy</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-html-doctype</span> <span class="org-string">"xhtml-strict"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1a43ae2" class="outline-3">
<h3 id="org1a43ae2">Org LaTeX</h3>
<div class="outline-text-3" id="text-org1a43ae2">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgac3afe0" class="outline-4">
<h4 id="orgac3afe0">Org CdLatex</h4>
<div class="outline-text-4" id="text-orgac3afe0">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode">https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">push</span> <span class="org-string">"~/.config/doom/local/"</span> <span class="org-variable-name">load-path</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">cdlatex</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-on-org-cdlatex</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgaa26736" class="outline-4">
<h4 id="orgaa26736">LaTeX Classes</h4>
<div class="outline-text-4" id="text-orgaa26736">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Custom classes to use when exporting to latex</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"beamer"</span>
,<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"\\documentclass[presentation]{beamer}\n"</span>
<span class="org-string">"[DEFAULT-PACKAGES]"</span>
<span class="org-string">"[PACKAGES]"</span>
<span class="org-string">"[EXTRA]\n"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"clean-cheatsheet"</span>
<span class="org-string">"\\documentclass{clean-cheatsheet}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"clean-beamer"</span>
<span class="org-string">"\\documentclass{clean-beamer}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"cleanreport"</span>
<span class="org-string">"\\documentclass{cleanreport}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"scrreprt"</span>
<span class="org-string">"\\documentclass{scrreprt}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-classes</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"biblioreport"</span>
<span class="org-string">"\\documentclass{biblioreport}"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\section{%s}"</span> . <span class="org-string">"\\section*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsection{%s}"</span> . <span class="org-string">"\\subsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subsubsection{%s}"</span> . <span class="org-string">"\\subsubsection*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\paragraph{%s}"</span> . <span class="org-string">"\\paragraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"\\subparagraph{%s}"</span> . <span class="org-string">"\\subparagraph*{%s}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org34ec6e9" class="outline-4">
<h4 id="org34ec6e9">Basic</h4>
<div class="outline-text-4" id="text-org34ec6e9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Add packages by default</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"siunitx"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"array"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"tabularx"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"booktabs"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">""</span> <span class="org-string">"bm"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-latex-packages-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"most"</span> <span class="org-string">"tcolorbox"</span> t<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Setup default option for image size when exporting to LaTeX</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-option</span> <span class="org-string">"scale=1"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-image-default-width</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use define labels instead of automatic generated ones</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-prefer-user-labels</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Captions above the table</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-caption-above</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>table<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Settings to export code with `</span><span class="org-comment"><span class="org-constant">minted</span></span><span class="org-comment">' instead of `</span><span class="org-comment"><span class="org-constant">verbatim</span></span><span class="org-comment">'.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-listings</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">minted</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Command used when exporting to pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-latex-pdf-process</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgce10c33" class="outline-4">
<h4 id="orgce10c33">Beamer</h4>
<div class="outline-text-4" id="text-orgce10c33">
2020-01-11 22:04:45 +01:00
<p>
Bold Text
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/my-beamer-bold</span> <span class="org-rainbow-delimiters-depth-2">(</span>contents backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">eq</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">beamer</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"\\`\\\\"</span> <span class="org-string">"[A-Za-z0-9]+"</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">If not, orgmode is crazy...</span>
<span class="org-string">"\\\\textbf"</span>
contents<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-bold-functions</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/my-beamer-bold</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Special Environments
</p>
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> Make some comment those special environments</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"cbox"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Name of environment</span>
<span class="org-string">"m"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Selection key</span>
<span class="org-string">"\\onslide%a{\\begin{cbox}[%h]%O"</span>
<span class="org-string">"\\end{cbox}}\\vspace{0.5em}"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-beamer-environments-extra</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"csubbox"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Name of environment</span>
<span class="org-string">"M"</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">Selection key</span>
<span class="org-string">"\\onslide%a{\\tcbsubtitle{%h}"</span>
<span class="org-string">"}"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org41a7583" class="outline-4">
<h4 id="org41a7583"><span class="todo TODO">TODO</span> Latex Fragments</h4>
<div class="outline-text-4" id="text-org41a7583">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> The remove hook does not seems to work</li>
</ul>
<p>
<a href="http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/">http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Activate Automatic LaTeX fragment</span>
<span class="org-builtin">:n</span> <span class="org-string">",ol"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>lambda <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">post-command-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-latex-fragment-toggle</span> t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">;; Disable Automatic LaTeX fragment</span>
<span class="org-builtin">:n</span> <span class="org-string">",oL"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>lambda <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">remove-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">post-command-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-latex-fragment-toggle</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate all the latex fragments</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">"&lt;f9&gt;"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-preview-latex-fragment</span> <span class="org-highlight-numbers-number">16</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Put all the preview images in some directory</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-image-directory</span> <span class="org-string">"~/.ltximg/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Define backends to preview LaTeX fragments</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-process-alist</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>imagemagick
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"convert"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; png"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: latex and imagemagick."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"pdf"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"png"</span>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">0.6</span> . <span class="org-highlight-numbers-number">0.6</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"convert -density %D -trim -antialias %f -quality 100 %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>pdf2svg
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"pdf2svg"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:description</span> <span class="org-string">"pdf &gt; svg"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: pdflatex and pdf2svg."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"pdf"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"svg"</span>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">1.0</span> . <span class="org-highlight-numbers-number">1.0</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdflatex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"pdfcrop %f %f &amp;&amp; pdftocairo -svg %f %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">:image-converter ("pdf2svg %f %O"))</span>
<span class="org-rainbow-delimiters-depth-3">(</span>dvisvgm
<span class="org-builtin">:programs</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex"</span> <span class="org-string">"dvisvgm"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:description</span> <span class="org-string">"dvi &gt; svg"</span>
<span class="org-builtin">:message</span> <span class="org-string">"you need to install the programs: latex and dvisvgm."</span>
<span class="org-builtin">:image-input-type</span> <span class="org-string">"dvi"</span>
<span class="org-builtin">:image-output-type</span> <span class="org-string">"svg"</span>
<span class="org-builtin">:image-size-adjust</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-highlight-numbers-number">0.8</span> . <span class="org-highlight-numbers-number">0.8</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:latex-compiler</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"latex -interaction nonstopmode -output-directory %o %f"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:image-converter</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"dvisvgm %f -n -b min -c %S -o %O"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use imagemagick/dvisvgm to generate png from pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-preview-latex-default-process</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">dvisvgm</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org7d55947" class="outline-4">
<h4 id="org7d55947"><span class="todo TODO">TODO</span> Custom Export - Add Page and Label for LaTeX export</h4>
<div class="outline-text-4" id="text-org7d55947">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1">https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defcustom</span> <span class="org-variable-name">tdehaeze/org-property-mapping</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>latex <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"CUSTOM_PAGE"</span> . tdehaeze/insert-org-page-latex<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"CUSTOM_LABEL"</span> . tdehaeze/insert-org-label-latex<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"List of mappings from org property to arbitrary strings.</span>
<span class="org-doc">Each element is a list:</span>
<span class="org-doc"> (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...)</span>
<span class="org-doc">FUNCTION are functions which get called with a single</span>
<span class="org-doc">argument (the value of PROPERTY) and are responsible for doing</span>
<span class="org-doc">whatever should be done."</span>
<span class="org-builtin">:type</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>repeat <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">cons</span> symbol <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">repeat</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> string string<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdehaeze/replace-org-property</span> <span class="org-rainbow-delimiters-depth-2">(</span>backend<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Convert org properties using `</span><span class="org-doc"><span class="org-constant">tdehaeze/org-property-mapping</span></span><span class="org-doc">'.</span>
<span class="org-doc">Lookup BACKEND in `</span><span class="org-doc"><span class="org-constant">tdehaeze/org-property-mapping</span></span><span class="org-doc">' for a list of</span>
<span class="org-doc">(PROPERTY REPLACEMENT). For each healine being exported, if it has a</span>
<span class="org-doc">PROPERTY listed insert a string immediately after the healine given by</span>
<span class="org-doc"> (format REPLACEMENT PROPERTY-VALUE)"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">map</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> backend tdehaeze/org-property-mapping<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
value replacement<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> map
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-map-entries</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">dolist</span> <span class="org-rainbow-delimiters-depth-1">(</span>it map<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> value <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-entry-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> it<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">funcall</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> it<span class="org-rainbow-delimiters-depth-1">)</span> value<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-before-processing-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdehaeze/replace-org-property</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdehaeze/insert-org-label-latex</span> <span class="org-rainbow-delimiters-depth-2">(</span>label<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">search-forward-regexp</span> <span class="org-variable-name">org-property-end-re</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-char</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\label{%s}\n"</span> label<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdehaeze/insert-org-page-latex</span> <span class="org-rainbow-delimiters-depth-2">(</span>page<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Insert \"\\\\page{PAGE}\\n\" after the :PROPERTY: drawer."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">search-forward-regexp</span> <span class="org-variable-name">org-property-end-re</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-char</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\page{%s}\n"</span> page<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-latex-format-headline-default-function</span> <span class="org-rainbow-delimiters-depth-2">(</span>todo _todo-type priority text tags _info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Default format function for a headline.</span>
<span class="org-doc"> See `</span><span class="org-doc"><span class="org-constant">org-latex-format-headline-function</span></span><span class="org-doc">' for details."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> todo <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"{\\bfseries\\sffamily %s} "</span> todo<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> priority <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\framebox{\\#%c} "</span> priority<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
text
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> tags
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"\\hfill{}\\textsc{%s}"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">mapconcat</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-latex--protect-text</span> tags <span class="org-string">":"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> todo <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"{\n\\page{%s} "</span> todo<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9d2764e" class="outline-4">
<h4 id="org9d2764e">Number Equations</h4>
<div class="outline-text-4" id="text-org9d2764e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-renumber-environment</span> <span class="org-rainbow-delimiters-depth-2">(</span>orig-func <span class="org-type">&amp;rest</span> args<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"A function to inject numbers in LaTeX fragment previews."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>results <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">()</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>counter <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">numberp</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> results <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">loop</span> for <span class="org-rainbow-delimiters-depth-2">(</span>begin . env<span class="org-rainbow-delimiters-depth-2">)</span> in
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex-environment</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:value</span> env<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
collect
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{equation}"</span> env<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\tag{"</span> env<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">string-match</span> <span class="org-string">"\\\\begin{align}"</span> env<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">prog2</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">incf</span> counter<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cons</span> begin counter<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> env<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">\\ is used for a new line. Each one leads to a number</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">incf</span> counter <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\\\$"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">unless there are nonumbers.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">decf</span> counter <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">count-matches</span> <span class="org-string">"\\nonumber"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>t
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cons</span> begin nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> numberp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span> results<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setf</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"\\setcounter{equation}{%s}\n"</span> numberp<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> args<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">apply</span> orig-func args<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">advice-add</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-create-formula-image</span> <span class="org-builtin">:around</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">org-renumber-environment</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3f8f62d" class="outline-3">
<h3 id="org3f8f62d"><span class="todo TODO">TODO</span> View PDF in org mode</h3>
<div class="outline-text-3" id="text-org3f8f62d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-include-img-from-pdf</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;rest</span> _<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Convert pdf files to image files in org-mode bracket links.</span>
<span class="org-doc"> # ()convertfrompdf:t # This is a special comment; tells that the upcoming</span>
<span class="org-doc"> # link points to the to-be-converted-to file.</span>
<span class="org-doc"> # If you have a foo.pdf that you need to convert to foo.png, use the</span>
<span class="org-doc"> # foo.png file name in the link.</span>
<span class="org-doc"> [[./foo.png]]</span>
<span class="org-doc">"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">executable-find</span> <span class="org-string">"convert"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"</span>
nil <span class="org-builtin">:noerror</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Keep on going to the next line till it finds a line with bracketed</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">file link.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">looking-at</span> <span class="org-variable-name">org-bracket-link-regexp</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Get the sub-group 1 match, the link, from `</span><span class="org-comment"><span class="org-constant">org-bracket-link-regexp</span></span><span class="org-comment">'</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>link <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">match-string-no-properties</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">stringp</span> link<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>imgfile <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">file-name-sans-extension</span> link<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>pdffile <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> imgfile
<span class="org-string">"."</span> <span class="org-string">"pdf"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cmd <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"pdftocairo -png -transp -singlefile "</span>
pdffile <span class="org-string">" "</span> imgfile<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">message</span> <span class="org-string">"%s"</span> imgfile<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-readable-p</span> pdffile<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-newer-than-file-p</span> pdffile imgfile<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">This block is executed only if pdffile is newer than</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">imgfile or if imgfile does not exist.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command</span> cmd<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"%s"</span> cmd<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">user-error</span> <span class="org-string">"`</span><span class="org-string"><span class="org-constant">convert</span></span><span class="org-string">' executable (part of Imagemagick) is not found"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-before-processing-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh/org-include-img-from-pdf</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">image-type-file-name-regexps</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"\\.pdf\\'"</span> . imagemagick<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">image-file-name-extensions</span> <span class="org-string">"pdf"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">imagemagick-types-inhibit</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">remove</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">PDF</span> <span class="org-variable-name">imagemagick-types-inhibit</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-image-actual-width</span> <span class="org-highlight-numbers-number">600</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-latex-filter-nobreaks</span> <span class="org-rainbow-delimiters-depth-2">(</span>text backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Ensure \" \" are properly handled in LaTeX export."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-derived-backend-p</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">" "</span> <span class="org-string">"~"</span> text<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-export-filter-plain-text-functions</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-latex-filter-nobreaks</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">image-file-name-extensions</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">quote</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"png"</span> <span class="org-string">"jpeg"</span> <span class="org-string">"jpg"</span> <span class="org-string">"gif"</span> <span class="org-string">"tiff"</span> <span class="org-string">"tif"</span> <span class="org-string">"xbm"</span> <span class="org-string">"xpm"</span> <span class="org-string">"pbm"</span> <span class="org-string">"pgm"</span> <span class="org-string">"ppm"</span> <span class="org-string">"pnm"</span> <span class="org-string">"svg"</span> <span class="org-string">"pdf"</span> <span class="org-string">"bmp"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-image-actual-width</span> <span class="org-highlight-numbers-number">600</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-imagemagick-display-command <span class="org-string">"convert -density 600 \"%s\" -thumbnail \"%sx%s&gt;\" \"%s\""</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">org-display-inline-images</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> include-linked refresh beg end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Display inline images.</span>
<span class="org-doc">Normally only links without a description part are inlined, because this</span>
<span class="org-doc">is how it will work for export. When INCLUDE-LINKED is set, also links</span>
<span class="org-doc">with a description part will be inlined. This</span>
<span class="org-doc">can be nice for a quick</span>
<span class="org-doc">look at those images, but it does not reflect what exported files will look</span>
<span class="org-doc">like.</span>
<span class="org-doc">When REFRESH is set, refresh existing images between BEG and END.</span>
<span class="org-doc">This will create new image displays only if necessary.</span>
<span class="org-doc">BEG and END default to the buffer boundaries."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"P"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">unless</span> refresh
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-remove-inline-images</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">fboundp</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">clear-image-cache</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">clear-image-cache</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-restriction</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> beg <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> beg <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span> end <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> end <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-max</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">goto-char</span> beg<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>re <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"\\[\\[</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">file:</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">[./~]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">]\n]+?"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">substring</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-image-file-name-regexp</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-numbers-number">0</span> <span class="org-highlight-numbers-number">-2</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-string">"</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">\\]"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> include-linked <span class="org-string">""</span> <span class="org-string">"\\]"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
old file ov img<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-forward</span> re end t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> old <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">get-char-property-and-overlay</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">match-beginning</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-image-overlay</span><span class="org-rainbow-delimiters-depth-1">)</span>
file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">or</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">3</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">""</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">match-string</span> <span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-exists-p</span> file<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>file-thumb <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"%s%s_thumb.png"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-name-directory</span> file<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">file-name-base</span> file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-exists-p</span> file-thumb<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>thumb-time <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-attributes</span> file-thumb <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">string</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>file-time <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-attributes</span> file <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">string</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">time-less-p</span> thumb-time file-time<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">shell-command</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> org-imagemagick-display-command
file <span class="org-variable-name">org-image-actual-width</span> <span class="org-variable-name">org-image-actual-width</span> file-thumb<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-warning">nil nil</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span><span class="org-warning"><span class="org-rainbow-delimiters-depth-1">)</span></span><span class="org-warning"><span class="org-rainbow-delimiters-depth-3">)</span></span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> org-imagemagick-display-command
file <span class="org-variable-name">org-image-actual-width</span> <span class="org-variable-name">org-image-actual-width</span> file-thumb<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-warning">nil nil</span><span class="org-warning"><span class="org-rainbow-delimiters-depth-3">)</span></span><span class="org-warning"><span class="org-rainbow-delimiters-depth-2">)</span></span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car-safe</span> old<span class="org-rainbow-delimiters-depth-1">)</span> refresh<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">image-refresh</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-get</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> old<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> img <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-match-data</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">create-image</span> file-thumb<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> img
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> ov <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">make-overlay</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">match-beginning</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">match-end</span> <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span> img<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">face</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">default</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-image-overlay</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlay-put</span> ov <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">modification-hooks</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-display-inline-remove-overlay</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">push</span> ov <span class="org-variable-name">org-inline-image-overlays</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Two options:
</p>
<ul class="org-ul">
<li>work with <code>.png</code> file extension and only replace with <code>.pdf</code> when exporting to LaTeX if the corresponding file exists</li>
<li>work with <code>.pdf</code> file, add a special function to display <code>.pdf</code> files (using <code>convert</code> or <code>pdftocairo</code>). Change to <code>.png</code> when exporting to html</li>
</ul>
<p>
Let&rsquo;s try the first solution.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/change-png-to-pdf</span> <span class="org-rainbow-delimiters-depth-2">(</span>text backend info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Change png images to pdf images when existing"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-export-derived-backend-p</span> backend <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>text <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">:</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\n\t\r]+</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">:</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]"</span> <span class="org-string">"&lt;mark&gt;"</span> text nil nil <span class="org-highlight-numbers-number">1</span> nil<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">&lt;mark&gt;</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\n\t\r]+</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">:</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">[</span><span class="org-string"><span class="org-negation-char">^</span></span><span class="org-string">\\w]"</span> <span class="org-string">"&lt;/mark&gt;"</span> text nil nil <span class="org-highlight-numbers-number">2</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-export-filter-plain-text-fucntions</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-html-mark-tag</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">re-search-forward</span> <span class="org-string">"^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"</span>
nil <span class="org-builtin">:noerror</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Keep on going to the next line till it finds a line with bracketed</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">file link.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">looking-at</span> <span class="org-variable-name">org-bracket-link-regexp</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Get the sub-group 1 match, the link, from `</span><span class="org-comment"><span class="org-constant">org-bracket-link-regexp</span></span><span class="org-comment">'</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>link <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">match-string-no-properties</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">stringp</span> link<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>imgfile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> link<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>pdffile <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-name-sans-extension</span> imgfile<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">"."</span> <span class="org-string">"pdf"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>cmd <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"convert -density 96 -quality 85 "</span>
pdffile <span class="org-string">" "</span> imgfile<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-readable-p</span> pdffile<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-newer-than-file-p</span> pdffile imgfile<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">This block is executed only if pdffile is newer than</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">imgfile or if imgfile does not exist.</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">shell-command</span> cmd<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">message</span> <span class="org-string">"%s"</span> cmd<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0c85e50" class="outline-3">
<h3 id="org0c85e50">Org Ref</h3>
<div class="outline-text-3" id="text-org0c85e50">
2020-01-11 22:04:45 +01:00
<p>
Ressources:
</p>
<ul class="org-ul">
<li><a href="https://github.com/tmalsburg/helm-bibtex">https://github.com/tmalsburg/helm-bibtex</a></li>
<li><a href="https://github.com/jkitchin/org-ref">https://github.com/jkitchin/org-ref</a></li>
<li><a href="https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/">https://www.reddit.com/r/emacs/comments/4gudyw/help_me_with_my_orgmode_workflow_for_notetaking/</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Folder where the notes files are located (or file if just one Note file)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-notes-directory <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-bibliography-notes <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography File</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">reftex-default-bibliography</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"~/Cloud/thesis/ressources/references.bib"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-default-bibliography <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"~/Cloud/thesis/ressources/references.bib"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Folder where all the pdf are located</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-pdf-directory <span class="org-string">"~/Cloud/thesis/ressources/pdfs"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Tell org-ref to let helm-bibtex find notes for it</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-notes-function
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>thekey<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>bibtex-completion-bibliography <span class="org-rainbow-delimiters-depth-3">(</span>org-ref-find-bibliography<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>bibtex-completion-edit-notes
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-1">(</span>org-ref-get-bibtex-key-and-file thekey<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Problem with speed: don't display broken links</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-show-broken-links nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display information on the citation</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-ref-show-citation-on-enter t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgbeb4320" class="outline-3">
<h3 id="orgbeb4320">Org Noter</h3>
<div class="outline-text-3" id="text-orgbeb4320">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://github.com/weirdNox/org-noter">https://github.com/weirdNox/org-noter</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-always-create-frame nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-kill-frame-at-session-end nil<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Fraction of the frame that the document window will occupy when split</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-doc-split-fraction <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">0.6</span> . <span class="org-highlight-numbers-number">0.6</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Save the last visited location automatically; when starting a new session, go to that location</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-auto-save-last-location t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Add an empty line between each note's heading and content</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-separate-notes-from-heading t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">List of paths to check (non recursively) when searching for a notes file</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-noter-notes-search-path <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org7d49361" class="outline-3">
<h3 id="org7d49361">Custom key bindings</h3>
<div class="outline-text-3" id="text-org7d49361">
2020-01-11 22:04:45 +01:00
<p>
Export to LaTeX
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",l"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">org-latex-export-to-latex</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Open pdf externally.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/open-org-pdf-externally</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"xdg-open"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-name-sans-extension</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">".pdf"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",vp"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/open-org-pdf-externally</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Open HTML externally.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/open-org-html-externally</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"xdg-open"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-name-sans-extension</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">".html"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",vh"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/open-org-html-externally</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9fac18d" class="outline-3">
<h3 id="org9fac18d"><span class="todo TODO">TODO</span> Org-Contacts</h3>
<div class="outline-text-3" id="text-org9fac18d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-contacts-files <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"~/Cloud/org/contacts.org"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org214488a" class="outline-3">
<h3 id="org214488a"><span class="todo TODO">TODO</span> Org-Wunderlist</h3>
<div class="outline-text-3" id="text-org214488a">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-wunderlist-client-id <span class="org-string">"6799d9caeb2f5d8bd641"</span>
org-wunderlist-token <span class="org-string">"fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"</span>
org-wunderlist-file <span class="org-string">"~/Cloud/thesis/todos/wunderlist.org"</span>
org-wunderlist-dir <span class="org-string">"~/.emacs.d/org-wunderlist/"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0a79d9f" class="outline-3">
<h3 id="org0a79d9f">Automatically run <code>startblock</code> when opening org-mode files</h3>
<div class="outline-text-3" id="text-org0a79d9f">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/eval-startblock</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">member</span> <span class="org-string">"startblock"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-src-block-names</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-goto-named-src-block</span> <span class="org-string">"startblock"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-execute-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
nil
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/eval-startblock</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga1fc443" class="outline-3">
<h3 id="orga1fc443"><span class="todo TODO">TODO</span> Insert ScreenShot or Picture from Phone</h3>
<div class="outline-text-3" id="text-orga1fc443">
2020-01-11 22:04:45 +01:00
<p>
<a href="http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/">http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/</a>
</p>
<ul class="org-ul">
<li class="off"><code>[&#xa0;]</code> One function to move file from <code>~/Picture/</code> folder (where the screenshots are taken) to current directory and then insert and org link to the picture. Maybe ask if it should be copied in a sub directory (figs folder for instance).</li>
<li class="off"><code>[&#xa0;]</code> One function to copy file from <code>~/Cloud/Photos/</code> folder (where the pictures from phone are taken) to current directory (and ask for the new name of the picture) and insert org link.</li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">required libraries</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">dash</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'swiper)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">s</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">start directory</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">tdh/image-dir</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> <span class="org-string">"/home/thomas/Pictures"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/insert-conference-image</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Insert image from conference directory, rename and add link in current file.</span>
<span class="org-doc">The file is taken from a start directory set by `</span><span class="org-doc"><span class="org-constant">tdh/image-dir</span></span><span class="org-doc">' and moved to the current directory, renamed and embedded at the point as an org-mode link. The user is presented with a list of files in the start directory, from which to select the file to move, sorted by most recent first."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file-list target-dir file-list-sorted start-file start-file-full file-ext end-file end-file-base end-file-full file-number<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Clean directories from list but keep times</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file-list
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">-remove</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">(</span>x<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">1</span> x<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">directory-files-and-attributes</span> tdh/image-dir<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Get target directory</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> target-dir <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-name-directory</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Sort list by most recent</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> file-list-sorted
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">mapcar</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">car</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">sort</span> file-list
<span class="org-highlight-quoted-quote">#'</span><span class="org-rainbow-delimiters-depth-3">(</span>lambda <span class="org-rainbow-delimiters-depth-1">(</span>x y<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">time-less-p</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> y<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> x<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use ivy to select start-file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> start-file <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">ivy-read</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"Move selected file to "</span> target-dir <span class="org-string">":"</span><span class="org-rainbow-delimiters-depth-2">)</span>
file-list-sorted
<span class="org-builtin">:re-builder</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ivy--regex</span>
<span class="org-builtin">:sort</span> nil
<span class="org-builtin">:initial-input</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">add full path to start file and end-file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> start-file-full
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> start-file tdh/image-dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">final file name including path</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> end-file-full
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> start-file target-dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">rename file</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">rename-file</span> start-file-full end-file-full<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"moved %s to %s"</span> start-file-full start-file<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">insert link</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-make-link-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"file:%s"</span> start-file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">display image</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-display-inline-images</span> t t<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org7902aff" class="outline-3">
<h3 id="org7902aff"><span class="todo TODO">TODO</span> Render Tables</h3>
<div class="outline-text-3" id="text-org7902aff">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/">https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-render-org-table-at-point</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">removes the overlay is already there</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">delete-overlay</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>element-type <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> element-type <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> element-type <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table-row</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">error</span> <span class="org-string">"not at an org table"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eq</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-type</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">my-render-org-table</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-at-point</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-render-org-table</span> <span class="org-rainbow-delimiters-depth-2">(</span>table<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>begin <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:begin</span> table<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>end <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>pos <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-element-property</span> <span class="org-builtin">:end</span> table<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> pos<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">beginning-of-line</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">skip possible space after table</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">while</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">looking-at</span> <span class="org-string">" *[|#]"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> pos <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
pos<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>tabletxt <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring-no-properties</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>img <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-temp-buffer</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">insert</span> tabletxt<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">mark-whole-buffer</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-convert-region-to-latex</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-latex-preview</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">point-min</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlay-get</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">car</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">overlays-at</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">point</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>overlay <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">make-overlay</span> begin end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">overlay-put</span> overlay <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">display</span> img<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">forward-line</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-render-org-tables-in-buffer</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">save-excursion</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-element-map</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-element-parse-buffer</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">table</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-render-org-table</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Use F9 to globally generate tables</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">"&lt;f8&gt;"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">my-render-org-table-at-point</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org66f0a8a" class="outline-3">
<h3 id="org66f0a8a">Org Gcal</h3>
<div class="outline-text-3" id="text-org66f0a8a">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk">https://cestlaz.github.io/posts/using-emacs-26-gcal/#.WIqBud9vGAk</a></li>
</ul>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-gcal-client-id <span class="org-string">"396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"</span>
org-gcal-client-secret <span class="org-string">"4M5PWrbhQjwYEMXGK85lDYX9"</span>
org-gcal-file-alist <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"dehaeze.thomas@gmail.com"</span> . <span class="org-string">"~/Cloud/org/gcal.org"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com"</span> . <span class="org-string">"~/Cloud/org/gcal_phd.org"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Automatic fetch of the new events</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">org-agenda-mode-hook</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-gcal-fetch</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org38a8163" class="outline-2">
<h2 id="org38a8163">Org Babel</h2>
<div class="outline-text-2" id="text-org38a8163">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org97bf4fc" class="outline-3">
<h3 id="org97bf4fc">Main configuration</h3>
<div class="outline-text-3" id="text-org97bf4fc">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Don't ask for confirmation when evalutating latex blocs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">my-org-confirm-babel-evaluate</span> <span class="org-rainbow-delimiters-depth-2">(</span>lang body<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">not</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">member</span> lang <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"emacs-lisp"</span> <span class="org-string">"latex"</span> <span class="org-string">"matlab"</span> <span class="org-string">"sh"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-confirm-babel-evaluate</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">my-org-confirm-babel-evaluate</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Use the current window for C-c ' source editing</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-src-window-setup</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">current-window</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgaf1f268" class="outline-3">
<h3 id="orgaf1f268">Special Shortcuts</h3>
<div class="outline-text-3" id="text-orgaf1f268">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://emacs.stackexchange.com/questions/13869/how-to-toggle-org-mode-source-code-block-eval-no-status">https://emacs.stackexchange.com/questions/13869/how-to-toggle-org-mode-source-code-block-eval-no-status</a>
</p>
<p>
Remap <code>ctrl-ret</code> to execute the source block and go to the next source block
when inside a source block. Otherwise, keep the normal behavior for ctrl-ent.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/ctrl-ret</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">in-src-block-p</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Returns t when the point is inside a source code block"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"src"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-in-block-p</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"src"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">in-src-block-function</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-doc">"Function to do when inside the src block"</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-execute-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-next-src-block</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span>in-src-block-p<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>in-src-block-function<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">+org--insert-item</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">below</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">evil-org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">"&lt;C-return&gt;"</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">tdh/ctrl-ret</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(evil-define-minor-mode-key 'normal 'org-src-mode "q" 'org-edit-src-exit)</span>
</pre>
</div>
<p>
Remap <code>C-c C-c</code>:
<a href="https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530">https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530</a>
</p>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgee4e789" class="outline-3">
<h3 id="orgee4e789">Library of Babel</h3>
<div class="outline-text-3" id="text-orgee4e789">
2020-01-11 22:04:45 +01:00
<p>
Add all named source blocks to <code>org-babel-library-of-babel</code>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-lob-ingest</span> <span class="org-string">"~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org232fea8" class="outline-3">
<h3 id="org232fea8">Org-Babel Matlab</h3>
<div class="outline-text-3" id="text-org232fea8">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-matlab-shell-command <span class="org-string">"/home/thomas/bin/matlab -nodesktop -nosplash"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-matlab-emacs-link-wrapper-method
<span class="org-string">"%s</span>
<span class="org-string"> if ischar(ans);</span>
<span class="org-string"> echo('test');</span>
<span class="org-string"> fid = fopen('%s', 'w');</span>
<span class="org-string"> fprintf(fid, '%s', ans);</span>
<span class="org-string"> fclose(fid);</span>
<span class="org-string"> else;</span>
<span class="org-string"> save -ascii %s ans;</span>
<span class="org-string"> end</span>
<span class="org-string"> delete('%s');</span>
<span class="org-string"> "</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb2af97c" class="outline-3">
<h3 id="orgb2af97c">Default options for Matlab code</h3>
<div class="outline-text-3" id="text-orgb2af97c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-babel-default-header-args:matlab
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:results</span> . <span class="org-string">"none"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:session</span> . <span class="org-string">"*MATLAB*"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:comments</span> . <span class="org-string">"org"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:exports</span> . <span class="org-string">"both"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:cache</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:noweb</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:hlines</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:tangle</span> . <span class="org-string">"no"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:mkdir</span> . <span class="org-string">"yes"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-builtin">:eval</span> . <span class="org-string">"no-export"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org67870de" class="outline-3">
<h3 id="org67870de"><span class="todo TODO">TODO</span> Asynchronous execution</h3>
<div class="outline-text-3" id="text-org67870de">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(push "~/.emacs.d/private/ob-session-async/lisp/" load-path)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'ob-session-async)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(with-eval-after-load "ob"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'org-babel-eval-in-repl))</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(with-eval-after-load "eval-in-repl"</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(setq eir-jump-after-eval nil))</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org23285e9" class="outline-3">
<h3 id="org23285e9"><span class="todo TODO">TODO</span> Theme</h3>
<div class="outline-text-3" id="text-org23285e9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(after! org</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(require 'color)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org737e623" class="outline-3">
<h3 id="org737e623">Indentation</h3>
<div class="outline-text-3" id="text-org737e623">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">org-edit-src-content-indentation</span> <span class="org-highlight-numbers-number">2</span>
<span class="org-variable-name">org-src-tab-acts-natively</span> nil
<span class="org-variable-name">org-src-preserve-indentation</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org24e5955" class="outline-3">
<h3 id="org24e5955">Some functions for using Matlab with Org Babel</h3>
<div class="outline-text-3" id="text-org24e5955">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3715862" class="outline-4">
<h4 id="org3715862"><code>whos</code> matlab function</h4>
<div class="outline-text-4" id="text-org3715862">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/matlab-whos</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Get what is in the Matlab workspace"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">use-region-p</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>regionp <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">buffer-substring</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-beginning</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">region-end</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"whosEmacs "</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"whosEmacs"</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org898067f" class="outline-4">
<h4 id="org898067f"><code>help</code> matlab function</h4>
<div class="outline-text-4" id="text-org898067f">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/matlab-help</span> <span class="org-rainbow-delimiters-depth-2">(</span>start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Get help on the selected function"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"r"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>regionp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> start end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"help "</span> regionp <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org393d3e4" class="outline-4">
<h4 id="org393d3e4">Execute selected text</h4>
<div class="outline-text-4" id="text-org393d3e4">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/matlab-execute-selected</span> <span class="org-rainbow-delimiters-depth-2">(</span>start end<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Execute selected text in the *MATLAB* buffer"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"r"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>regionp <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">buffer-substring</span> start end<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> regionp<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org2d6198d" class="outline-4">
<h4 id="org2d6198d">Specify a Matlab command to run</h4>
<div class="outline-text-4" id="text-org2d6198d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/matlab-run-command</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Prompt user to enter a matlab command"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">read-string</span> <span class="org-string">"Matlab Command: "</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgc4aecc0" class="outline-4">
<h4 id="orgc4aecc0">Execute the current source block with no output</h4>
<div class="outline-text-4" id="text-orgc4aecc0">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> arg info params<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">org-babel-current-src-block-location</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">or</span> <span class="org-variable-name">org-babel-current-src-block-location</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">5</span> info<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-where-is-src-block-head</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">info</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> info <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">copy-tree</span> info<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-get-src-block-info</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Merge PARAMS with INFO before considering source block</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">evaluation since both could disagree.</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-callf</span> org-babel-merge-params <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-1">)</span> params<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-check-evaluate</span> info<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cl-callf</span> org-babel-process-params <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>params <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">2</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cache <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>c <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assq</span> <span class="org-builtin">:cache</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">and</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> arg<span class="org-rainbow-delimiters-depth-3">)</span> c <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">string=</span> <span class="org-string">"yes"</span> c<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>new-hash <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-sha1-hash</span> info <span class="org-builtin">:eval</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>old-hash <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> cache <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-current-result-hash</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>current-cache <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">and</span> new-hash <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">equal</span> new-hash old-hash<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-3">(</span>current-cache
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">save-excursion</span> <span class="org-comment-delimiter">;</span><span class="org-comment">Return cached result.</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">goto-char</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-where-is-src-block-result</span> nil info<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">forward-line</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">skip-chars-forward</span> <span class="org-string">" \t"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>result <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-read-result</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"%"</span> <span class="org-string">"%%"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"%S"</span> result<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
result<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-confirm-evaluate</span> info<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let*</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>lang <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>result-params <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assq</span> <span class="org-builtin">:result-params</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Expand noweb references in BODY and remove any</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">coderef.</span>
<span class="org-rainbow-delimiters-depth-3">(</span>body
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>coderef <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">6</span> info<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>expand
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-noweb-p</span> params <span class="org-builtin">:eval</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-expand-noweb-references</span> info<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">1</span> info<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> coderef<span class="org-rainbow-delimiters-depth-3">)</span> expand
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-src-coderef-regexp</span> coderef<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">""</span> expand nil nil <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>dir <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assq</span> <span class="org-builtin">:dir</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>mkdirp <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assq</span> <span class="org-builtin">:mkdirp</span> params<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">default-directory</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">cond</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">not</span> dir<span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">member</span> mkdirp <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-string">"no"</span> <span class="org-string">"nil"</span> nil<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>t
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span>d <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-as-directory</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">expand-file-name</span> dir<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">make-directory</span> d <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">parents</span><span class="org-rainbow-delimiters-depth-1">)</span>
d<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>cmd <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">intern</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"org-babel-execute:"</span> lang<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
result<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(message "%s" body)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> body <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
result<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgdac97cf" class="outline-4">
<h4 id="orgdac97cf">Execute the source block and go to the next one</h4>
<div class="outline-text-4" id="text-orgdac97cf">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute-goto-next</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> arg info params<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">tdh/org-babel-execute</span> arg info params<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">org-babel-next-src-block</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org45afc29" class="outline-4">
<h4 id="org45afc29">Org-Babel Tangle Subtree</h4>
<div class="outline-text-4" id="text-org45afc29">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-tangle-subtree</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Tangle the current subtree"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">progn</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-narrow-to-subtree</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">org-babel-tangle</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">widen</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",bT"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-babel-tangle-subtree</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org6a42fd3" class="outline-4">
<h4 id="org6a42fd3">Org-Babel Jump to Tangle File</h4>
<div class="outline-text-4" id="text-org6a42fd3">
2020-01-11 22:04:45 +01:00
<p>
Actually this tangle the file and then go to the file. Maybe I would like to ignore the tangling phase.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-jump-to-tangle-file</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Jump to tangle file for the source block at point."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file <span class="org-variable-name">org-babel-pre-tangle-hook</span> <span class="org-variable-name">org-babel-post-tangle-hook</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">write-region</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file filename<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete-file</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">find-file</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">error</span> <span class="org-string">"Cannot open tangle file %S"</span> file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",bF"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/org-babel-jump-to-tangle-file</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org77395e8" class="outline-4">
<h4 id="org77395e8">Org-Babel Tangle File and Execute</h4>
<div class="outline-text-4" id="text-org77395e8">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/org-babel-execute-tangle-file</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Jump to tangle file for the source block at point."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span>file <span class="org-variable-name">org-babel-pre-tangle-hook</span> <span class="org-variable-name">org-babel-post-tangle-hook</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">cl-letf</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">write-region</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>start end filename <span class="org-type">&amp;rest</span> _ignore<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file filename<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">symbol-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete-file</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-babel-tangle</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-highlight-numbers-number">4</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">when</span> file
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> file <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">expand-file-name</span> file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">if</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">file-readable-p</span> file<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">process-send-string</span> <span class="org-string">"*MATLAB*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"run "</span> file <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">error</span> <span class="org-string">"Cannot open tangle file %S"</span> file<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgba4e015" class="outline-2">
<h2 id="orgba4e015">LaTeX</h2>
<div class="outline-text-2" id="text-orgba4e015">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick">https://tex.stackexchange.com/questions/52179/what-is-your-favorite-emacs-and-or-auctex-command-trick</a></li>
<li><a href="https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex">https://tex.stackexchange.com/questions/20843/useful-shortcuts-or-key-bindings-or-predefined-commands-for-emacsauctex</a></li>
</ul>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org40b5f06" class="outline-3">
<h3 id="org40b5f06">Basic LaTeX configuration</h3>
<div class="outline-text-3" id="text-org40b5f06">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">latex/clean</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Clean LaTeX output using latexmk"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">async-shell-command</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">command and parameters</span>
<span class="org-string">"latexmk -c "</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-quote-argument</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-string">" &amp;"</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">LaTeX-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",C"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">latex/clean</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">TeX-mode-hook</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-variable-name">TeX-fold-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0822b20" class="outline-3">
<h3 id="org0822b20">Master file</h3>
<div class="outline-text-3" id="text-org0822b20">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq-default</span> <span class="org-variable-name">TeX-master</span> nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga5f09b3" class="outline-3">
<h3 id="orga5f09b3">Pdf Viewer</h3>
<div class="outline-text-3" id="text-orga5f09b3">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-view-program-selection</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>output-pdf <span class="org-string">"Zathura"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-source-correlate-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-source-correlate-start-server</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-source-correlate-method</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">synctex</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">TeX-view-program-list</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"PDF Tools"</span> TeX-pdf-tools-sync-view<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgfa81b45" class="outline-2">
<h2 id="orgfa81b45">Helm-Bibtex</h2>
<div class="outline-text-2" id="text-orgfa81b45">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1f30ffc" class="outline-3">
<h3 id="org1f30ffc">General Config</h3>
<div class="outline-text-3" id="text-org1f30ffc">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">Use "tags" field when looking for bib entries</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> helm-bibtex-additional-search-fields <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>keywords<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Display of bibtex entries with helm</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-display-formats
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>t . <span class="org-string">"${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Special symbols for notes and pdf</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-pdf-symbol <span class="org-string">"&#8984;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-symbol <span class="org-string">"&#9998;"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Bibliography file</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-bibliography <span class="org-string">"~/Cloud/thesis/ressources/references.bib"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with all the pdfs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-library-path <span class="org-string">"~/Cloud/thesis/ressources/pdfs"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Directory with notes files</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-path <span class="org-string">"~/Cloud/thesis/ressources/notes"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Template used when creating new Note file</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> bibtex-completion-notes-template-multiple-files <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">concat</span> <span class="org-string">"#+TITLE: ${title}\n"</span>
<span class="org-string">":DRAWER:\n"</span>
<span class="org-string">"#+LATEX_CLASS: biblioreport\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+OPTIONS: toc:nil title:nil\n"</span>
<span class="org-string">"#+OPTIONS: ':t -:t\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\newcommand{\\refKeywords}{${keywords}}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\input{config.tex}\n"</span>
<span class="org-string">"#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"</span>
<span class="org-string">"# #+TOC: headlines 2\n"</span>
<span class="org-string">":END:\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+BEGIN_abstract\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"#+END_abstract\n"</span>
<span class="org-string">"\n"</span>
<span class="org-string">"* ${title} :ignore:\n"</span>
<span class="org-string">":PROPERTIES:\n"</span>
<span class="org-string">":CUSTOM_ID: ${=key=}\n"</span>
<span class="org-string">":AUTHOR: ${author}\n"</span>
<span class="org-string">":TYPE: ${=type=}\n"</span>
<span class="org-string">":JOURNAL: ${journal}\n"</span>
<span class="org-string">":YEAR: ${year}\n"</span>
<span class="org-string">":VOLUME: ${volume}\n"</span>
<span class="org-string">":PAGES: ${pages}\n"</span>
<span class="org-string">":DOI: ${DOI}\n"</span>
<span class="org-string">":URL: ${url}\n"</span>
<span class="org-string">":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"</span>
<span class="org-string">":END:\n"</span>
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Make "Edit notes" the default action</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> helm-bibtex
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-delete-action-from-source</span> <span class="org-string">"Edit notes"</span> helm-source-bibtex<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Edit notes"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex-edit-notes</span> helm-source-bibtex <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org736240d" class="outline-3">
<h3 id="org736240d">Open pdf externally</h3>
<div class="outline-text-3" id="text-org736240d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdehaeze/open-pdf-externally</span> <span class="org-rainbow-delimiters-depth-2">(</span>key<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">call-process</span> <span class="org-string">"zathura"</span> nil <span class="org-highlight-numbers-number">0</span> nil <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">nth</span> <span class="org-highlight-numbers-number">0</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">-cons-to-list</span> <span class="org-rainbow-delimiters-depth-2">(</span>bibtex-completion-find-pdf key<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Action to open the pdf with Zathura</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">after!</span> helm-bibtex
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-delete-action-from-source</span> <span class="org-string">"Open PDF Externally"</span> helm-source-bibtex<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-add-action-to-source</span> <span class="org-string">"Open PDF Externally"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdehaeze/open-pdf-externally</span> helm-source-bibtex <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge872f2d" class="outline-3">
<h3 id="orge872f2d">Special Commands</h3>
<div class="outline-text-3" id="text-orge872f2d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">helm-bibtex-favorites</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-type">&amp;optional</span> arg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"Search Favorite BibTeX entries"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span> <span class="org-string">"P"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">helm-bibtex</span> arg nil <span class="org-string">"favorite "</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org29f4b2d" class="outline-3">
<h3 id="org29f4b2d">List all element of the bibliography without pdf associated</h3>
<div class="outline-text-3" id="text-org29f4b2d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">list-bib-without-pdf-associated</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>bibtex-completion-init<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidates <span class="org-rainbow-delimiters-depth-3">(</span>bibtex-completion-candidates<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">defun</span> <span class="org-function-name">canditate-is-pdf-present</span> <span class="org-rainbow-delimiters-depth-3">(</span>candidate<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>bibtex-completion-find-pdf-in-library <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">assoc</span> <span class="org-string">"=key="</span> candidate<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidates-without-pdf <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">remove-if</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">canditate-is-pdf-present</span> candidates<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">setq</span> candidate-without-pdf-names <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">mapcar</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>x<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">cdr</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">assoc</span> <span class="org-string">"title"</span> x<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
candidates-without-pdf<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">with-output-to-temp-buffer</span> <span class="org-string">"*bib-without-pdf*"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">princ</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">string-join</span> candidate-without-pdf-names <span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">switch-to-buffer-other-window</span> <span class="org-string">"*bib-without-pdf*"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org254cc52" class="outline-2">
<h2 id="org254cc52"><span class="todo TODO">TODO</span> Matlab</h2>
<div class="outline-text-2" id="text-org254cc52">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://github.com/yuhonglin/matlab-mode">https://github.com/yuhonglin/matlab-mode</a></li>
<li><a href="https://github.com/pronobis/matlab-mode">https://github.com/pronobis/matlab-mode</a></li>
</ul>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb915baf" class="outline-3">
<h3 id="orgb915baf">Setup Matlab Mode</h3>
<div class="outline-text-3" id="text-orgb915baf">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command <span class="org-string">"/home/thomas/bin/matlab"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> matlab-shell-command-switches <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"-nodesktop -nosplash"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mlint-programs <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"mlint"</span> <span class="org-string">"/home/thomas/bin/mlint"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb8a016c" class="outline-3">
<h3 id="orgb8a016c">Setup Flycheck</h3>
<div class="outline-text-3" id="text-orgb8a016c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defvar</span> <span class="org-variable-name">mlint-executable</span> <span class="org-string">"/home/thomas/bin/mlint"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">flycheck-define-command-checker</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-mlint</span>
<span class="org-doc">"A Matlab checker based on mlint."</span>
<span class="org-builtin">:command</span> <span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span>,<span class="org-variable-name">mlint-executable</span> source<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:error-patterns</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span>warning line-start <span class="org-string">"L "</span> line <span class="org-string">" (C "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">1+</span> digit<span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"): "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">message</span><span class="org-rainbow-delimiters-depth-1">)</span> line-end<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-builtin">:modes</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>matlab-mode<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-to-list</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flycheck-checkers</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-mlint</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Automatic startup of flycheck for matlab</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">matlab-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">flycheck-mode</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defadvice</span> <span class="org-function-name">org-edit-src-code</span> <span class="org-rainbow-delimiters-depth-2">(</span>around set-buffer-file-name activate compile<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>file-name <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">(1)</span>
ad-do-it <span class="org-comment-delimiter">;; </span><span class="org-comment">(2)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">buffer-file-name</span> file-name<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-comment-delimiter">;; </span><span class="org-comment">(3)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org75a9b08" class="outline-3">
<h3 id="org75a9b08"><span class="todo TODO">TODO</span> Setup Company - not working</h3>
<div class="outline-text-3" id="text-org75a9b08">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(add-to-list 'company-backends 'company-matlab)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgace4163" class="outline-3">
<h3 id="orgace4163"><span class="todo TODO">TODO</span> Beautify code</h3>
<div class="outline-text-3" id="text-orgace4163">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-beautify-buffer</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Beautify Current Buffer"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">save-buffer</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"MBeautify.formatFile(\""</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">"\")"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb85ca7e" class="outline-3">
<h3 id="orgb85ca7e">Key Bindings</h3>
<div class="outline-text-3" id="text-orgb85ca7e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-add-breakpoint</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstop in "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-remove-breakpoint</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span> <span class="org-string">" at "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">number-to-string</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">line-number-at-pos</span> nil<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-list-breakpoints</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbstatus "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-clear-breakpoints</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"dbclear in "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">buffer-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">matlab-go-to-file-directory</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>matlab-shell-run-command <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"cd "</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-name-directory</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">matlab-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">",g"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-go-to-file-directory</span>
<span class="org-builtin">:n</span> <span class="org-string">",da"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-add-breakpoint</span>
<span class="org-builtin">:n</span> <span class="org-string">",dr"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-remove-breakpoint</span>
<span class="org-builtin">:n</span> <span class="org-string">",dL"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-list-breakpoints</span>
<span class="org-builtin">:n</span> <span class="org-string">",dc"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">matlab-clear-breakpoints</span>
<span class="org-builtin">:n</span> <span class="org-string">",dl"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-cont</span>
<span class="org-builtin">:n</span> <span class="org-string">",ds"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-step</span>
<span class="org-builtin">:n</span> <span class="org-string">",dn"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-next</span>
<span class="org-builtin">:n</span> <span class="org-string">",dq"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">gud-finish</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgc7b5f09" class="outline-3">
<h3 id="orgc7b5f09">Wrong highlight of comments</h3>
<div class="outline-text-3" id="text-orgc7b5f09">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">matlab-mode-hook</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">' breaks MATLAB comment coloring --</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">' is mostly redundant with</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">rainbow-identifiers-mode</span></span><span class="org-comment">' anyway</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-3">()</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-variable-name">highlight-numbers-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">We must append the above *after* `</span><span class="org-comment"><span class="org-constant">spacemacs/run-prog-mode-hooks</span></span><span class="org-comment">'</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">in `</span><span class="org-comment"><span class="org-constant">matlab-mode-hook</span></span><span class="org-comment">', since the former hook enables</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">highlight-numbers-mode</span></span><span class="org-comment">'. Note that</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">spacemacs/run-prog-mode-hooks</span></span><span class="org-comment">' is manually added to</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">`</span><span class="org-comment"><span class="org-constant">matlab-mode-hook</span></span><span class="org-comment">' by Spacemacs since the upstream `</span><span class="org-comment"><span class="org-constant">matlab-mode</span></span><span class="org-comment">'</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">package does not derive `</span><span class="org-comment"><span class="org-constant">matlab-mode</span></span><span class="org-comment">' from `</span><span class="org-comment"><span class="org-constant">prog-mode</span></span><span class="org-comment">' (oddly --</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">IIRC the author refused to do so for compatibility with XEmacs).</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">append</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1e568d2" class="outline-2">
<h2 id="org1e568d2"><span class="todo TODO">TODO</span> Mails With Mu4e</h2>
<div class="outline-text-2" id="text-org1e568d2">
2020-01-11 22:04:45 +01:00
<ul class="org-ul">
<li><a href="https://github.com/kzar/davemail">https://github.com/kzar/davemail</a></li>
<li><a href="http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/">http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/</a></li>
<li><a href="http://spacemacs.org/layers/+email/mu4e/README.html">http://spacemacs.org/layers/+email/mu4e/README.html</a></li>
<li><a href="http://www.djcbsoftware.nl/code/mu/mu4e/index.html#Top">http://www.djcbsoftware.nl/code/mu/mu4e/index.html#Top</a></li>
<li><a href="https://notanumber.io/2016-10-03/better-email-with-mu4e/">https://notanumber.io/2016-10-03/better-email-with-mu4e/</a></li>
<li><a href="https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/">https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/</a></li>
<li><a href="http://www.brool.com/post/using-mu4e/">http://www.brool.com/post/using-mu4e/</a></li>
<li><a href="https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/">https://www.reddit.com/r/emacs/comments/8q84dl/tip_how_to_easily_manage_your_emails_with_mu4e/</a></li>
<li><a href="https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/">https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/</a></li>
</ul>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org5bfee6e" class="outline-3">
<h3 id="org5bfee6e">Set default mail user agent to mu4e</h3>
<div class="outline-text-3" id="text-org5bfee6e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">mail-user-agent</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">mu4e-user-agent</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgda797c0" class="outline-3">
<h3 id="orgda797c0">Default config</h3>
<div class="outline-text-3" id="text-orgda797c0">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org2135bdf" class="outline-4">
<h4 id="org2135bdf">Default behavior</h4>
<div class="outline-text-4" id="text-org2135bdf">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-maildir <span class="org-string">"~/.mail"</span>
mu4e-update-interval nil
mu4e-compose-signature-auto-include t
mu4e-view-show-images t
mu4e-view-show-addresses t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org351ec11" class="outline-4">
<h4 id="org351ec11">Default folders</h4>
<div class="outline-text-4" id="text-org351ec11">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-sent-folder <span class="org-string">"/gmail/Sent"</span>
mu4e-drafts-folder <span class="org-string">"/gmail/Drafts"</span>
mu4e-trash-folder <span class="org-string">"/gmail/Trash"</span>
mu4e-refile-folder <span class="org-string">"/gmail/Archive"</span>
mu4e-compose-signature <span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-variable-name">user-mail-address</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org209e099" class="outline-4">
<h4 id="org209e099">Default signature and email address</h4>
<div class="outline-text-4" id="text-org209e099">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-compose-signature <span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-variable-name">user-mail-address</span> <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org40bed5b" class="outline-4">
<h4 id="org40bed5b">Saving the attachment to Downloads directory</h4>
<div class="outline-text-4" id="text-org40bed5b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-attachment-dir <span class="org-string">"~/Downloads"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgf8442ad" class="outline-4">
<h4 id="orgf8442ad">A list of user&rsquo;s e-mail addresses</h4>
<div class="outline-text-4" id="text-orgf8442ad">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-user-mail-address-list <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-string">"dehaeze.thomas@gmail.com"</span> <span class="org-string">"thomas.dehaeze@esrf.fr"</span> <span class="org-string">"thomas.dehaeze@doct.ulg.ac.be"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org7d18a7c" class="outline-4">
<h4 id="org7d18a7c">Mail directory shortcuts</h4>
<div class="outline-text-4" id="text-org7d18a7c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-maildir-shortcuts
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"/gmail/Inbox"</span> . ?g<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"/esrf/Inbox"</span> . ?e<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"/ulg/Inbox"</span> . ?u<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orged0bdad" class="outline-3">
<h3 id="orged0bdad"><span class="todo TODO">TODO</span> Contexts - Email accounts</h3>
<div class="outline-text-3" id="text-orged0bdad">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-contexts
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span> ,<span class="org-rainbow-delimiters-depth-3">(</span>make-mu4e-context
<span class="org-builtin">:name</span> <span class="org-string">"gmail"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering Gmail context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving Gmail context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/gmail"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-messages-behavior . <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">delete</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"dehaeze.thomas@gmail.com"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/gmail/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/gmail/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/gmail/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/gmail/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
,<span class="org-rainbow-delimiters-depth-3">(</span>make-mu4e-context
<span class="org-builtin">:name</span> <span class="org-string">"esrf"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering ESRF context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving ESRF context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/esrf"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@esrf.fr"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/esrf/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/esrf/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/esrf/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/esrf/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
,<span class="org-rainbow-delimiters-depth-3">(</span>make-mu4e-context
<span class="org-builtin">:name</span> <span class="org-string">"ulg"</span>
<span class="org-builtin">:enter-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Entering ULG context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:leave-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">()</span> <span class="org-rainbow-delimiters-depth-2">(</span>mu4e-message <span class="org-string">"Leaving ULG context"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:match-func</span> <span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-2">(</span>msg<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">when</span> msg
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">string-match-p</span> <span class="org-string">"^/ulg"</span> <span class="org-rainbow-delimiters-depth-1">(</span>mu4e-message-field msg <span class="org-builtin">:maildir</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-builtin">:vars</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-1">(</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-variable-name">user-mail-address</span> . <span class="org-string">"thomas.dehaeze@doct.ulg.ac.be"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-sent-folder . <span class="org-string">"/ulg/Sent"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-trash-folder . <span class="org-string">"/ulg/Trash"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-drafts-folder . <span class="org-string">"/ulg/Drafts"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-refile-folder . <span class="org-string">"/ulg/Archive"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-compose-signature .
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span>
<span class="org-string">"Thomas Dehaeze\n"</span>
<span class="org-string">"\n"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-context-policy <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pick-first</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org292e66b" class="outline-3">
<h3 id="org292e66b">Receiving emails - Mbsync</h3>
<div class="outline-text-3" id="text-org292e66b">
2020-01-11 22:04:45 +01:00
<p>
Let systemd get the mail, then pressing <code>U</code> will just run <code>mu</code> to reindex everything.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-get-mail-command <span class="org-string">"true"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Fix for mbsync found <a href="http://pragmaticemacs.com/emacs/fixing-duplicate-uid-errors-when-using-mbsync-and-mu4e/">here</a>.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-change-filenames-when-moving t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1e17fcb" class="outline-3">
<h3 id="org1e17fcb">Sending emails - Msmtp</h3>
<div class="outline-text-3" id="text-org1e17fcb">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> smtpmail-default-smtp-server <span class="org-string">"smtp.gmail.com"</span>
smtpmail-smtp-server <span class="org-string">"smtp.gmail.com"</span>
smtpmail-smtp-service <span class="org-highlight-numbers-number">587</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">message-send-mail-function</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">message-send-mail-with-sendmail</span>
sendmail-program <span class="org-string">"msmtp"</span>
<span class="org-variable-name">user-full-name</span> <span class="org-string">"Thomas Dehaeze"</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgeb454c4" class="outline-3">
<h3 id="orgeb454c4">Bookmarks</h3>
<div class="outline-text-3" id="text-orgeb454c4">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-bookmarks
<span class="org-highlight-quoted-quote">`</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"flag:unread AND NOT flag:trashed"</span> <span class="org-string">"Unread messages"</span> ?u<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"date:today..now"</span> <span class="org-string">"Today's messages"</span> ?t<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"date:7d..now"</span> <span class="org-string">"Last 7 days"</span> ?w<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"mime:image/*"</span> <span class="org-string">"Messages with images"</span> ?p<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span>,<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">mapconcat</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">identity</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">mapcar</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-keyword">lambda</span> <span class="org-rainbow-delimiters-depth-1">(</span>maildir<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"maildir:"</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">car</span> maildir<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
mu4e-maildir-shortcuts<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-string">" OR "</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-string">"All inboxes"</span> ?i<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge273d2e" class="outline-3">
<h3 id="orge273d2e"><span class="todo TODO">TODO</span> Notifications</h3>
<div class="outline-text-3" id="text-orge273d2e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">with-eval-after-load</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">mu4e-alert</span>
<span class="org-rainbow-delimiters-depth-2">(</span>mu4e-alert-set-default-style <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">libnotify</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mu4e-alert-enable-notifications<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
Mode-line notifications
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-enable-mode-line t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgff62bae" class="outline-3">
<h3 id="orgff62bae">Use Org-Mode Tables In Emails</h3>
<div class="outline-text-3" id="text-orgff62bae">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">message-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-on-orgtbl</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-variable-name">message-mode-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">turn-on-orgstruct++</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org21199fc" class="outline-3">
<h3 id="org21199fc"><span class="todo TODO">TODO</span> Integration with Org-Mode</h3>
<div class="outline-text-3" id="text-org21199fc">
2020-01-11 22:04:45 +01:00
<p>
Store link to message if in header view, not to header query
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> org-mu4e-link-query-in-headers-mode nil<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga72de06" class="outline-3">
<h3 id="orga72de06"><span class="todo TODO">TODO</span> When putting something on the Trash, it will be in the archive folder on gmail</h3>
<div class="outline-text-3" id="text-orga72de06">
2020-01-11 22:04:45 +01:00
<p>
Even when totally deleting it. It will stay on gmail. How to fix that?
</p>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orga137f62" class="outline-3">
<h3 id="orga137f62"><span class="todo TODO">TODO</span> Verify that sending mails with gmail account works and that there is no duplicate</h3>
<div class="outline-text-3" id="text-orga137f62">
2020-01-11 22:04:45 +01:00
<p>
Should check this variable: mu4e-sent-messages-behavior
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> mu4e-sent-messages-behavior <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">delete</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<p>
And <a href="https://www.djcbsoftware.nl/code/mu/mu4e/Gmail-configuration.html">here</a>.
If I put it to delete, it works for gmail but not for the other ones&#x2026;
Check <a href="https://github.com/djcb/mu/issues/179">here</a>.
</p>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgdf9660c" class="outline-3">
<h3 id="orgdf9660c"><span class="todo TODO">TODO</span> Cheatsheet</h3>
<div class="outline-text-3" id="text-orgdf9660c">
2020-01-11 22:04:45 +01:00
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="org-left" />
<col class="org-left" />
</colgroup>
<thead>
<tr>
<th scope="col" class="org-left">Command</th>
<th scope="col" class="org-left">Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td class="org-left"><code>C-j</code></td>
<td class="org-left">Next mail</td>
</tr>
<tr>
<td class="org-left"><code>C-k</code></td>
<td class="org-left">Previous mail</td>
</tr>
<tr>
<td class="org-left"><code>R/C/F</code></td>
<td class="org-left">Reply/Compose/Forward</td>
</tr>
<tr>
<td class="org-left"><code>t</code></td>
<td class="org-left">Move to Archive</td>
</tr>
<tr>
<td class="org-left"><code>d</code></td>
<td class="org-left">Move to Trash</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgd5fd766" class="outline-2">
<h2 id="orgd5fd766">PDF-Tools</h2>
<div class="outline-text-2" id="text-orgd5fd766">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">add-hook</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">pdf-view-mode-hook</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">lambda</span><span class="org-rainbow-delimiters-depth-3">()</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">linum-mode</span> <span class="org-highlight-numbers-number">-1</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9828815" class="outline-2">
<h2 id="org9828815">Custom command and leader keys</h2>
<div class="outline-text-2" id="text-org9828815">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb4f71cc" class="outline-3">
<h3 id="orgb4f71cc">Watch LaTeX file using latexmk</h3>
<div class="outline-text-3" id="text-orgb4f71cc">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/latex/watch</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Watch LaTeX file using latexmk"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">start-process-shell-command</span> <span class="org-string">"latexmk-watch"</span> <span class="org-string">"*latexmk-watch-output*"</span>
<span class="org-string">"latexmk"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"-pdflatex=\"xelatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory='%s'\" -pdf -pvc -bibtex -f %s.tex"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">file-name-directory</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">file-name-base</span> <span class="org-variable-name">buffer-file-name</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/latex/watch/kill</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-doc">"Kill the currently running TeX job."</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">delete-process</span> <span class="org-string">"latexmk-watch"</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">",ow"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/latex/watch</span>
<span class="org-builtin">:n</span> <span class="org-string">",ok"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/latex/watch/kill</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org76cc82e" class="outline-3">
<h3 id="org76cc82e">Helm-Bibtex</h3>
<div class="outline-text-3" id="text-org76cc82e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span>
<span class="org-builtin">:n</span> <span class="org-string">",ob"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex</span>
<span class="org-builtin">:n</span> <span class="org-string">",of"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-bibtex-favorites</span>
<span class="org-builtin">:n</span> <span class="org-string">",or"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">helm-resume</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org2d6c0fe" class="outline-3">
<h3 id="org2d6c0fe">Open terminal in current directory</h3>
<div class="outline-text-3" id="text-org2d6c0fe">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/open-terminal-in-workdir</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">call-process-shell-command</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"termite --directory="</span> <span class="org-variable-name">default-directory</span><span class="org-rainbow-delimiters-depth-3">)</span> nil <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",ot"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/open-terminal-in-workdir</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgbefa4d1" class="outline-3">
<h3 id="orgbefa4d1">Open ranger in current directory</h3>
<div class="outline-text-3" id="text-orgbefa4d1">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">open-ranger-in-workdir</span> <span class="org-rainbow-delimiters-depth-2">()</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">interactive</span><span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">call-process-shell-command</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">concat</span> <span class="org-string">"termite --directory="</span> <span class="org-variable-name">default-directory</span> <span class="org-string">" --exec=ranger"</span><span class="org-rainbow-delimiters-depth-3">)</span> nil <span class="org-highlight-numbers-number">0</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">map!</span> <span class="org-builtin">:map</span> <span class="org-variable-name">org-mode-map</span> <span class="org-builtin">:n</span> <span class="org-string">",oo"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">open-ranger-in-workdir</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3ef34ce" class="outline-2">
<h2 id="org3ef34ce">Yassnippets</h2>
<div class="outline-text-2" id="text-org3ef34ce">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">push</span> <span class="org-string">"~/.config/doom/snippets"</span> <span class="org-variable-name">yas-snippet-dirs</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-variable-name">yas-global-mode</span> <span class="org-highlight-numbers-number">1</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org59bb8b7" class="outline-2">
<h2 id="org59bb8b7">Path for Shell</h2>
<div class="outline-text-2" id="text-org59bb8b7">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-comment-delimiter">;; </span><span class="org-comment">(when (memq window-system '(mac ns x))</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">(exec-path-from-shell-initialize))</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org6fc5eda" class="outline-2">
<h2 id="org6fc5eda">Proxy</h2>
<div class="outline-text-2" id="text-org6fc5eda">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">url-proxy-services</span>
<span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">(</span><span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"http"</span> . <span class="org-string">"proxy.esrf.fr:3128"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"https"</span> . <span class="org-string">"proxy.esrf.fr:3128"</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-string">"no_proxy"</span> . <span class="org-string">"^.*esrf.fr"</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org2788625" class="outline-2">
<h2 id="org2788625"><span class="todo TODO">TODO</span> Slack</h2>
<div class="outline-text-2" id="text-org2788625">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span>slack-register-team
<span class="org-builtin">:name</span> <span class="org-string">"emacs-slack"</span>
<span class="org-builtin">:default</span> t
<span class="org-builtin">:client-id</span> <span class="org-string">"299050134212.316863429523"</span>
<span class="org-builtin">:client-secret</span> <span class="org-string">"7168a660375090e517fe812ea2d136e5"</span>
<span class="org-builtin">:token</span> <span class="org-string">"xoxp-299050134212-299063259042-715794254097-7c319fdd63315620e86f1fad42c126a2"</span>
<span class="org-builtin">:subscribed-channels</span> <span class="org-highlight-quoted-quote">'</span><span class="org-rainbow-delimiters-depth-2">()</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">advice-add</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">slack-counts-update</span> <span class="org-builtin">:override</span> <span class="org-highlight-quoted-quote">#'</span><span class="org-highlight-quoted-symbol">ignore</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> slack-prefer-current-team t<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org12d5691" class="outline-2">
<h2 id="org12d5691"><span class="todo TODO">TODO</span> Neomutt connection</h2>
<div class="outline-text-2" id="text-org12d5691">
2020-01-11 22:04:45 +01:00
<p>
<a href="https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/">https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/</a>
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">require</span> <span class="org-highlight-quoted-quote">'</span><span class="org-constant">org-protocol</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Call this function, which spawns neomutt, whenever org-mode</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">defun</span> <span class="org-function-name">tdh/mutt-open-message</span> <span class="org-rainbow-delimiters-depth-2">(</span>message-id<span class="org-rainbow-delimiters-depth-2">)</span>
<span class="org-doc">"In neomutt, open the email with the the given Message-ID"</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-keyword">let*</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-rainbow-delimiters-depth-1">(</span>message-id <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"^/*"</span> <span class="org-string">""</span> message-id<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mail-file
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span>
<span class="org-string">"\n$"</span> <span class="org-string">""</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-command-to-string</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">format</span> <span class="org-string">"mu find -n 1 -f l i:%s"</span> message-id<span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mail-dir <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-function-name">replace-regexp-in-string</span> <span class="org-string">"/</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">(</span></span><span class="org-string">cur</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">new</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">|</span></span><span class="org-string">tmp</span><span class="org-string"><span class="org-regexp-grouping-backslash">\\</span></span><span class="org-string"><span class="org-regexp-grouping-construct">)</span></span><span class="org-string">/$"</span> <span class="org-string">""</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">file-name-directory</span> mail-file<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>message-id-escaped <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">regexp-quote</span> message-id<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mutt-keystrokes
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"L~i %s\n\n"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-function-name">shell-quote-argument</span> message-id-escaped<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span>mutt-command <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">list</span> <span class="org-string">"neomutt"</span> <span class="org-string">"-R"</span> <span class="org-string">"-f"</span> mail-dir
<span class="org-string">"-e"</span> <span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s'"</span> mutt-keystrokes<span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">message</span> <span class="org-string">"Launching neomutt for message %s"</span> message-id<span class="org-rainbow-delimiters-depth-3">)</span>
<span class="org-rainbow-delimiters-depth-3">(</span><span class="org-constant">call-process</span> <span class="org-string">"setsid"</span> nil nil
<span class="org-string">"-f"</span> <span class="org-string">"termite"</span> <span class="org-string">"-e"</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-constant">concat</span> <span class="org-string">"neomutt -R -f "</span> mail-dir <span class="org-string">" -e \""</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">format</span> <span class="org-string">"push '%s a l'\""</span> mutt-keystrokes<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span><span class="org-rainbow-delimiters-depth-3">)</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">Hook up `message:...` style URLs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">org-add-link-type</span> <span class="org-string">"message"</span> <span class="org-highlight-quoted-quote">'</span><span class="org-highlight-quoted-symbol">tdh/mutt-open-message</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgdc9453d" class="outline-2">
<h2 id="orgdc9453d">Abbreviations</h2>
<div class="outline-text-2" id="text-orgdc9453d">
2020-01-11 22:04:45 +01:00
<p>
Type the abbreviation and use <code>C-x a -</code> to create a new abbreviation.
</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq-default</span> <span class="org-variable-name">abbrev-mode</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">save abbreviations upon exiting xemacs</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">save-abbrevs</span> t<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">set the file storing the abbreviations</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">setq</span> <span class="org-variable-name">abbrev-file-name</span> <span class="org-string">"~/.config/doom/my-abbreviations.el"</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-comment-delimiter">;; </span><span class="org-comment">reads the abbreviations file on startup</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-function-name">quietly-read-abbrev-file</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgda861fb" class="outline-2">
<h2 id="orgda861fb">Other</h2>
<div class="outline-text-2" id="text-orgda861fb">
2020-01-11 22:04:45 +01:00
<p>
Here are some additional functions/macros that could help you configure Doom:
</p>
<ul class="org-ul">
<li>`load!&rsquo; for loading external *.el files relative to this one</li>
<li>`use-package&rsquo; for configuring packages</li>
<li>`after!&rsquo; for running code after a package has loaded</li>
<li>`add-load-path!&rsquo; for adding directories to the `load-path&rsquo;, where Emacs
looks when you load packages with `require&rsquo; or `use-package&rsquo;.</li>
<li>`map!&rsquo; for binding new keys</li>
</ul>
<p>
To get information about any of these functions/macros, move the cursor over
the highlighted symbol at press &rsquo;K&rsquo; (non-evil users must press &rsquo;C-c g k&rsquo;).
This will open documentation for it, including demos of how they are used.
</p>
<p>
You can also try &rsquo;gd&rsquo; (or &rsquo;C-c g d&rsquo;) to jump to their definition and see how
they are implemented.
</p>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org0b90463" class="outline-2">
<h2 id="org0b90463">Doom <code>init.el</code></h2>
<div class="outline-text-2" id="text-org0b90463">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">doom!</span> <span class="org-builtin">:completion</span>
company <span class="org-comment-delimiter">; </span><span class="org-comment">the ultimate code completion backend</span>
helm <span class="org-comment-delimiter">; </span><span class="org-comment">the *other* search engine for love and life</span>
ivy <span class="org-comment-delimiter">; </span><span class="org-comment">a search engine for love and life</span>
<span class="org-builtin">:ui</span>
doom <span class="org-comment-delimiter">; </span><span class="org-comment">what makes DOOM look the way it does</span>
doom-dashboard <span class="org-comment-delimiter">; </span><span class="org-comment">a nifty splash screen for Emacs</span>
hl-todo <span class="org-comment-delimiter">; </span><span class="org-comment">highlight </span><span class="org-bold"><span class="org-warning">TODO</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-error">FIXME</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-success">NOTE</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-doc">DEPRECATED</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-constant">HACK</span></span><span class="org-comment">/</span><span class="org-bold"><span class="org-keyword">REVIEW</span></span>
hydra
modeline <span class="org-comment-delimiter">; </span><span class="org-comment">snazzy, Atom-inspired modeline, plus API</span>
nav-flash <span class="org-comment-delimiter">; </span><span class="org-comment">blink the current line after jumping</span>
ophints <span class="org-comment-delimiter">; </span><span class="org-comment">highlight the region an operation acts on</span>
<span class="org-rainbow-delimiters-depth-2">(</span>popup <span class="org-comment-delimiter">; </span><span class="org-comment">tame sudden yet inevitable temporary windows</span>
+all <span class="org-comment-delimiter">; </span><span class="org-comment">catch all popups that start with an asterix</span>
+defaults<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">default popup rules</span>
unicode <span class="org-comment-delimiter">; </span><span class="org-comment">extended unicode support for various languages</span>
vc-gutter <span class="org-comment-delimiter">; </span><span class="org-comment">vcs diff in the fringe</span>
vi-tilde-fringe <span class="org-comment-delimiter">; </span><span class="org-comment">fringe tildes to mark beyond EOB</span>
window-select <span class="org-comment-delimiter">; </span><span class="org-comment">visually switch windows</span>
workspaces <span class="org-comment-delimiter">; </span><span class="org-comment">tab emulation, persistence &amp; separate workspaces</span>
<span class="org-builtin">:editor</span>
<span class="org-rainbow-delimiters-depth-2">(</span>evil +everywhere<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-comment-delimiter">; </span><span class="org-comment">come to the dark side, we have cookies</span>
fold <span class="org-comment-delimiter">; </span><span class="org-comment">(nigh) universal code folding</span>
rotate-text <span class="org-comment-delimiter">; </span><span class="org-comment">cycle region at point between text candidates</span>
snippets <span class="org-comment-delimiter">; </span><span class="org-comment">my elves. They type so I don't have to</span>
<span class="org-variable-name">word-wrap</span> <span class="org-comment-delimiter">; </span><span class="org-comment">soft wrapping with language-aware indent</span>
<span class="org-builtin">:emacs</span>
dired <span class="org-comment-delimiter">; </span><span class="org-comment">making dired pretty [functional]</span>
electric <span class="org-comment-delimiter">; </span><span class="org-comment">smarter, keyword-based electric-indent</span>
ibuffer <span class="org-comment-delimiter">; </span><span class="org-comment">interactive buffer management</span>
vc <span class="org-comment-delimiter">; </span><span class="org-comment">version-control and Emacs, sitting in a tree</span>
<span class="org-builtin">:term</span>
eshell <span class="org-comment-delimiter">; </span><span class="org-comment">a consistent, cross-platform shell (WIP)</span>
<span class="org-builtin">:tools</span>
<span class="org-variable-name">debugger</span> <span class="org-comment-delimiter">; </span><span class="org-bold"><span class="org-error">FIXME</span></span><span class="org-comment"> stepping through code, to help you add bugs</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">ein ; tame Jupyter notebooks with emacs</span>
<span class="org-rainbow-delimiters-depth-2">(</span><span class="org-constant">eval</span> +overlay<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">run code, run (also, repls)</span>
<span class="org-rainbow-delimiters-depth-2">(</span>lookup <span class="org-comment-delimiter">; </span><span class="org-comment">helps you navigate your code and documentation</span>
+docsets<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">...or in Dash docsets locally</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">lsp</span>
magit <span class="org-comment-delimiter">; </span><span class="org-comment">a git porcelain for Emacs</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">make ; run make tasks from Emacs</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">pass ; password manager for nerds</span>
pdf <span class="org-comment-delimiter">; </span><span class="org-comment">pdf enhancements</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">rgb ; creating color strings</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">upload ; map local to remote projects via ssh/ftp</span>
<span class="org-builtin">:checkers</span>
syntax <span class="org-comment-delimiter">; </span><span class="org-comment">tasing you for every semicolon you forget</span>
spell <span class="org-comment-delimiter">; </span><span class="org-comment">tasing you for misspelling mispelling</span>
<span class="org-builtin">:lang</span>
data <span class="org-comment-delimiter">; </span><span class="org-comment">config/data formats</span>
emacs-lisp <span class="org-comment-delimiter">; </span><span class="org-comment">drown in parentheses</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">ess ; emacs speaks statistics</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">go ; the hipster dialect</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">(haskell +dante) ; a language that's lazier than I am</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">javascript ; all(hope(abandon(ye(who(enter(here))))))</span>
latex <span class="org-comment-delimiter">; </span><span class="org-comment">writing papers in Emacs has never been so fun</span>
markdown <span class="org-comment-delimiter">; </span><span class="org-comment">writing docs for people to ignore</span>
<span class="org-rainbow-delimiters-depth-2">(</span>org <span class="org-comment-delimiter">; </span><span class="org-comment">organize your plain life in plain text</span>
+dragndrop <span class="org-comment-delimiter">; </span><span class="org-comment">drag &amp; drop files/images into org buffers</span>
+hugo <span class="org-comment-delimiter">; </span><span class="org-comment">use Emacs for hugo blogging</span>
+journal <span class="org-comment-delimiter">;</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">+pomodoro ; be fruitful with the tomato technique</span>
+present<span class="org-rainbow-delimiters-depth-2">)</span> <span class="org-comment-delimiter">; </span><span class="org-comment">using org-mode for presentations</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">python ; beautiful is better than ugly</span>
sh <span class="org-comment-delimiter">; </span><span class="org-comment">she sells {ba,z,fi}sh shells on the C xor</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">web ; the tubes</span>
<span class="org-builtin">:email</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">(mu4e +gmail)</span>
<span class="org-builtin">:app</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">calendar</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">(rss +org) ; emacs as an RSS reader</span>
<span class="org-comment-delimiter">;;</span><span class="org-comment">write ; emacs for writers (fiction, notes, papers, etc.)</span>
<span class="org-builtin">:config</span>
literate
<span class="org-rainbow-delimiters-depth-2">(</span>default +bindings +smartparens<span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org973006b" class="outline-2">
<h2 id="org973006b">Doom <code>packages.el</code></h2>
<div class="outline-text-2" id="text-org973006b">
<div class="org-src-container">
<pre class="src src-emacs-lisp"><span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-noter<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> poet-theme<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-alert<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-gcal<span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> ox-latex-subfigure
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"linktohack/ox-latex-subfigure"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> matlab-mode
<span class="org-builtin">:recipe</span> <span class="org-rainbow-delimiters-depth-2">(</span><span class="org-builtin">:host</span> github <span class="org-builtin">:repo</span> <span class="org-string">"matlab-mode/mirror"</span><span class="org-rainbow-delimiters-depth-2">)</span><span class="org-rainbow-delimiters-depth-1">)</span>
<span class="org-rainbow-delimiters-depth-1">(</span><span class="org-keyword">package!</span> org-ref<span class="org-rainbow-delimiters-depth-1">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org2825322" class="outline-2">
<h2 id="org2825322">Snippets</h2>
<div class="outline-text-2" id="text-org2825322">
</div>
<div id="outline-container-org5528118" class="outline-3">
<h3 id="org5528118">LaTeX</h3>
<div class="outline-text-3" id="text-org5528118">
</div>
<div id="outline-container-org4373943" class="outline-4">
<h4 id="org4373943">Coordinate</h4>
<div class="outline-text-4" id="text-org4373943">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :coordinate</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\coordinate[${<span class="org-highlight-numbers-number">1</span>:-&gt;}] (${<span class="org-highlight-numbers-number">2</span>:name}) at (${<span class="org-highlight-numbers-number">3</span>:pointcoordinate});
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgd34961c" class="outline-4">
<h4 id="orgd34961c">Draw</h4>
<div class="outline-text-4" id="text-orgd34961c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :draw</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\draw[${<span class="org-highlight-numbers-number">1</span>:-&gt;}] (${<span class="org-highlight-numbers-number">2</span>:point1}) -- (${<span class="org-highlight-numbers-number">3</span>:point2});
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org181d202" class="outline-4">
<h4 id="org181d202">Node</h4>
<div class="outline-text-4" id="text-org181d202">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :node</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
node[${<span class="org-highlight-numbers-number">1</span>:below right}] (${<span class="org-highlight-numbers-number">2</span>:name}) {${<span class="org-highlight-numbers-number">3</span>:label}};
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9f72371" class="outline-4">
<h4 id="org9f72371">Path</h4>
<div class="outline-text-4" id="text-org9f72371">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :path</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\path[${<span class="org-highlight-numbers-number">1</span>}] (${<span class="org-highlight-numbers-number">2</span>:point1}) -- (${<span class="org-highlight-numbers-number">3</span>:point2});
$0
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgf1443b6" class="outline-3">
<h3 id="orgf1443b6">Matlab</h3>
<div class="outline-text-3" id="text-orgf1443b6">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge9ad144" class="outline-4">
<h4 id="orge9ad144">Clear</h4>
<div class="outline-text-4" id="text-orge9ad144">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :clear and close all</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
clear; close all; clc;
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org92008ce" class="outline-4">
<h4 id="org92008ce">Function</h4>
<div class="outline-text-4" id="text-org92008ce">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :function</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-variable-name">function </span>[${<span class="org-highlight-numbers-number">4</span>:outputs}] = ${<span class="org-highlight-numbers-number">1</span>:functionName}(${<span class="org-highlight-numbers-number">2</span>:inputs}, ${<span class="org-highlight-numbers-number">3</span>:opts_param})
% $1 - Description
%
% Syntax: $1($2, $3)
%
% Inputs:
% - $2 -
% - $3 - Optionals parameters: structure with the following fields:
% -
%
% Outputs:
% - $4 -
%% Default value for opts
<span class="org-variable-name">opts</span> = struct(...
<span class="org-string">'${5:outputs}'</span>, ${<span class="org-highlight-numbers-number">6</span>:default_value} ...
);
if exist(<span class="org-string">'opts_param'</span>,<span class="org-string">'var'</span>)
<span class="org-variable-name">for opt</span> = fieldnames($3)<span class="org-string">'</span>
<span class="org-string"> if sum(strcmp(fieldnames(opts), opt{1})) == 1</span>
<span class="org-string"> opts.(opt{1}) = $3.(opt{1});</span>
<span class="org-string"> else</span>
<span class="org-string"> warning(sprintf('</span>%s is not a valid option.<span class="org-string">', opt{1}));</span>
<span class="org-string"> end</span>
<span class="org-string"> end</span>
<span class="org-string">end</span>
<span class="org-string">$0</span>
</pre>
</div>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3ffdc27" class="outline-3">
<h3 id="org3ffdc27">Org Mode</h3>
<div class="outline-text-3" id="text-org3ffdc27">
2020-01-11 22:04:45 +01:00
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb14fbd1" class="outline-4">
<h4 id="orgb14fbd1">Begin</h4>
<div class="outline-text-4" id="text-orgb14fbd1">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :LaTeX Environment</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\begin{${<span class="org-highlight-numbers-number">1</span>:equation}}
$0
\end{$1}
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org259484c" class="outline-4">
<h4 id="org259484c">Block</h4>
<div class="outline-text-4" id="text-org259484c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Org-Mode Block</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: block</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter"><span class="org-type">#</span></span><span class="org-comment"><span class="org-type">+begin_$</span></span><span class="org-comment">{1:$$(let ((type (yas-choose-value '("src" "example" "quote" "verse" "center" "latex" "html" "ascii"))))</span>
(if type (concat type (if (equal type <span class="org-string">"src"</span>)
(concat <span class="org-string">" "</span> (yas-choose-value <span class="org-string">'("emacs-lisp" "latex" "python" "sh" "matlab")))))))}</span>
<span class="org-string">$0</span>
<span class="org-string">#+end_${1:$(car (split-string yas-text))}</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org80d6477" class="outline-4">
<h4 id="org80d6477">Custom Box</h4>
<div class="outline-text-4" id="text-org80d6477">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Custom Box</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :options [$1]{${2:blue}}{${3:ams nodisplayskip}}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_cbox</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_cbox</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb55b3fb" class="outline-4">
<h4 id="orgb55b3fb">Latex Class</h4>
<div class="outline-text-4" id="text-orgb55b3fb">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: latex-class</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: lc</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">expand-env: ((classes (mapcar 'car org-latex-classes)))</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+latex_class: ${1:$$(yas-choose-value classes)}</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgad6980c" class="outline-4">
<h4 id="orgad6980c">Name Caption Figure</h4>
<div class="outline-text-4" id="text-orgad6980c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: name-caption-figure</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: ncf</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Caption}</span>
[[${<span class="org-highlight-numbers-number">3</span>:`(read-file-name <span class="org-string">"File: "</span>)`}]]
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org95537ff" class="outline-4">
<h4 id="org95537ff">Bibliography with completion</h4>
<div class="outline-text-4" id="text-org95537ff">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: bibliography with completion</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: bib</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
bibliography:${<span class="org-highlight-numbers-number">1</span>:$$(yas-choose-value (org-ref-find-bibliography))}
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge9c5c7e" class="outline-4">
<h4 id="orge9c5c7e">Cite</h4>
<div class="outline-text-4" id="text-orge9c5c7e">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: org-ref cite link</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: cite</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
cite:${<span class="org-highlight-numbers-number">1</span>:$$(completing-read
<span class="org-string">"bibtex key: "</span>
(let ((bibtex-files (org-ref-find-bibliography)))(bibtex-global-key-alist)))}
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgab1efe3" class="outline-4">
<h4 id="orgab1efe3">Ref</h4>
<div class="outline-text-4" id="text-orgab1efe3">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">name: org-ref ref link with completion</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">key: ref</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
ref:${<span class="org-highlight-numbers-number">1</span>:$$(completing-read <span class="org-string">"label: "</span> (org-ref-get-labels))}
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgd15fe60" class="outline-4">
<h4 id="orgd15fe60">Beamer - CBOX</h4>
<div class="outline-text-4" id="text-orgd15fe60">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Beamer Custom Box</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
*** ${<span class="org-highlight-numbers-number">1</span>:@@latex:@@} :B_cbox:
,:PROPERTIES:
:BEAMER_env: cbox
:BEAMER_opt: {${<span class="org-highlight-numbers-number">2</span>:blue}}{${<span class="org-highlight-numbers-number">3</span>:ams nodisplayskip}}
:END:
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgc07c6da" class="outline-4">
<h4 id="orgc07c6da">Code</h4>
<div class="outline-text-4" id="text-orgc07c6da">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Code</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${1:Listing Caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+label: lst:${2:listing_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src ${3:listing_language}</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org2639fc5" class="outline-4">
<h4 id="org2639fc5">Equation</h4>
<div class="outline-text-4" id="text-org2639fc5">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Equation</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: eq:${1:equation_name}</span>
\begin{equation}
$0
\end{equation}
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org1d1ff55" class="outline-4">
<h4 id="org1d1ff55">Figure</h4>
<div class="outline-text-4" id="text-org1d1ff55">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Figure caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :${3:scale 1}</span>
[[file:${<span class="org-highlight-numbers-number">4</span>:figs/}$1.${<span class="org-highlight-numbers-number">5</span>:pdf}]]
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org5751d1a" class="outline-4">
<h4 id="org5751d1a">Frac</h4>
<div class="outline-text-4" id="text-org5751d1a">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :LaTeX Fraction</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\frac{$1}{$2} $0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org92e9729" class="outline-4">
<h4 id="org92e9729">Left</h4>
<div class="outline-text-4" id="text-org92e9729">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Left Right mathematical delimitations</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
\left$1 $0 \right$2
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org23f90e8" class="outline-4">
<h4 id="org23f90e8">Mconfig</h4>
<div class="outline-text-4" id="text-org23f90e8">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Configuration-Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab :session *MATLAB*</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :tangle ${1:filename}.m</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :comments org</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :exports both</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :results none</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :eval no-export</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :noweb yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :mkdirp yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+PROPERTY: header-args:matlab+ :output-dir ${2:figs}</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org4b1e650" class="outline-4">
<h4 id="org4b1e650">Mdescription</h4>
<div class="outline-text-4" id="text-org4b1e650">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Measurement-Description</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* Measurement description
** Setup :ignore:
*Setup*:
** Goal :ignore:
*Goal*:
** Measurements :ignore:
*Measurements*:
Three measurements are done:
| Measurement File | Description |
|-------------------------+------------------------------|
<span class="org-variable-name">|</span> =mat/data_${<span class="org-highlight-numbers-number">1</span>:<span class="org-highlight-numbers-number">001</span>}.mat= | $2 |
<span class="org-variable-name">Each of the measurement</span> =mat= file contains one =data= array with <span class="org-highlight-numbers-number">3</span> columns:
| Column number | Description |
|---------------+-------------------|
| <span class="org-highlight-numbers-number">1</span> | $3 |
| <span class="org-highlight-numbers-number">2</span> | $4 |
| <span class="org-highlight-numbers-number">3</span> | Time |
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb2291e3" class="outline-4">
<h4 id="orgb2291e3">Mfigure</h4>
<div class="outline-text-4" id="text-orgb2291e3">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :tangle no :exports results :results none :noweb yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png")</span>
&lt;&lt;plt-matlab&gt;&gt;$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:$1</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}</span>
[<span class="org-type">[file:$2/$1.png]</span>]
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgf3cbfa9" class="outline-4">
<h4 id="orgf3cbfa9">Mfunction</h4>
<div class="outline-text-4" id="text-orgf3cbfa9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Function</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Function Name}
:PROPERTIES:
:header-args:matlab+: :tangle src/${<span class="org-highlight-numbers-number">2</span>:matlab_file_name}.m
:header-args:matlab+: :comments none :mkdirp yes :eval no
:END:
&lt;&lt;sec:$2&gt;&gt;
This Matlab function is accessible [[file:src/$2.m][here]].
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab</span>
<span class="org-variable-name">function </span>[${<span class="org-highlight-numbers-number">4</span>:in_data}] = $2(${<span class="org-highlight-numbers-number">3</span>:in_data})
% $2 - $0
%
<span class="org-variable-name">% Syntax: </span>[<span class="org-constant">$4</span>] = $2($3)
%
% Inputs:
% - $3 -
%
% Outputs:
% - $4 -
end
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgf7999f5" class="outline-4">
<h4 id="orgf7999f5">Mheader</h4>
<div class="outline-text-4" id="text-orgf7999f5">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Heading Name}
:PROPERTIES:
:header-args:matlab+: :tangle matlab/${<span class="org-highlight-numbers-number">2</span>:matlab_file_name}.m
:header-args:matlab+: :comments org :mkdirp yes
:END:
&lt;&lt;sec:$2&gt;&gt;
** ZIP file containing the data and matlab files :ignore:
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src bash :exports none :results none</span>
if [ matlab/$2.m -nt data/$2.zip ]; then
cp matlab/$2.m $2.m;
zip data/$2 \
mat/data.mat \
$2.m
rm $2.m;
fi
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_note</span>
All the files (data and Matlab scripts) are accessible [[file:data/$2.zip][here]].
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_note</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org5a5cef9" class="outline-4">
<h4 id="org5a5cef9">Minipage</h4>
<div class="outline-text-4" id="text-org5a5cef9">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :minipage</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\begin{figure}[htbp]
\centering
\begin{minipage}[t]{<span class="org-highlight-numbers-number">0.49</span>\linewidth}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float nil :width 0.95\linewidth</span>
$0
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\end{minipage}%
\hfill%
\begin{minipage}[t]{<span class="org-highlight-numbers-number">0.49</span>\linewidth}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float nil :width 0.95\linewidth</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+BEGIN_EXPORT latex</span>
\end{minipage}
\end{figure}
<span class="org-comment-delimiter">#</span><span class="org-comment">+END_EXPORT</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org70b733c" class="outline-4">
<h4 id="org70b733c">Minit</h4>
<div class="outline-text-4" id="text-org70b733c">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Init</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
** Matlab Init :noexport:ignore:
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)</span>
&lt;&lt;matlab-dir&gt;&gt;
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :exports none :results silent :noweb yes</span>
&lt;&lt;matlab-init&gt;&gt;
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org30f89d0" class="outline-4">
<h4 id="org30f89d0">Mtable</h4>
<div class="outline-text-4" id="text-org30f89d0">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Matlab-Table</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)</span>
data2orgtable(${<span class="org-highlight-numbers-number">1</span>:data}, {${<span class="org-highlight-numbers-number">2</span>:<span class="org-string">'rowlabel'</span>}}, {${<span class="org-highlight-numbers-number">3</span>:<span class="org-string">'collabel'</span>}}, <span class="org-string">' %.1f '</span>);
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgfd7a1cd" class="outline-4">
<h4 id="orgfd7a1cd">Multicolumn</h4>
<div class="outline-text-4" id="text-orgfd7a1cd">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Multcolumn</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float multicolumn</span>
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgc2373d1" class="outline-4">
<h4 id="orgc2373d1">Subfigure</h4>
<div class="outline-text-4" id="text-orgc2373d1">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Subfigure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:figure caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :environment subfigure :width 0.49\linewidth :align c</span>
| file:${<span class="org-highlight-numbers-number">3</span>:sub_fig_name}.${<span class="org-highlight-numbers-number">4</span>:pdf} | file:${<span class="org-highlight-numbers-number">5</span>:sub_fig_name}.${<span class="org-highlight-numbers-number">6</span>:pdf} |
| &lt;&lt;fig:$3&gt;&gt; ${<span class="org-highlight-numbers-number">7</span>:sub figure caption} | &lt;&lt;fig:$5&gt;&gt; ${<span class="org-highlight-numbers-number">8</span>:sub figure caption} |
$0
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgb52e91a" class="outline-4">
<h4 id="orgb52e91a">Table</h4>
<div class="outline-text-4" id="text-orgb52e91a">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Table</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: tab:${1:table_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: ${2:Table caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :environment tabularx :width ${3:\linewidth} :align ${4:lXX}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :center t :booktabs t :float t</span>
| $0 | | |
|---+---+---|
| | | |
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orge7e429b" class="outline-4">
<h4 id="orge7e429b">Tikz</h4>
<div class="outline-text-4" id="text-orge7e429b">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file ${1:figure_name}.pdf :post pdf2svg(file=*this*, ext="png") :exports both</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-orgd8391f5" class="outline-4">
<h4 id="orgd8391f5">Tikzfig</h4>
<div class="outline-text-4" id="text-orgd8391f5">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz Figure</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:${1:figure_name}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :headers '("\\\\usepackage{tikz}" "\\\\usepackage{import}" "\\\\import{$HOME/Cloud/thesis/LaTeX/}{config.tex}")</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :imagemagick t :fit yes :iminoptions -scale 100% -density 150 :imoutoptions -quality 100</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :results raw replace :buffer no :eval no-export :exports both :mkdirp yes</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+HEADER: :output-dir ${2:figs}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file $1.pdf :post pdf2svg(file=*this*, ext="png") :exports both</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+NAME: fig:$1</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+CAPTION: ${3:Caption}</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+RESULTS: fig:$1</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org9c62abd" class="outline-4">
<h4 id="org9c62abd">Tikzheader</h4>
<div class="outline-text-4" id="text-org9c62abd">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Tikz Header</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
* ${<span class="org-highlight-numbers-number">1</span>:Title/Description of the figure}
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src latex :file ${2:figure_name}.pdf :tangle figs/$2.tex :exports ${3:both}</span>
\begin{tikzpicture}
$0
\end{tikzpicture}
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+name: fig:$2</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+caption: $1 ([[./figs/$2.png][png]], [[./figs/$2.pdf][pdf]], [[./figs/$2.tex][tex]]).</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+RESULTS:</span>
[<span class="org-type">[file:./figs/$2.png]</span>]
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org3e7452d" class="outline-4">
<h4 id="org3e7452d">User-config</h4>
<div class="outline-text-4" id="text-org3e7452d">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">-*- mode: snippet -*-</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">name: user-config</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">key: uc</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src emacs-lisp :tangle user-config.el</span>
$1
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org21f61c6" class="outline-4">
<h4 id="org21f61c6">User-init</h4>
<div class="outline-text-4" id="text-org21f61c6">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter"># </span><span class="org-comment">-*- mode: snippet -*-</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">name: user-init</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">key: ui</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+begin_src emacs-lisp :tangle user-init.el</span>
$1
<span class="org-comment-delimiter">#</span><span class="org-comment">+end_src</span>
</pre>
</div>
</div>
</div>
2020-01-12 00:19:16 +01:00
<div id="outline-container-org61d3113" class="outline-4">
<h4 id="org61d3113">Wrap</h4>
<div class="outline-text-4" id="text-org61d3113">
2020-01-11 22:04:45 +01:00
<div class="org-src-container">
<pre class="src src-conf"><span class="org-comment-delimiter">#</span><span class="org-comment">contributor : Thomas Dehaeze <a href="mailto:dehaeze.thomas%40gmail.com">&lt;dehaeze.thomas@gmail.com&gt;</a></span>
<span class="org-comment-delimiter">#</span><span class="org-comment">name :Wrap</span>
<span class="org-comment-delimiter"># </span><span class="org-comment">--</span>
<span class="org-comment-delimiter">#</span><span class="org-comment">+attr_latex: :float wrap</span>
$0
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2020-01-12 00:19:16 +01:00
<p class="date">Created: 2020-01-12 dim. 00:18</p>
2020-01-11 22:04:45 +01:00
</div>
</body>
</html>