Hi, These past holidays I've been experimenting with some little useful, but fun stuff. This is an export filter to put a decorative initial letter in the first paragraphs of the first level sections, using the LaTeX package lettrine (https://www.ctan.org/pkg/lettrine). A screenshot: https://i.imgur.com/mLQVHFC.png #+BIND: org-export-filter-parse-tree-functions (lettrine) #+begin_src emacs-lisp :exports results :results none (defun lettrine (tree backend info) (when (org-export-derived-backend-p backend 'latex) (org-element-map tree 'headline (lambda (section) (when (eq 1 (org-element-property :level section)) (let* ((contents (org-element-interpret-data (org-element-contents section))) (lettrine-opt (org-export-get-node-property :LETTRINE_OPTIONS section t)) (contents-lettrine (with-temp-buffer (insert contents) (save-excursion (goto-char (point-min)) (re-search-forward "\\(\\b.\\)\\([^\s]+\\b\\)" nil t) (replace-match (concat "\\\\lettrine" (if lettrine-opt (format "[%s]" lettrine-opt) "") "{" "\\1" "}" "{" "\\2" "}") t nil) (org-element-parse-buffer))))) (apply #'org-element-set-contents section (list contents-lettrine))))) info) tree)) #+end_src Best regards, Juan Manuel
[-- Attachment #1: Type: text/plain, Size: 660 bytes --] On 7 January 2022, Juan Manuel Macías wrote: > These past holidays I've been experimenting with some little useful, but > fun stuff. This is an export filter to put a decorative initial letter > in the first paragraphs of the first level sections, using the LaTeX > package lettrine (https://www.ctan.org/pkg/lettrine). > > A screenshot: https://i.imgur.com/mLQVHFC.png This is beautiful, and a nice Org hack. I appreciate the typographical and design examples you send, and have learned a lot from them. Thank you. Bill -- William Denton https://www.miskatonic.org/ Librarian, artist and licensed private investigator. Toronto, Canada
Hi William,
William Denton writes:
> This is beautiful, and a nice Org hack. I appreciate the
> typographical and design examples you send, and have learned a lot
> from them. Thank you.
>
> Bill
Thanks for your kind words, I'm glad you found that code useful.
Best regards,
Juan Manuel