(use-package org :ensure nil :hook ((org-mode . turn-on-auto-fill) (org-mode . abbrev-mode) (org-mode . flyspell-mode)) :init (org-clock-persistence-insinuate) :bind (("C-c l" . org-store-link) ("C-c a" . org-agenda) ("C-c c" . org-capture) ("C-c b" . org-switchb)) :init (org-babel-lob-ingest "~/.emacs.d/library-of-babel.org") (setq org-capture-templates '()) :custom (abbrev-suggest t) (org-hide-emphasis-markers nil) (org-default-notes-file "notes.org") (org-insert-mode-line-in-empty-file t) (org-adapt-indentation nil) (org-agenda-prefix-format '((agenda . " %i %-12:c%?-12t%-6e% s") (todo . " %i %-12:c %-6e") (tags . " %i %-12:c") (search . " %i %-12:c"))) (org-agenda-dim-blocked-tasks nil) (org-agenda-inhibit-startup nil) (org-agenda-span 14) (org-agenda-start-on-weekday 1) (org-agenda-include-diary t) (org-clock-out-remove-zero-time-clocks t) (org-clock-persist t) (org-clock-rounding-minutes 30) (org-confirm-babel-evaluate nil) (org-duration-format (quote h:mm)) (org-export-dispatch-use-expert-ui nil) (org-export-default-language "en") (org-export-with-smart-quotes t) (org-export-with-emphasize t) (org-export-with-special-strings t) (org-export-with-fixed-width t) (org-export-with-timestamps nil) (org-export-preserve-breaks nil) (org-export-with-sub-superscripts nil) (org-export-with-archived-trees nil) (org-export-with-author t) (org-export-with-broken-links t) (org-export-with-clocks nil) (org-export-with-creator nil) (org-export-with-drawers nil) (org-export-with-date t) (org-export-with-entities t) (org-export-with-email t) (org-export-with-footnotes t) (org-export-headline-levels 3) (org-export-with-inlinetasks nil) (org-export-with-section-numbers t) (org-export-with-planning nil) (org-export-with-priority nil) (org-export-with-properties nil) (org-export-with-statistics-cookies nil) (org-export-with-tags nil) (org-export-with-tasks nil) (org-export-with-latex t) (org-export-time-stamp-file nil) (org-export-with-title t) (org-export-with-toc t) (org-export-with-todo-keywords nil) (org-export-with-tables t) (org-export-date-timestamp-format "%a, %d %b %Y %R %z") (org-confirm-babel-evaluate nil) (org-export-backends '(ascii html latex md odt texinfo)) (org-global-properties '(("EFFORT_ALL" . "0:30 1:00 2:00 3:00 5:00 8:00"))) (org-html-doctype "html5") (org-html-html5-fancy t) (org-log-done (quote time)) (org-refile-targets '((nil :maxlevel . 3))) (org-startup-folded t) (org-startup-truncated nil) (org-src-fontify-natively t) (org-src-tab-acts-natively t) (org-src-window-setup 'other-window) (org-time-stamp-rounding-minutes '(30 30)) (org-todo-keywords '((sequence "TODO" "DOING(!)" "DONE(!)") (sequence "RECRUIT" "INTERVIEW" "QDA" "DOC" "REVIEW"))) (org-use-property-inheritance nil) (org-attach-store-link-p 'attached) (org-agenda-custom-commands '(("p" "Projects" ((tags "PROJECT"))))) (org-latex-packages-alist '(("" "listings") ("" "booktabs") ("AUTO" "polyglossia" t ("xelatex" "lualatex")) ("" "grffile") ("" "unicode-math") ("" "xcolor") ("protrusion=true" "microtype"))) ;; Define the process to convert Org to PDF using XeLaTeX (org-latex-pdf-process '("latexmk -xelatex -shell-escape -quiet -f %f")) ;; Set the compiler to XeLaTeX (org-latex-compiler "xelatex") ;; Enable listings and other table-related features (org-latex-listings t) (org-latex-tables-booktabs t) (org-latex-images-centered t) ;; Customize the appearance of listings (source code blocks) (org-latex-listings-options '(("basicstyle" "\\ttfamily") ("showstringspaces" "false") ("keywordstyle" "\\color{blue}\\textbf") ("commentstyle" "\\color{gray}") ("stringstyle" "\\color{green!70!black}") ("frame" "single") ("numbers" "left") ("numbersep" "5pt") ("numberstyle" "\\ttfamily") ("keepspaces" "true") ("showspaces" "false") ("showstringspaces" "false") ("showtabs" "false") ("breaklines" "true") ("breakatwhitespace" "false") ("tabsize" "2") ("columns" "fullflexible"))) (org-latex-inputenc-alist '((\"utf8\" . \"utf8x\"))) :config (if (eq system-type 'windows-nt) (setq org-babel-python-command "python") (setq org-babel-python-command "python3")) (setq time-stamp-active t time-stamp-start "#\\+[dD][aA][tT][eE]: [\t]*" time-stamp-end "$" time-stamp-inserts t time-stamp-format "%Y-%m-%dT%H:%M%:z") (add-hook 'before-save-hook 'time-stamp nil) ;; (when (eq system-type 'windows-nt) ;; (setq org-babel-sqlite3-command "c:/msys64/ucrt64/bin/sqlite3.exe")) (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (lisp . t) (gnuplot . t) (python . t) (sqlite . t) (shell . t) (plantuml . t) (C . t))) ;; work with org-agenda dispatcher [c] "Today Clocked Tasks" to view today's clocked tasks. (defun org-agenda-log-mode-colorize-block () "Set different line spacing based on clock time duration." (save-excursion (let* ((colors (cl-case (alist-get 'background-mode (frame-parameters)) ('light (list "#d8dee9" "#e5e9f0" "#eceff4")) ('dark (list "#bf616a" "#d08770" "#ebcb8b" "#a3be8c" "#b48ead")))) pos duration) (nconc colors colors) (goto-char (point-min)) (while (setq pos (next-single-property-change (point) 'duration)) (goto-char pos) (when (and (not (equal pos (point-at-eol))) (setq duration (org-get-at-bol 'duration))) ;; larger duration bar height (let ((line-height (if (< duration 15) 1.0 (+ 0.5 (/ duration 30)))) (ov (make-overlay (point-at-bol) (1+ (point-at-eol))))) (overlay-put ov 'face `(:background ,(car colors) :foreground "black")) (setq colors (cdr colors)) (overlay-put ov 'line-height line-height) (overlay-put ov 'line-spacing (1- line-height)))))))) (add-hook 'org-agenda-finalize-hook #'org-agenda-log-mode-colorize-block)) ;; Define custom LaTeX class with specific formatting (with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes '("koma-general" "\\documentclass[a4paper,10pt,captions=tableheading,twoside=false]{scrartcl} \\linespread{1.25} \\setkomafont{section}{\\Large\\bfseries\\sffamily} \\setkomafont{subsection}{\\large\\bfseries\\sffamily} \\setkomafont{subsubsection}{\\normalsize\\bfseries\\sffamily} \\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.5\\baselineskip]{section} \\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.25\\baselineskip]{subsection} \\RedeclareSectionCommand[beforeskip=-1sp,afterskip=0.1\\baselineskip]{subsubsection} \\usepackage{fontspec} \\defaultfontfeatures{Mapping=tex-text, RawFeature={+zero}} \\setmainfont{Noto Serif Regular}[BoldFont={Noto Serif Bold},ItalicFont={Noto Serif Italic}] \\setsansfont{Noto Sans Regular}[BoldFont={Noto Sans Bold},ItalicFont={Noto Sans Italic}] \\setmonofont{Noto Sans Mono}[BoldFont={Noto Sans Mono Bold},Scale=0.8] \\usepackage{geometry} \\geometry{a4paper,left=2cm,right=2cm,top=1.6cm,bottom=1.6cm} \\usepackage{scrlayer-scrpage} \\pagestyle{scrheadings} \\clearpairofpagestyles \\automark{section} \\ihead{\\headmark} % Inner header \\ohead{\\thepage} % Outer header" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))) (setq org-latex-default-class "koma-general")) (setq org-html-protect-char-alist '(("&" . "&") ("<" . "<") (">" . ">") (":lambda:" . "λ") (":python:" . "🐍") (":whale:" . "🐳") (":turtle:" . "🐢") (":dash:" . "💨") (":party:" . "🥳") (":see-no-evil:" . "🙈") (":cloud:" . "☁️") (":abacus:" . "🧮") (":desktop:" . "🖥️") (":rocket:" . "🚀") (":unicorn:" . "🦄") (":recycling:" . "♻") (":crystalball:" . "🔮") (":photography:" . "📷") (":money:" . "💵") (":-)" . "😊") (":-(" . "😞"))) (defun mk/link-to-current-task () "Return an Org link to the current clocked-in task, if any, or prompt for manual entry." (if (org-clock-is-active) (with-current-buffer (marker-buffer org-clock-marker) (save-excursion (goto-char org-clock-marker) (format ":TASK_ID: [[id:%s][%s]]" (org-id-get) (org-get-heading t t)))) (let ((manual-id (read-string "Enter Task ID (leave empty if not applicable): "))) (unless (string-empty-p manual-id) (format ":TASK_ID: [[id:%s][Task]]" manual-id))))) ;; Note Capture Template ;; Purpose: To capture general notes. These notes can optionally be linked to a currently clocked-in task. ;; Fields: Heading, optional task link, initial content, and a timestamp. (add-to-list 'org-capture-templates `("n" "Note" entry (file+headline "agenda/notes.org" "Notes") ,(concat "* %? :NOTE:\n" ":PROPERTIES:\n" "%(mk/link-to-current-task)\n" ":END:\n" "Entered on: %U\n"))) ;; Task Capture Template ;; Purpose: To capture tasks and automatically assign a unique ID to each task. ;; Fields: Heading, unique ID, timestamp, and link to where the capture was made. (add-to-list 'org-capture-templates `("t" "Task" entry (file "agenda/tasks.org") ,(format "* TODO %%? :TASK:\n:PROPERTIES:\n:ID: %s\n:Project: %%^{Project}\n:END:\nEntered on %%U\n" (org-id-new)))) ;; Journal Capture Template ;; Purpose: To capture end-of-day reflections. ;; Fields: Heading, timestamp, and prompts for what went well, what could be improved, and focus for tomorrow. (add-to-list 'org-capture-templates '("j" "Journal" entry (file+olp+datetree "agenda/journal.org") "* %T - End of Day Reflection :JOURNAL:\n- What went well today?\n %?\n- What could have been improved?\n \n- What will I focus on tomorrow?\n " :empty-lines 1)) ;; Appointment Capture Template ;; Purpose: To capture important events and appointments. ;; Fields: Heading, timestamp. (add-to-list 'org-capture-templates '("a" "Appointment" entry (file "agenda/appt.org") "* %? :APPOINTMENT:\n%^{Date}t\n")) ;; Meeting Capture Template ;; Purpose: To capture meeting notes and automatically start a clock for time tracking. ;; Fields: Topic, timestamp, and additional notes. (add-to-list 'org-capture-templates '("m" "Meeting" entry (file "agenda/meetings.org") "* %^{Topic} :MEETING:\n%T\n%?" :clock-in t :empty-lines 1)) ;; Log Capture Template ;; Purpose: To capture activities in a chronological order and automatically start a clock for time tracking. ;; Fields: Timestamp, activity description. (add-to-list 'org-capture-templates '("l" "Log" entry (file+olp+datetree "agenda/logbook.org") "* %T - %^{Activity} :LOG:\n%?" :clock-in t :empty-lines 1)) ;; UTM Parameters Capture Template ;; Purpose: To capture UTM parameters for marketing tracking. ;; Fields: Campaign name, source, medium, term, and content. (add-to-list 'org-capture-templates '("u" "UTM Parameters" entry (file+headline "utm.org" "UTM Parameters") "* %^{Campaign Name}\n:PROPERTIES:\n:Source: %^{utm_source}\n:Medium: %^{utm_medium}\n:Term: %^{utm_term}\n:Content: %^{utm_content}\n:END:\n")) ;; Bookmark Capture Template ;; Purpose: To capture bookmarks with tags and a timestamp. ;; Fields: URL, tags, timestamp. (add-to-list 'org-capture-templates '("b" "Bookmark" table-line (file+headline "bookmarks.org" "Bookmarks") "| %^{URL} | %^{Tags} | %u |" :prepend t)) ;; Code Snippet Capture Template ;; Purpose: To capture code snippets and specify the programming language. ;; Fields: Code snippet, language specification. (add-to-list 'org-capture-templates '("c" "Code Snippet" entry (file+headline "code.org" "Snippets") "* %?\n#+begin_src %^{language}\n%i\n#+end_src")) ;; Capture Templates for Interviews ;; ;; The following capture templates are designed to facilitate the collection ;; of questions and insights for user interviews. Given the importance of ;; user-centered design in experience architecture, these templates aim to ;; streamline the preparation process for interviews. ;; Interview Sub-menu ;; ;; This entry serves as a sub-menu for all interview-related capture templates. (add-to-list 'org-capture-templates '("i" "Interviews")) ;; How Might We (HMW) Template ;; ;; This template is designed to capture "How Might We" questions that are often ;; used to frame problems and opportunities in user interviews. These questions ;; can be crucial for guiding the interview in a direction that yields ;; actionable insights. (add-to-list 'org-capture-templates '("ih" "How Might We" entry (file+headline "interviews.org" "HMW Questions") "* WKW/HMW %? :HMW:\n%U\n:PROPERTIES:\n:Interviewee: %^{Interviewee}\n:Context: %^{Context}\n:END:")) ;; Interview Question Template ;; ;; Use this template to quickly capture questions that you intend to ask during ;; user interviews. The template prompts for the topic of the interview and ;; the project it is associated with, allowing for easy categorization and ;; retrieval later. (add-to-list 'org-capture-templates '("iq" "Interview Question" entry (file+headline "interviews.org" "Interview Questions") "* %^{Interview Topic} :INTERVIEW:\n:PROPERTIES:\n:Project: %^{Project Name}\n:Date: %T\n:END:\n- %?\n")) ;; User Interview Quotes Capture Template ;; Purpose: To capture important quotes from user interviews. ;; Fields: Quote, Interviewee, Timestamp in Video, Project, Context (add-to-list 'org-capture-templates '("io" "Quote from User Interview" entry (file+headline "interviews.org" "Quotes") "* %^{Quote} :QUOTE:\n:PROPERTIES:\n:Interviewee: %^{Interviewee}\n:Timestamp: %^{Timestamp in Video}\n:Project: %^{Project}\n:Context: %^{Context}\n:END:\n")) ;; Capture Templates for Project Management and Achievements ;; ;; These templates are designed to facilitate the tracking of project details ;; and individual achievements. Given the focus on agile methodologies and ;; continuous improvement, these templates aim to provide a structured way ;; to capture essential information. ;; Project Template ;; ;; This template captures the essential details of a new project. It prompts ;; for the project name, start date, and end date, and provides sections for ;; outlining the project's objectives and challenges. Each project is assigned ;; a unique ID for easy referencing. (add-to-list 'org-capture-templates `("p" "Project" entry (file "agenda/projects.org") ,(format "* %%^{Project Name} :PROJECT:\n:PROPERTIES:\n:ID: %s\n:Start Date: %%T\n:End Date: %%^{End Date}\n:END:\n** Objective\n%%?\n** Challenges\n- [ ] %%^{Challenge 1}\n- [ ] %%^{Challenge 2}\n" (org-id-new)))) ;; Achievement Template ;; ;; This template is designed to capture individual achievements. It prompts for ;; the title of the achievement, the project it is associated with, and the date. ;; Additionally, it provides fields for describing the achievement, its impact, ;; and any associated tasks. This can be particularly useful for end-of-year ;; reviews or for maintaining a portfolio of accomplishments. (add-to-list 'org-capture-templates `("v" "Achievement" entry (file+olp+datetree "achievements.org") ,(concat "* %^{Achievement Title} :ACHIEVEMENT:\n" ":PROPERTIES:\n" ":Project: %^{Project}\n" ":Date: %T\n" ":END:\n" "- Description: %?\n" "- Impact: %^{Impact}\n" "- Associated Tasks: %^{Tasks}\n"))) (add-to-list 'org-capture-templates '("A" "Accounting")) ;; Expense Tracking ;; Purpose: To capture individual expenses for accounting in a table. ;; Fields: Amount, Category, Note, Date (add-to-list 'org-capture-templates '("Ae" "Expense" table-line (file+headline "accounting.org" "Expenses") "| %U | %^{Amount} | %^{Category} | %? |")) ;; Income Tracking ;; Purpose: To capture instances of income for accounting in a table. ;; Fields: Amount, Source, Date (add-to-list 'org-capture-templates '("Ai" "Income" table-line (file+headline "accounting.org" "Income") "| %U | %^{Amount} | %^{Source} | %? |")) ;; Invoice Tracking ;; Purpose: To capture invoices sent for services or products in a table. ;; Fields: Client, Amount, Due Date (add-to-list 'org-capture-templates '("AI" "Invoice" table-line (file+headline "accounting.org" "Invoices") "| %T | %^{Client} | %^{Amount} | %^{Due Date} | %? |")) ;; Budget Planning ;; Purpose: To capture budget plans for personal or business accounting in a table. ;; Fields: Estimated Income, Estimated Expenses (add-to-list 'org-capture-templates `("Ab" "Budget" table-line (file+headline "accounting.org" "Budget") ,(concat "| " (format-time-string "%Y") " | " (format-time-string "%B") " | %^{Estimated Income} | %^{Estimated Expenses} | %? |"))) ;; Investment Tracking ;; Purpose: To capture investment details for accounting in a table. ;; Fields: Type, Amount, Notes (add-to-list 'org-capture-templates '("Av" "Investment" table-line (file+headline "accounting.org" "Investments") "| %U | %^{Type} | %^{Amount} | %? |")) ;; Stock Recommendation Capture Template ;; Purpose: To capture stock recommendations for potential investment. ;; Fields: Stock Symbol, Recommender, Notes, Date (add-to-list 'org-capture-templates '("s" "Stock Recommendation" entry (file+headline "stocks.org" "Stock Recommendations") "* %^{Stock Name} :STOCK:\n:PROPERTIES:\n:Date: %T\n:WKN: %^{WKN}\n:ISIN: %^{ISIN}\n:END:\n%?")) (require 'request) (defun fetch-gitlab-issue-and-capture () (interactive) (let ((project-id (read-string "Enter GitLab Project ID: ")) (issue-id (read-string "Enter GitLab Issue ID: ")) (gitlab-token (getenv "GITLAB_TOKEN"))) (unless gitlab-token (error "GITLAB_TOKEN environment variable not set")) (request (format "https://code.siemens.com/api/v4/projects/%s/issues/%s" project-id issue-id) :headers `(("Private-Token" . ,gitlab-token)) :parser 'json-read :success (cl-function (lambda (&key data &allow-other-keys) (org-capture nil "g") (let ((title (assoc-default 'title data)) (description (assoc-default 'description data))) (insert (format "%s\n%s" title description)))))))) (add-to-list 'org-capture-templates '("g" "GitLab Issue" entry (file "gitlab_issues.org") "* %?")) ;; (global-set-key (kbd "C-c g") 'fetch-gitlab-issue-and-capture) (use-package org-roam :after org :init (setq org-roam-db-autosync-mode t) (setq org-roam-v2-ack t) (setq org-roam-db-location "~/org-roam.db") (require 'org-roam-dailies) :bind (("C-c r l" . org-roam-buffer-toggle) ("C-c r f" . org-roam-node-find) ("C-c r g" . org-roam-graph) ("C-c r i" . org-roam-node-insert) ("C-c r c" . org-roam-capture) ("C-c r j" . org-roam-dailies-map) :map org-roam-dailies-map ("t" . org-roam-dailies-capture-today) ("y" . org-roam-dailies-capture-yesterday) ("T" . org-roam-dailies-capture-tomorrow) :map org-mode-map ("C-M-i" . completion-at-point)) :custom (org-roam-completion-everywhere nil) (org-roam-dailies-capture-templates '(("d" "default" entry "* %<%R> %?" :if-new (file+head "%<%F>.org" "#+title: %<%F>\n")))) (org-roam-capture-templates '(("d" "default" plain "%?" :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("r" "Research" plain "* Hypothesis:\n%?\n* Methodology:\n* Results:\n* Conclusions:\n" :if-new (file+head "research/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("m" "Meeting" plain "* Participants:\n%?\n* Discussion topics:\n* Action points:\n" :if-new (file+head "meetings/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("p" "Project" plain "* Goals:\n%?\n* Milestones:\n* Resources:\n" :if-new (file+head "projects/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("l" "Literature" plain "* Authors:\n%?\n* Main theses:\n* Own thoughts:\n" :if-new (file+head "literature/%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") :unnarrowed t)))) (use-package org-tree-slide :bind ("" . org-tree-slide-mode) :custom (org-image-actual-width nil)) (use-package org-web-tools :defer t :custom (org-web-tools-pandoc-sleep-time 0.4)) ;; (use-package ob-go ;; :after org) (use-package ox-reveal :after org) ;; (use-package ox-pandoc ;; :after org ;; :custom ;; (org-pandoc-options-for-beamer-pdf '((pdf-engine . "xelatex")))) ;; (defun me/write-readme-md-on-save () ;; ;; when README.org, also write README.md on save ;; (when (string-match "README" (buffer-file-name)) ;; (make-local-variable 'after-save-hook) ;; (add-hook 'after-save-hook ;; (lambda () (let ((outfile (org-export-output-file-name ".md"))) ;; (org-export-to-file 'md outfile)))))) ;; (add-hook 'org-mode-hook 'me/write-readme-md-on-save) ;; (use-package ob-go ;; :after org ;; :config ;; (append '((go . t)) org-babel-load-languages)) (use-package ob-http :after org :config (append '((http . t)) org-babel-load-languages)) ;; (use-package ob-racket ;; :after org ;; :pin manual ;; :config ;; (append '((racket . t) (scribble . t)) org-babel-load-languages)) ;; (use-package ox-rss ;; :after org) ;; (use-package ob-restclient ;; :after org ;; :config ;; (append '((restclient . t)) org-babel-load-languages))