http://spacemacs.org/layers/+emacs/org/README.html https://org-babel.readthedocs.io/en/latest/ https://gist.github.com/drj42/1755992 https://github.com/kshenoy/dotfiles/blob/master/emacs.org
- bold italic underlined
verbatim
strikethroughC-c C-l for hyperlink - escape comma in verbatim by prepending with ZERO WIDTH SPACE
C-x 8 RET 200b RET
This is [fn:1] footnote 1.
[fn:1] The actual footnote.
This is [fn:: Anonymous definition] anonymous footnote
M-h
M-l
M-S-h
M-S-L
promote/demote heading/subtree
use number of stars (*) for levels; TAB will collapse this. S-TAB collapses everything
TAB TAB will collapse everything Alt-down will move whole level within the parent level Alt-left/right change level , s r — will refile subtree - move this level under different parent
hit TAB at end of line. M-arrow moving rows/columns
Name | Age | Occupation |
---|---|---|
Barney | 65 | Work |
https://easyorgmode.com/blog/use-org-mode-as-an-inline-calculator-and-notepad-calculator https://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html
type this | 3.14 | 10 | := $1 * $2^2 |
, then C-c C-c
3.14 | 10 | 314. |
Expected Income | |
Gross_Salary_Wanted | 100000 |
Health_Insurance | 0.07 Gross_Salary_Wanted |
Pension_Plan | :=0.15 * Gross_Salary_Wanted |
Total Revenue | :=vsum(@2..@4) |
Hourly rate | |
Unpaid_vacation_days | 20 |
PublicHolidaysAndWeekends | 120 |
Work_days_per_year | :=365 - Unpaid_vacation_days - PublicHolidaysAndWeekends |
Work_hours_per_year | :=Work_days_per_year*8 |
Rate needed | :=Gross_Salary_Wanted/Work_hours_per_year |
S-left
S-right
TODO DONE
S-up
S-down
priority cycle
C-c ,
priority set
C-c C-c
,,
refresh line
#+SEQ_TODO
custom TODO states
#+PRIORITIES: A B C
buffer settings
f
b
forward backward one week
(setq org-agenda-files (quote ("~/myfile.org")))
(setq org-agenda-files (append (file-expand-wildcards "~/dir/*.org") (file-expand-wildcards "~/dir2/*.org")))
C-c [
adds current file to the front of the agenda
C-c ]
org-remove-file
M-SPC
transient state
C-v
change view
- item
- indented item
- also item
- first item
- can have nested bullets
- also first item
- enforcing the item starting with 20
- term is bold
- description on the next line indented
- [ ] item 1 of checklist
- [X] item 2 of checklist
- [X] item 3 of checklist
C-c C-c – check/uncheck the checklist item will toggle [x]
[/]
or [%]
in heading will track all checklist subitems; as completed/total or %complete respectively
https://www.authorea.com/users/77723/articles/110898-how-to-write-mathematical-equations-expressions-and-symbols-with-latex-a-cheatsheet http://asciimath.org/
,Te
toggle pretty entities
,Tx
toggle LaTeX
- and
land
∧ - or
lor
∨ - if…then
to
→ - if and only if
leftrightarrow
↔ - logical equivalence
equiv
≡ - therefore
therefore
\therefore - there exists
exist
∃ - for all
forall
∀ - implies
Rightarrow
⇒
equivalent Leftrightarrow
⇔
- Unicode References
- α, β, γ, π, ∞, ∑ .
- Subscripts
- _ { } (without spaces) like Hydrogen atoms, H_2, and Water, H2O.
- Superscripts
- ^ { } (without spaces) The mass of the sun is $1.989 ⋅ 1030 kg$.
- Embedded/inline Equations
- Surrounded with either single
$
, like $a^2=b$, or escaped parenthesis, like: \( b=\frac{1}{2} \) - Separated equations
- Either in double
$$
or escaped brackets\[ \]
, like this: $$ a=\frac{1}{2}\sqrt{2} $$ or this: \[ a=-\sqrt{2} \] or this: \begin{equation} x=\sqrt{b} \end{equation} - Block
\[ \]
\[
c=a+b
\]
\displaystyle
fullsize for this $\displaystyle ∑n=1∞ \frac{1}{n}$ , not this $∑n=1∞ \frac{1}{n}$
\begin{align}
a=1
a+2=4
\end{align}
\begin{matrix}
a & b
c & d
\end{matrix}
\begin{matrix}
a & b
c & d
\end{matrix}
\begin{pmatrix}
a & b \
c & d
\end{pmatrix}
\begin{bmatrix}
a & b \
c & d
\end{bmatrix}
\begin{vmatrix}
a & b \
c & d
\end{vmatrix}
\begin{Vmatrix}
a & b \
c & d
\end{Vmatrix}
not ~ ∼ and ∧ ∧∧ or ∨ ∨∨ if…then → →→ if and only if ↔ ↔↔ logical equivalence ≡ ≡≡ therefore \therefore \therefore∴ there exists ∃ ∃∃ for all ∀ ∀∀ implies ⇒ ⇒⇒ equivalent ⇔ ⇔⇔
C-x RET C-\
set-input-method to TeX, then C-\
toggle on/off last used input method
babel
package for literate programming and reproducibility. See https://news.ycombinator.com/item?id=16841909
https://github.com/novoid/org-babel-examples
reverse 5 4 2 / some comment
babel
package for literate programming and reproducibility. See https://news.ycombinator.com/item?id=16841909
,ibs
insert source code block (viaorg-insert-structure-template
)<sTAB>
insert source code block via easy templatesC-c '
or,'
will edit in separate major mode window,bv
- expand according to block header args into preview buffer,bp
,bn
- move to prev/next chunk,bj
- insert header argument,bt
or,bf
- generate into a file usingorg-babel-tangle
,bb
,bs
- execute all buffer/subtree blocks,T#
toggle visibility of all blocks (hide/collapse - show)
(setq org-babel-default-header-args '((:noweb . "yes")))
(setq org-babel-default-header-args:C++ '((:flags . "-I.")))
(setq org-babel-default-header-args:R '(:session . "*org-R*"))
(setq org-babel-default-header-args:R '((:width . 640) (:height . 640)))
plot(x, y)
abline(out1)
int a;
std::cin >> a;
std::cout << a;
(completing-read "Enter a number: " nil)
#include <iostream>
#include <string>
int main() {
int a = std::atoi(input);
std::cout << a;
}
int i, n = 4;
double x[4] = { 1970, 1980, 1990, 2000 };
double y[4] = { 12, 11, 14, 13 };
double w[4] = { 0.1, 0.2, 0.3, 0.4 };
double c0, c1, cov00, cov01, cov11, chisq;
gsl_fit_wlinear (x, 1, w, 1, y, 1, n,
&c0, &c1, &cov00, &cov01, &cov11,
&chisq);
printf ("# best fit: Y = %g + %g X\n", c0, c1);
printf ("# covariance matrix:\n");
printf ("# [ %g, %g\n# %g, %g]\n",
cov00, cov01, cov01, cov11);
printf ("# chisq = %g\n", chisq);
for (i = 0; i < n; i++)
printf ("data: %g %g %g\n",
x[i], y[i], 1/sqrt(w[i]));
printf ("\n");
for (i = -30; i < 130; i++)
{
double xf = x[0] + (i/100.0) * (x[n-1] - x[0]);
double yf, yf_err;
gsl_fit_linear_est (xf,
c0, c1,
cov00, cov01, cov11,
&yf, &yf_err);
printf ("fit: %g %g\n", xf, yf);
printf ("hi : %g %g\n", xf, yf + yf_err);
printf ("lo : %g %g\n", xf, yf - yf_err);
}
sqr | noise |
---|---|
0.0 | 0.23 |
1.0 | 1.31 |
4.0 | 4.61 |
9.0 | 9.05 |
16.0 | 16.55 |
for (int i=0; i<somedata_rows; i++)
{
for (int j=0; j<somedata_cols; j++)
{
std::cout << somedata[i][j]/2.0 << "\t";
}
std::cout << "\n";
}
,bt
,bf
generate into a file usingorg-babel-tangle
SPC u ,bt
tangle only block at pointSPC u SPC u ,bt
tangle all blocks for the the tangle file at point
namespace ns {
class MyClass {};
}
int main(int argc, char* argv[])
{
ns::MyClass{};
std::cout << "hi" << std::endl;
return 0;
}
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-C.html
std::cout << "Hello World!" << std::endl;
printf ("mystring %s\n", mystring);
printf ("myint %d\n", myint);
printf ("mydouble %g\n", mydouble);
type src_calc{100+2*4} and execute with C-c C-c
C-c C-q
or , i t
SPC p o | go to the TODOs for the current project |
SPC a o p | capture a TODO for the current project |
SPC u SPC a o p | capture a TODO for any given project (choose from list) |
C-x 8 RET ZERO WIDTH SPACE
necessary for things like quote inside verbatim e.g. C-c '
https://orgmode.org/manual/The-date_002ftime-prompt.html#The-date_002ftime-prompt
,dt
,dT
org-time-stamp/inactive (does/does not enter agenda)
org-directory
org-agenda-files
org-archive-location
,sA
move subtree to archive location
TAB
current subtreeS-TAB
SPC u N S-TAB
global, up to N levelSPC u SPC u TAB
startupSPC u SPC u SPC u TAB
show all, incl. drawersC-c C-k
headings of this subtree,sb
current subtree to buffer
{
}
paragraphM-{
M-}
elementC-c C-n
C-c C-p
visible heading next/previousC-c C-f
C-c C-b
same level heading forward/backwardC-c C-u
upper level headingC-c C-j
differet place witout changing current visibility
,bu
source block head
file:name.org::LineOrHeading
,il
insert link
[[Heading]]
[[Heading][Title]]
heading
[[http://www.google.com][hyperlink title]]
hyperlink
,iDy
paste image from url stored in clipboard
,Ti
toggle inline images
C-M i
completion at point for inserting a node linkM-x org-id-get-create
turn this top-level header into a node
helm-find-files
home/dk/org/files M-a
M-g p
- calls helm-ff-run-pdfgrep