From 5efae28e15e6562038aec420dd6cc7882d436e33 Mon Sep 17 00:00:00 2001 From: Blendoit Date: Fri, 23 Oct 2020 19:50:21 -0700 Subject: Public Sans is now default font + chad vs. virgin font meme --- .gitignore | 3 +- custom.el | 2 +- fonts/DejaVuSans.ttf | Bin 757076 -> 0 bytes fonts/DejaVuSansMono.ttf | Bin 340712 -> 0 bytes fonts/Hermit-Regular.otf | Bin 40040 -> 0 bytes img/EmacsIcon.png | Bin 0 -> 3736 bytes img/EmacsIcon.svg | 286 ++++++++++++++++++++++++++++++++++ smart-documents.org | 159 ++++++++++--------- smart-documents.pdf | Bin 130322 -> 175098 bytes templates/documents/default.org | 37 +++++ templates/documents/default.org_title | 16 ++ templates/documents/general.org | 35 ----- templates/documents/general.org_title | 16 -- themes/blendoit-light-theme.el | 4 +- 14 files changed, 422 insertions(+), 136 deletions(-) delete mode 100644 fonts/DejaVuSans.ttf delete mode 100644 fonts/DejaVuSansMono.ttf delete mode 100644 fonts/Hermit-Regular.otf create mode 100644 img/EmacsIcon.png create mode 100644 img/EmacsIcon.svg create mode 100644 templates/documents/default.org create mode 100644 templates/documents/default.org_title delete mode 100644 templates/documents/general.org delete mode 100644 templates/documents/general.org_title diff --git a/.gitignore b/.gitignore index 058ed0c..5b23897 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ smart-documents.el* # Misc .org-id-locations -async-bytecomp.log \ No newline at end of file +async-bytecomp.log +fonts/** \ No newline at end of file diff --git a/custom.el b/custom.el index 1671f2b..6b1340d 100644 --- a/custom.el +++ b/custom.el @@ -15,7 +15,7 @@ '(company-quickhelp-color-foreground "#DCDCCC") '(custom-enabled-themes nil) '(custom-safe-themes - '("469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) + '("0c5c0078062fafd063a227b4cebb49b65434ea6e9557e3aaf8bc3212ba986512" "469032293efae7c0c86a95c39cab8b0ff8883cf4af3f2c292313cf6a71195b40" "8fb0949f4229860cf19034b924eb99c664327c9250fb92a2633bdf4b4abaf060" "c3a2a37e84e474c73c2b468553f9b5b73341419f72bbc1f4a4bcc1230ef86c85" "6495716176be0ced4142593b94a410135e0b373b686a869637824260d2f1ca11" "4467b1c8d7cc78fe98345c9c63eb62cf37844dc6868630add365494bde455715" "faeef63cb31f796b4bdf22f38e614934ab34d7deacaeb89b3e9cccf70aac5a85" "370fb305168fea1614535dc9ca30f496918eaca754b6c8969dd77fa872bec695" "e9f0c0c3397d07eb1c6c3551d67fd151e24bc6d72ec678841623ed572677c97a" "5c32236ef318adafe4102f627f330fa8f448046dfd838eef5cc09c7f682cf71f" "e343fecfb8d681186d594002c9b44ce48c2061599d7e4ec635cf1ca2a277a47a" "302dc61dc55600c7424f945dce9e74fba7df19f4a7bfb72aefd93193fa82ede4" "58f1f85248ba913387d1e7ed02a867161b315cfb5acff0c234e013ffd2577d22" "a256abf590bbc3257cc11d91a312e9fe8487dc1b95a5b7b732dd2f96a7fe5a45" "30368d6195cae9298304e6ac0534b90c85b1655965f1206c5c624270f0f46002" "311aa5df3223b5b4a7c638aad3befb4de9c7f46360d52acd1fa2cd2232b1dcbd" default)) '(fci-rule-color "#383838") '(fringe-mode 0 nil (fringe)) '(indicate-empty-lines t) diff --git a/fonts/DejaVuSans.ttf b/fonts/DejaVuSans.ttf deleted file mode 100644 index 96dd8b5..0000000 Binary files a/fonts/DejaVuSans.ttf and /dev/null differ diff --git a/fonts/DejaVuSansMono.ttf b/fonts/DejaVuSansMono.ttf deleted file mode 100644 index 9d65312..0000000 Binary files a/fonts/DejaVuSansMono.ttf and /dev/null differ diff --git a/fonts/Hermit-Regular.otf b/fonts/Hermit-Regular.otf deleted file mode 100644 index feb1937..0000000 Binary files a/fonts/Hermit-Regular.otf and /dev/null differ diff --git a/img/EmacsIcon.png b/img/EmacsIcon.png new file mode 100644 index 0000000..02918fc Binary files /dev/null and b/img/EmacsIcon.png differ diff --git a/img/EmacsIcon.svg b/img/EmacsIcon.svg new file mode 100644 index 0000000..632d53e --- /dev/null +++ b/img/EmacsIcon.svg @@ -0,0 +1,286 @@ + +image/svg+xml diff --git a/smart-documents.org b/smart-documents.org index 4c7bcc4..3765038 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -2,18 +2,18 @@ #+TITLE: Smart Documents #+AUTHOR: Marius Peter -#+DATE: <2020-07-23 Thu> +#+DATE: <2020-10-23 Fri> #+EMAIL: blendoit@gmail.com #+STARTUP: showall -#+SETUPFILE: ~/.emacs.d/templates/documents/general.org -#+INCLUDE: ~/.emacs.d/templates/documents/general.org_title +#+SETUPFILE: ~/.emacs.d/templates/documents/default.org +#+INCLUDE: ~/.emacs.d/templates/documents/default.org_title # By default, Org Babel does not tangle blocks. #+PROPERTY: header-args :tangle yes # Beautiful font pairing -#+LATEX_HEADER: \setmainfont{urw gothic} -#+LATEX_HEADER: \setmonofont{hermit} +# #+LATEX_HEADER: \setmainfont{urw gothic} +# #+LATEX_HEADER: \setmonofont{hermit} #+LATEX: \begin{abstract} The idea of /Smart Documents/ came to me as I was reflecting on how to improve @@ -53,9 +53,11 @@ document---feel free to experiment and discover. Here are three commands that will help you understand all the symbols in this file, if you are browsing this paper within Emacs itself: -- ~C-h f~ describe function -- ~C-h v~ describe variable -- ~C-h k~ describe key +- ~C-h f~ :: describe function +- ~C-h v~ :: describe variable +- ~C-h k~ :: describe key + +You can always press ~f1~ to access Emacs in-built help. * TODO First-time setup @@ -111,53 +113,21 @@ This is the very first user-editable file loaded by Emacs.[fn::This feature became available in version 27.1.] In it, we disable GUI elements that would otherwise be loaded and displayed once Emacs is ready to accept user input. -#+BEGIN_SRC emacs-lisp - (setq my/early-init-file (concat user-emacs-directory "early-init.el")) - - (defun my/create-early-init-file () - "Create `early-init.el' file in `user-emacs-directory'." - (write-region - "(menu-bar-mode -1) - (tool-bar-mode -1) - (menu-bar-bottom-and-right-window-divider) - (setq gc-cons-threshold 100000000)" nil my/early-init-file)) - - (unless (file-exists-p my/early-init-file) - (menu-bar-mode -1) - (tool-bar-mode -1) - (menu-bar-bottom-and-right-window-divider) - (setq gc-cons-threshold 100000000) - (my/create-early-init-file)) -#+END_SRC +It can be found here: [[file:early-init.el]] ** The second file to load #+BEGIN_QUOTE Traditionally, file =~/.emacs= is used as the init file, although Emacs also looks at =~/.emacs.el=, =~/.emacs.d/init.el=, =~/.config/emacs/init.el=, or -other -locations.[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]] -#+END_QUOTE +other locations. -#+BEGIN_SRC emacs-lisp - (setq my/init-file (concat user-emacs-directory "init.el")) +From the GNU website[fn::[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html]]] +#+END_QUOTE - (defun my/create-init-file () - "Create `init.el' file in `user-emacs-directory'." - (write-region - "(menu-bar-mode -1) - (tool-bar-mode -1) - (menu-bar-bottom-and-right-window-divider)" nil my/init-file)) +This file can be found here: [[file:init.el]] -;; TODO This is a copy paste of `early.init.el'. Should be changed. - (unless (file-exists-p my/init-file) - (menu-bar-mode -1) - (tool-bar-mode -1) - (menu-bar-bottom-and-right-window-divider) - (my/create-init-file)) -#+END_SRC - - If no file is found, Emacs then loads in its purely vanilla state. +If no file is found, Emacs then loads in its purely vanilla state. ** Profiling --- start @@ -273,8 +243,8 @@ We set the dimensions of the initial frame: We also set the dimensions of subsequent frames: #+BEGIN_SRC emacs-lisp - (add-to-list 'default-frame-alist '(width . 100)) - (add-to-list 'default-frame-alist '(height . 50)) + (add-to-list 'default-frame-alist '(width . 50)) + (add-to-list 'default-frame-alist '(height . 30)) #+END_SRC *** GNU/Linux @@ -360,13 +330,17 @@ is pressed. *** Open the agenda #+BEGIN_SRC emacs-lisp - (global-set-key (kbd "C-c a") 'org-agenda-list) + (global-set-key [f5] 'org-agenda-list) #+END_SRC *** Open the diary #+BEGIN_SRC emacs-lisp - (global-set-key (kbd "C-c d") 'my/find-diary-file) +(global-set-key [f6] + '(lambda () + "Load `org-agenda-diary-file'." + (interactive) + (find-file org-agenda-diary-file))) #+END_SRC ** Windows @@ -385,20 +359,28 @@ is pressed. *** Close window and quit +The following bindings lead to more natural window & frame exit behaviors. + +#+NAME: close-window-or-previous-buffer #+BEGIN_SRC emacs-lisp - (defun my/delete-window-or-previous-buffer () - "Delete window; if sole window, previous buffer." - (interactive) - (if (> (length (window-list)) 1) - (delete-window) - (previous-buffer))) +(global-set-key (kbd "C-w") + '(lambda () + "Delete window; if sole window, previous buffer." + (interactive) + (if (> (length (window-list)) 1) + (delete-window) + (previous-buffer)))) #+END_SRC -The following bindings lead to more natural exit behaviors. - +#+NAME: delete-frame-or-kill-emacs #+BEGIN_SRC emacs-lisp -(global-set-key (kbd "C-w") 'my/delete-window-or-previous-buffer) -(global-set-key (kbd "C-q") 'save-buffers-kill-terminal) +(global-set-key (kbd "C-q") + '(lambda () + (interactive) + "delete frame; if sole frame, kill Emacs." + (if (> (length (frame-list)) 1) + (delete-frame) + (kill-emacs)))) #+END_SRC ** Text display @@ -576,11 +558,10 @@ The agenda displays a chronological list of headings across all agenda files for which the heading or body contain a matching =org-time-stamp=.[fn::An =org-time-stamp= can be inserted with ~C-c .~ (period)] +We open the agenda in a separate window. + #+BEGIN_SRC emacs-lisp -(defun my/find-diary-file () - "Load `org-agenda-diary-file'." - (interactive) - (find-file org-agenda-diary-file)) +(setq org-agenda-window-setup 'other-frame) #+END_SRC *** Timestamps @@ -937,9 +918,9 @@ Get inspiration from ~ibuffer-sidebar~ and create a better sidebar. #+BEGIN_SRC emacs-lisp (use-package rainbow-delimiters - :config (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) + :config (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) (electric-pair-mode) - (show-paren-mode 1) +(show-paren-mode 1) #+END_SRC *** Highlight ``color keywords'' in their color @@ -1069,13 +1050,14 @@ Let's pimp out the appearance of our text in Org mode. First, we prettify checkbox lists. #+BEGIN_SRC emacs-lisp -(add-hook 'org-mode-hook - (lambda () - "Beautify Org checkbox symbols." - (push '("[ ]" . "☐") prettify-symbols-alist) - (push '("[X]" . "☑" ) prettify-symbols-alist) - (push '("[-]" . "⬛" ) prettify-symbols-alist) - (prettify-symbols-mode))) +(when (string-equal system-type "gnu/linux") + (add-hook 'org-mode-hook + (lambda () + "Beautify Org checkbox symbols." + (push '("[ ]" . "☐") prettify-symbols-alist) + (push '("[X]" . "☑" ) prettify-symbols-alist) + (push '("[-]" . "⬛" ) prettify-symbols-alist) + (prettify-symbols-mode)))) #+END_SRC ** Minibuffer @@ -1153,19 +1135,34 @@ cursor is a more MS Word-like bar. (setq-default cursor-type 'bar) #+END_SRC -*** TODO Fonts +*** Fonts + +**** Currently used /chad fonts/ -- Hack :: ~default~ and ~fixed-pitch~ +- Hack[fn::https://sourcefoundry.org/hack/] :: ~default~ and ~fixed-pitch~, + default code font - Legible, modern monospace font - Strict, sharp, uncompromising -- Liberation Sans :: ~variable-pitch~ - - Libre alternative to Arial - - Unoffensive -- Open Sans :: ~variable-pitch~ -- Hermit :: ~org-block~, anything Org/meta in general +- Public Sans[fn::https://public-sans.digital.gov/] :: ~variable-pitch~, + default body text font + - Very modern yet neutral + - Designed for the U.S. government + - Exceptional color on screen +- Hermit[fn::https://pcaro.es/p/hermit/] :: ~org-block~, anything Org/meta in + general - Slightly wider than Hack - More opinionated shapes - - Very legible parentheses + - Very legible parentheses, very useful for Emacs Lisp! + +**** Previously used /virgin fonts/ + +- +Liberation Sans+[fn::https://en.wikipedia.org/wiki/Liberation_fonts] :: +~variable-pitch~+ + - Metrically compatible with /Arial/ + - Unoffensive, unambitious forms + - Pretty angular letters, it's like you're trying to read squares +- +Open Sans+[fn::https://www.opensans.com/] :: +~variable-pitch~+ + - Ooh geometric Bauhaus influences, look at me + - Tall leading height is =h a r m o n i o u s= **** Using proportional fonts when needed diff --git a/smart-documents.pdf b/smart-documents.pdf index a774182..3e59ec8 100644 Binary files a/smart-documents.pdf and b/smart-documents.pdf differ diff --git a/templates/documents/default.org b/templates/documents/default.org new file mode 100644 index 0000000..cc99dc6 --- /dev/null +++ b/templates/documents/default.org @@ -0,0 +1,37 @@ +# -*- mode: org; eval: (visual-line-mode); -*- # + +# Hide Org mode tags +#+OPTIONS: tags:nil + +#+LATEX_CLASS: article + +# Ensure room for header and footer +#+LATEX_HEADER: \usepackage[left=1in,right=1in,top=1in,bottom=1.75in]{geometry} +# Beautiful fonts ONLY +#+LATEX_HEADER: \usepackage{fontspec} +#+LATEX_HEADER: \setmainfont{public sans} +#+LATEX_HEADER: \setmonofont{hack} + +# Get total page count to insert in footer +#+LATEX_HEADER: \usepackage{lastpage} +#+LATEX_HEADER: \usepackage{titling} + +# #+LATEX_HEADER: \usepackage{enumitem} +# #+LATEX_HEADER: \setlist{noitemsep} + +# Required to reset numbering of table rows from table to table. +#+LATEX_HEADER: \usepackage{etoolbox} +#+LATEX_HEADER: \makeatletter +#+LATEX_HEADER: \gpreto\tabular{\renewcommand{\arraystretch}{1.4}\rownum=\z@} +#+LATEX_HEADER: \makeatother + +# Headers and footers. +#+LATEX_HEADER: \usepackage{fancyhdr} +# Space in the header for a logo or image. +#+LATEX_HEADER: \setlength{\headheight}{36pt} +#+LATEX_HEADER_EXTRA: \pagestyle{fancy} +#+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-12pt]{0pt}{0pt}\texttt{\theauthor}} +#+LATEX_HEADER_EXTRA: \fancyhead[C]{\large\textbf{\thetitle}} +#+LATEX_HEADER_EXTRA: \fancyhead[R]{\thedate} +#+LATEX_HEADER_EXTRA: \renewcommand{\headrulewidth}{1.5pt} +#+LATEX_HEADER_EXTRA: \fancyfoot[C]{\hrulefill\\[10pt] Page \thepage/\pageref*{LastPage}\\[8pt] \footnotesize Compiled with \includegraphics[height=1.8ex]{./img/EmacsIcon.png}\\ Copyright \copyright~2020 Marius Peter. All rights reserved. } diff --git a/templates/documents/default.org_title b/templates/documents/default.org_title new file mode 100644 index 0000000..c2c3c09 --- /dev/null +++ b/templates/documents/default.org_title @@ -0,0 +1,16 @@ +# -*- mode: org; -*- # + +#+OPTIONS: title:nil toc:nil +# Increase spacing between header rule and main text body +#+LATEX: \rule[-2in]{0pt}{0pt}\\ +#+LATEX: \Huge\textbf{\thetitle}\\[1in] +#+LATEX: \LARGE\texttt{\theauthor}\\ +#+LATEX: \thedate + +#+LATEX: \clearpage + +#+LATEX: \normalsize +#+LATEX: \tableofcontents +#+LATEX: \listoffigures +#+LATEX: \listoftables +#+LATEX: \clearpage diff --git a/templates/documents/general.org b/templates/documents/general.org deleted file mode 100644 index 4a3cc56..0000000 --- a/templates/documents/general.org +++ /dev/null @@ -1,35 +0,0 @@ -# -*- mode: org; -*- # - -# Hide Org mode tags -#+OPTIONS: tags:nil - -#+LATEX_CLASS: article - -# Ensure room for header and footer -#+LATEX_HEADER: \usepackage[left=1in,right=1in,top=1in,bottom=1.75in]{geometry} -# Beautiful fonts ONLY -#+LATEX_HEADER: \usepackage{fontspec} -#+LATEX_HEADER: \setmainfont{linux libertine} -#+LATEX_HEADER: \setmonofont{hermit} - -# Get total page count to insert in footer -#+LATEX_HEADER: \usepackage{lastpage} -#+LATEX_HEADER: \usepackage{titling} - -# #+LATEX_HEADER: \usepackage{enumitem} -# #+LATEX_HEADER: \setlist{noitemsep} - -# Required to reset numbering of table rows from table to table. -#+LATEX_HEADER: \usepackage{etoolbox} -#+LATEX_HEADER: \makeatletter -#+LATEX_HEADER: \gpreto\tabular{\renewcommand{\arraystretch}{1.4}\rownum=\z@} -#+LATEX_HEADER: \makeatother - -#+LATEX_HEADER: \usepackage{fancyhdr} -#+LATEX_HEADER: \setlength{\headheight}{40pt} -#+LATEX_HEADER_EXTRA: \pagestyle{fancy} -#+LATEX_HEADER_EXTRA: \fancyhead[L]{\rule[-12pt]{0pt}{0pt}\texttt{\theauthor}} -#+LATEX_HEADER_EXTRA: \fancyhead[C]{\large\textbf{\thetitle}} -#+LATEX_HEADER_EXTRA: \fancyhead[R]{\thedate} -#+LATEX_HEADER_EXTRA: \renewcommand{\headrulewidth}{1.4pt} -#+LATEX_HEADER_EXTRA: \fancyfoot[C]{Page \thepage/\pageref*{LastPage}\\ \hrulefill \\ \footnotesize Copyright \copyright~2020 Marius Peter. All rights reserved.} diff --git a/templates/documents/general.org_title b/templates/documents/general.org_title deleted file mode 100644 index c2c3c09..0000000 --- a/templates/documents/general.org_title +++ /dev/null @@ -1,16 +0,0 @@ -# -*- mode: org; -*- # - -#+OPTIONS: title:nil toc:nil -# Increase spacing between header rule and main text body -#+LATEX: \rule[-2in]{0pt}{0pt}\\ -#+LATEX: \Huge\textbf{\thetitle}\\[1in] -#+LATEX: \LARGE\texttt{\theauthor}\\ -#+LATEX: \thedate - -#+LATEX: \clearpage - -#+LATEX: \normalsize -#+LATEX: \tableofcontents -#+LATEX: \listoffigures -#+LATEX: \listoftables -#+LATEX: \clearpage diff --git a/themes/blendoit-light-theme.el b/themes/blendoit-light-theme.el index a502d9a..9ff287c 100644 --- a/themes/blendoit-light-theme.el +++ b/themes/blendoit-light-theme.el @@ -5,7 +5,7 @@ 'blendoit-light '(cursor ((t (:background "red")))) '(fixed-pitch ((t (:family "Hack")))) - '(variable-pitch ((t (:family "Open Sans")))) + '(variable-pitch ((t (:family "Public Sans")))) '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown")))) '(minibuffer-prompt ((t (:inherit org-meta-line)))) @@ -60,7 +60,7 @@ '(org-checkbox-statistics-todo ((t (:inherit org-checkbox :foreground "tomato")))) '(org-checkbox-statistics-done ((t (:inherit org-checkbox :foreground "ForestGreen")))) '(org-verbatim ((t (:inherit fixed-pitch :height 0.9 :foreground "DodgerBlue1" :foundry "Hack")))) - '(font-lock-doc-face ((t (:inherit font-lock-string-face :Family "Open Sans")))) + '(font-lock-doc-face ((t (:inherit font-lock-string-face :Family "Public Sans")))) '(org-document-info ((t (:weight bold)))) '(org-table ((t (:height 0.8 :family "Hack")))) '(org-block ((t (:height 0.8 :family "Hermit")))) -- cgit v1.2.3