1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:
(require 'fill-column)
(use-package org
:demand t
:hook
((org-mode . (lambda ()
(org-indent-mode)
(org-toggle-inline-images)
(fill-column-mode)
(abbrev-mode)
(org-latex-preview '(16)))))
:config
(setopt org-ellipsis " ▾"
org-babel-python-command "python3"
org-confirm-babel-evaluate nil
org-hide-emphasis-markers t
org-startup-folded 'show3levels
org-src-window-setup 'current-window)
(plist-put org-format-latex-options :scale 1.3)
(push '("\\.pdf\\'" . "zathura %s") org-file-apps)
(add-hook 'org-babel-after-execute-hook #'org-redisplay-inline-images)
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(shell . t)
(lisp . t)
(scheme . t)
(dot . t)
(latex . t)
(python . t)))
(define-abbrev org-mode-abbrev-table
"lbm" "\\begin{equation*}\n\\begin{bmatrix}\n\\end{bmatrix}\n\\end{equation*}")
(define-abbrev org-mode-abbrev-table
"lca" "\\begin{equation*}\n\\begin{cases}\n\\end{cases}\n\\end{equation*}")
(define-abbrev org-mode-abbrev-table
"gvd" "#+begin_src dot :file images/1.png\ndigraph g {\nrankdir=LR;\n\tnode [shape = doublecircle]; A;\n\tnode [shape = point]; qi\n\tnode[shape=circle];\n}\n#+end_src")
(define-abbrev org-mode-abbrev-table
"les" "\\begin{equation*}\n\\end{equation*}")
(define-abbrev org-mode-abbrev-table
"lbm" "\\begin{equation*}\n\\begin{bmatrix}\n\\end{bmatrix}\n\\end{equation*}")
(define-abbrev org-mode-abbrev-table
"lds" "\\begin{drawstack}\n\\end{drawstack}"))
(use-package ox
:config
(add-to-list 'org-latex-packages-alist '("" "listings"))
(setopt org-latex-toc-command "\\tableofcontents \\clearpage"
org-latex-src-block-backend 'listings
org-latex-image-default-width ".6\\linewidth"
org-latex-compiler "xelatex"
org-export-with-toc nil
org-export-preserve-breaks nil
org-latex-classes
'(("article"
"\\PassOptionsToPackage{svgnames}{xcolor}
\\documentclass[11pt]{article}
\\usepackage[margin=1in]{geometry}
\\usepackage{xcolor,color,tikz,amsmath,amssymb,amsthm,amsfonts,graphicx,enumitem,listings,comment}
\\lstset{frame=single,aboveskip=1em,
framesep=.5em,backgroundcolor=\\color{AliceBlue},
rulecolor=\\color{Black},framerule=1pt}
\\usepackage{xcolor}
\\newcommand\\basicdefault[1]{\\scriptsize\\color{Black}\\fontfamily{pcr}\\selectfont}
\\lstset{basicstyle=\\basicdefault{\\spaceskip1em}}
\\lstset{keywordstyle=\\color{DarkGreen}\\bfseries,
identifierstyle=\\color{DarkRed},
commentstyle=\\color{DimGray}\\upshape,
stringstyle=\\color{DarkBlue}\\upshape,
emphstyle=\\color{Chocolate}\\upshape,
showstringspaces=false,
columns=fullflexible,
keepspaces=true}
\\lstset{columns=fullflexible,basicstyle=\\ttfamily}
\\setlength{\\headsep}{0.75 in}
\\setlength{\\parindent}{0 in}
\\setlength{\\parskip}{0.1 in}
\\makeatletter
\\renewcommand{\\maketitle}{%
\\begingroup\\parindent0pt
\\begin{center}
\\LARGE{\\bfseries\\@title}\\par\\bigskip
\\large{\\@author}\\par\\medskip
\\normalsize\\@date\\par\\bigskip
\\end{center}
\\endgroup\\@afterindentfalse\\@afterheading}
\\makeatother
[DEFAULT-PACKAGES]
\\hypersetup{linkcolor=Blue,urlcolor=DarkBlue,
citecolor=DarkRed,colorlinks=true}
[PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
("report" "\\documentclass[11pt]{report}"
("\\part{%s}" . "\\part*{%s}") ("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
("book" "\\documentclass[11pt]{book}" ("\\part{%s}" . "\\part*{%s}")
("\\chapter{%s}" . "\\chapter*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))
(use-package org-agenda
:bind
(("C-c n a" . org-agenda)
("C-c n c" . org-capture)
("C-c n s" . org-schedule)
("C-c n d" . org-deadline)
("C-c n r" . org-refile))
:config
(advice-add 'org-refile :after 'org-save-all-org-buffers)
(defvar-local agenda-file "~/dc/agenda/agenda_tasks.org")
(defvar-local bd/course-list
'(("501" . ?0)
("535" . ?3)
("590" . ?9))
"Courses for tagging, capturing, and various
agenda views.")
(defvar-local bd/device-list
'(("garm" . ?G)
("heimdallr" . ?H)
("hodr" . ?M)
("surt" . ?I)
("vali" . ?V))
"Devices for tagging, capturing, and various
agenda views.")
(defun bd/combine-tags (tag-alist add? or-p)
"Given TAG-ALIST in the form of
ORG-TAG-ALIST, returns a concatenated string
representing all the tags ORd or ANDed together."
(apply #'concat
(mapcar (lambda (e)
(concat (when or-p "|") (if add? "+" "-") (car e)))
tag-alist)))
(setopt org-log-done 'time
org-deadline-warning-days 7
org-log-into-drawer "history"
org-agenda-restore-windows-after-quit t
org-agenda-show-future-repeats nil
org-agenda-block-separator nil
org-deadline-warning-days 0
org-todo-keywords
'((sequence "TODO(t)" "NEXT(n!)" "HOLD(h!)" "|" "DONE(d)" "CANC(c)"))
org-tag-alist
`(("noexport" . ?e)
("chore" . ?C)
,@bd/device-list
("idea" . ?i)
("programming" . ?p)
("web" . ?s)
("writing" . ?w)
("reading" . ?r)
,@bd/course-list)
org-refile-targets '(("archived_tasks.org" :maxlevel . 1)
("agenda_tasks.org" :maxlevel . 1))
org-agenda-files `(,agenda-file "~/dc/agenda/archived_tasks.org")
org-capture-templates
`(("c" " College")
("cl" "Formal Language Theory" entry (file+olp ,agenda-file "CS501")
"* TODO %?\n DEADLINE: %^t")
("ca" "Computer Architecture" entry (file+olp ,agenda-file "CS535")
"* TODO %?\n DEADLINE: %^t")
("ce" "Reverse Engineering" entry (file+olp ,agenda-file "CS590")
"* TODO %?\n DEADLINE: %^t")
("s" " Self")
("si" "Idea" entry (file+olp ,agenda-file "Idea / Return")
"* TODO %?\n %u")
("sc" "Context" entry (file+olp ,agenda-file "Idea / Return")
"* TODO %?\n %a")
("st" "Deadline" entry (file+olp ,agenda-file "Deadline")
"* TODO %?\n DEADLINE: %^t")
("sb" "Book" entry (file+olp ,agenda-file "Book List")
"* TODO %?\n %u")))
(let ((orphan-view '(tags-todo "-{.*}"
((org-agenda-overriding-header "\nOrphaned Items\n")))))
(setopt org-agenda-custom-commands
`(("c" "Chores"
((agenda "" ((org-agenda-entry-types '(:deadline))
(org-agenda-show-all-dates nil)
(org-agenda-span 21)
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'notregexp
(regexp-opt (cons "chore" (mapcar #'car bd/device-list)))))
(org-agenda-overriding-header "Priority Deadlines (+21d)\n")))
(tags-todo (concat "chore" (bd/combine-tags bd/device-list nil nil))
((org-agenda-overriding-header "\nMundane\n")))
,@(mapcar (lambda (e)
`(tags-todo ,(car e)
((org-agenda-overriding-header
(concat "\nDevice: " ,(capitalize (car e)) "\n")))))
bd/device-list)
,orphan-view))
("r" "Recreational"
((tags-todo "+idea"
((org-agenda-skip-function
'(org-agenda-skip-entry-if 'regexp "chore"))
(org-agenda-overriding-header "Ideas\n")))
(tags-todo "+reading|+writing"
((org-agenda-skip-function
'(org-agenda-skip-entry-if 'regexp "chore"))
(org-agenda-overriding-header "\nReading/Writing\n")))
(tags-todo "+programming|+web"
((org-agenda-skip-function
'(org-agenda-skip-entry-if 'regexp "chore"))
(org-agenda-overriding-header "\nProgramming\n")))
,orphan-view))
("s" "College"
((tags-todo (bd/combine-tags bd/course-list t t)
((org-agenda-overriding-header "\nAll Courses\n")))
(agenda "" ((org-agenda-entry-types '(:deadline :scheduled))
(org-agenda-show-all-dates nil)
(org-agenda-span 15)
(org-scheduled-past-days 7)
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'notregexp
(regexp-opt (mapcar #'car bd/course-list))))
(org-agenda-overriding-header "\nUpcoming Deadlines (+15d)\n")))
,orphan-view))))))
(provide 'bd--org)
;;; bd--org.el ends here
|