rev: tip draketo/software/org-mode-tipps.org -rw-r--r-- 22.8 KiB View raw Log this file
d2e4e938a80aArne Babenhauserheide taijiquan video 40 minutes ago
                                                                                
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
# custom home link so the RSS export works
#+HTML_LINK_HOME: https://www.draketo.de/software
#+INCLUDE: ../org-templates/level-1.org
#+title: How to do X with Emacs Org-Mode
#+date: <2021-08-23 Mo>
#+LANGUAGE: en

[[http://gnu.org/s/emacs][Emacs]] [[http://orgmode.org][Org mode]] keeps me organized. Here I plan to incrementally gather tipps.

#+begin_export html
<div class="sourcebox" markdown="1" >
<a href="org-mode.pdf"><img width="168" height="235" title="PDF" src="../assets/pdf-thumbnail.png" /></a><br />
<a href="org-mode.pdf">PDF</a> (drucken)
</div>
#+end_export

#+toc: headlines 2

#+begin_export html
<style>
  .org-src-container pre, pre.example {
    font-size: smaller;
    overflow-x: auto;
    min-width: unset;
    margin: 0em;
  }
</style>
#+end_export

* full-page images per page for printing via latex eport
  :PROPERTIES:
  :CUSTOM_ID: full-page-image-export-latex
  :ID:       9822f663-02ba-4b9e-8d08-9f7c50a32f03
  :PUBDATE:  <2021-08-23 Mo 09:41>
  :END:

Task: create a PDF with full-width images for printing.

#+html: <small>

#+begin_src org
,#+latex_header: \usepackage[margin=0.0cm]{geometry}
,#+options: toc:nil


# ## upside image ##
,#+latex: \noindent
,#+attr_latex: :width 0.9999\textwidth :height 0.9999\textheight :options keepaspectratio=true,angle=90
[[file:portrait.jpg]]


# ## rotated image ##
,#+latex: \noindent
,#+attr_latex: :width 0.9999\textwidth :height 0.9999\textheight :options keepaspectratio=true
[[file:landscape.jpg]]


# ## two images per page ##
,#+latex: \noindent
,#+attr_latex: :width 0.9999\textwidth :height 0.495\textheight :options keepaspectratio=true
[[file:landscape.jpg]]

,#+latex: \noindent
,#+attr_latex: :width 0.9999\textwidth :height 0.495\textheight :options keepaspectratio=true
[[file:landscape.jpg]]


# ## keep some space around the images 

,#+latex: \noindent
,#+attr_latex: :width 0.98\textwidth :height 0.98\textheight :options keepaspectratio=true
[[file:portrait.jpg]]
#+end_src

#+html: </small>

Now just export with =C-c C-e l p= (export to pdf). (the 0.9999 height and width prevent LaTeX from skipping pages)

To turn these into a gallery with 4x4 images per page to cut out the
images, you can use pdfnup:

#+begin_src bash
pdfnup --nup 4x4 --no-landscape foo.pdf
# creates foo-nup.pdf
#+end_src



* agenda-and-todo: my most important planning tool
  :PROPERTIES:
  :CUSTOM_ID: agenda-and-todo
  :ID:       5055dbc8-a4da-48d4-9c9f-b7ee00e214a8
  :PUBDATE:  <2021-08-26 Do 11:00>
  :END:

/When I open my Emacs, I hit F12./

[[file:screenshot-20210826103308.png][file:screenshot-20210826103308-width600.png]]

This is what keeps me organized — at home as well as at work. As you
can see with the high scheduled count, it isn't perfect, but whenever
I skip it, I lose focus. A lifesaver at work, staying ahead of
important tasks at home.

It’s a custom agenda combined with [[https://www.draketo.de/light/english/free-software/el-kanban-org-table][kanban.el]] and optimized TODO states.

Put this into your =~/.emacs.d/init.el= to replicate it:

#+begin_src elisp
;; KDE: show custom agenda with kanban via f12:
(with-eval-after-load 'org
  (setq org-agenda-custom-commands
        '(("o" "Agenda and TODOs"
           ((agenda)
            (tags-todo "-notodo-TERMIN" ((org-agenda-block-separator ?-)))
	        (tags "KANBAN" ((org-agenda-block-separator ?-)
                            (org-agenda-compact-blocks nil)
                            (org-agenda-overriding-header ""))))))))

;; from https://www.emacswiki.org/emacs/TransposeWindows solution by Robert Bost
(defun rotate-windows (arg)
  "Rotate your windows; with prefix argument to rotate the other direction"
  (interactive "P")
  (if (not (> (count-windows) 1))
      (message "You can't rotate a single window!")
    (let* ((rotate-times (prefix-numeric-value arg))
           (direction (if (or (< rotate-times 0) (equal arg '(4)))
                          'reverse 'identity)))
      (dotimes (_ (abs rotate-times))
        (dotimes (i (- (count-windows) 1))
          (let* ((w1 (elt (funcall direction (window-list)) i))
                 (w2 (elt (funcall direction (window-list)) (+ i 1)))
                 (b1 (window-buffer w1))
                 (b2 (window-buffer w2))
                 (s1 (window-start w1))
                 (s2 (window-start w2))
                 (p1 (window-point w1))
                 (p2 (window-point w2)))
            (set-window-buffer-start-and-point w1 b2 s2 p2)
            (set-window-buffer-start-and-point w2 b1 s1 p1)))))))

(defun my/org-agenda-show-kanban ()
  (interactive)
  (save-excursion
    (search-forward ":KANBAN:")
    (org-agenda-goto)
    (org-narrow-to-subtree)
    (show-all)
    (fit-window-to-buffer)
    (widen)
    (recenter-top-bottom 0)))

(defun agenda-and-todo ()
  (interactive)
  (org-agenda nil "o")
  (delete-other-windows)
  (my/org-agenda-show-kanban)
  (rotate-windows 1))
;;      systemsettings shortcuts: map f12 to
;;        emacsclient -e '(progn (show-frame)(agenda-and-todo))'
(global-set-key (kbd "<f12>") 'agenda-and-todo)
#+end_src

To make it look like the screenshot, also set some options in the org-file:

#+begin_src org
,#+STARTUP: overview
# TAG TERMIN is excluded from the Kanban table
,#+TAGS: WOHNUNG(w) RAUS(r) SONST(s) LESEN(l) KANBAN(k) 1w6(1) FAMILIE(f) TERMIN(t)
,#+STARTUP: hidestars logdone
,#+SEQ_TODO: ❢ ☯ ⧖ | ✔ DEFERRED
# logdone adds a DONE timestamp when switching from a TODO (before |)
# to a DONE keyword (after |)
# State with (!) behind it means, add a timestamp when switching to that.
# See http://orgmode.org/manual/Tracking-TODO-state-changes.html

|   |   |   |
|---+---+---|
|   |   |   |
|   |   |   |
|   |   |   |
,#+TBLFM: @1='(kanban-headers $#)::@2$1..@>$>='(kanban-zero @# $# "-TERMIN" 'file)
#+end_src

If you use this, the following could also come in handy:

#+begin_src elisp
;; KDE: update all agenda kanban tables with C-S-f12 (ctrl-shift f12)
(defun kanban-update-all ()
  (interactive)
  (cl-loop for i in org-agenda-files do
	   (with-current-buffer (find-file-noselect i)
	     (save-excursion ;; avoid changing the position in the agenda files
	       (beginning-of-buffer)
	       (while (search-forward "='(kanban-" nil t)
		 (org-ctrl-c-ctrl-c))))))
;;      systemsettings shortcuts: map control shift f12 to
;;        emacsclient -e '(progn (show-frame)(kanban-update-all))'
(global-set-key (kbd "C-S-<f12>") 'kanban-update-all)
#+end_src

* create a simple gantt-chart from a table with Gnuplot
  :PROPERTIES:
  :CUSTOM_ID: gantt
  :ID:       f03dfa8a-70a2-497a-ae17-c0bb9e413228
  :PUBDATE:  <2021-09-27 Mo 19:22>
  :END:

[[https://en.wikipedia.org/wiki/Gantt_chart][Gantt-Charts]] make it easy to grasp project organization tasks at a
glance. If you only need smaller projects with limited scope and 4-6
participants, it is viable to create them directly from an org-mode
table.

#+call: KollAbAccessGantt()

#+RESULTS:
[[file:gantt-out.png]]

All data is in the following Table: 

#+tblname: gantt-table
| Task           | Effort | Start           | End              | Who |
|----------------+--------+-----------------+------------------+-----|
| Time available |      1 | <2020-11-02 Mo> | <2020-11-13 Fr>  |     |
| Task 0         |      2 | <2020-11-03 Di> | [2020-11-05 Thu] | Al  |
| Task 1         |      1 | <2020-11-05 Do> | <2020-11-06 Fr>  | Bo  |
| Task 2         |      3 | <2020-11-05 Do> | [2020-11-10 Di]  | Ca  |
| Task 3         |      2 | <2020-11-06 Fr> | <2020-11-10 Di>  | Ca  |
| Task 4         |      2 | <2020-11-06 Fr> | <2020-11-06 Fr>  | Bo  |
| Task 5         |      1 | <2020-11-10 Di> | <2020-11-10 Di>  | Bo  |
| Task 6         |      1 | <2020-11-11 Mi> | <2020-11-12 Do>  | Bo  |
| Task 7         |      2 | <2020-11-09 Mo> | <2020-11-10 Di>  | Al  |
| Task 8         |      1 | <2020-11-12 Do> | <2020-11-12 Do>  | Al  |
| Task 9         |      1 | <2020-11-06 Fr> | <2020-11-09 Mo>  | Al  |
| Task 10        |      1 | <2020-11-12 Do> | <2020-11-13 Fr>  | Bo  |
| Task  11       |      1 | <2020-11-13 Fr> | <2020-11-13 Fr>  |     |

the time available row ensures that the whole project-duration is
shown. You need to set the start and end dates manually: Hit =C-c .=
to enter the calendar and select the date.

The parsing is done by the following code:

#+name: KollAbAccessGantt
#+begin_src gnuplot :var DATA=gantt-table :session gantt-chart :file gantt-out.png :exports code
# http://gnuplot.sourceforge.net/demo_5.1/gantt.html
OneMonth = strptime("%m","2")
OneWeek = strptime("%U","2")
OneDay = strptime("%d","2")
timeformat = "%Y-%m-%d %a"
T(N) = timecolumn(N,timeformat)

set xdata time
set format x "%a\n%d\n%b\n'%y"
set xtics OneDay nomirror
set xtics scale 2, 0.5
set mxtics 7

skiptorow=2
set yrange [(skiptorow-2):] reverse
set ytics nomirror

unset key
set title "{/=15 My Project}"
set grid x y
set border 3
set style arrow 1 nohead filled size screen 0.02, 15 fixed lt 3 lw 8

plot DATA using (T(3)) : ($0) : (T(4)-T(3)) : (0.0) : yticlabel(1) with vector as 1
#+end_src


You might have to add gnuplot to your active languages:

#+begin_src elisp
(org-babel-do-load-languages
 'org-babel-load-languages
 '((gnuplot . t)))
#+end_src

** More complex Gantt with plantuml
   :PROPERTIES:
   :ID:       e9fcb6fd-a8e8-4690-b872-43cb283f949c
   :CUSTOM_ID: gantt-plantuml
   :END:

If you need something more complex, you can go to the full [[https://plantuml.com/de/gantt-diagram][plantuml DSL]]. Example: 

#+begin_src plantuml :file my-complex-project.png :exports both
@startgantt
saturday are closed
sunday are closed
' see https://plantuml.com/gantt-diagram
Project starts at 2021-04-26
[Configuration] as [C] on {DEV1:50%} lasts 1 day
note bottom
  description
end note
[Implementation] as [I] on {DEV2} lasts 3 days
note bottom
  in multiple
  lines
end note
[I] starts at [C]'s end with green bold link
{DEV2} is off on 2021-04-30
@endgantt
#+end_src

#+RESULTS:
[[file:my-complex-project.png]]

The full source of these examples with the org-mode sourceblocks is available [[https://hg.sr.ht/~arnebab/draketo/browse/software/org-mode-tipps.org][in my website's source-code]].

** Projects to export gantt from the org-mode tree
   :PROPERTIES:
   :CUSTOM_ID: gantt-more
   :ID:       6cb0ea54-96de-4291-879c-0b8d45aab322
   :END:

- [[https://orgmode.org/worg/org-tutorials/org-taskjuggler.html][exported to taskjuggler]]
- [[https://github.com/legalnonsense/elgantt/][as interactive, emacs-hosted website]]
- [[https://github.com/swillner/org-gantt/blob/master/org-gantt-manual.pdf][via LaTeX]]

[2021-09-27 Mo]

* export to markdown and latex
  :PROPERTIES:
  :CUSTOM_ID: export-markdown-latex
  :ID:       cfb8be29-5663-4821-b9e6-a4923a692ae9
  :PUBDATE:  <2021-10-18 Mo 19:08>
  :END:

#+begin_src org
(require 'ox-md)
,#+begin_export markdown
# foo
__bar__
,#+end_export
,#+begin_export latex
\section{foo}
\textbf{bar}
,#+end_export
,*bar*
#+end_src

[2021-10-18 Mo]

* run org-capture from commandline
  :PROPERTIES:
  :CUSTOM_ID: org-capture-commandline
  :ID:       0ac27637-f1f6-49fb-b667-dd459b780139
  :PUBDATE:  <2021-11-11 Do 12:50>
  :END:

#+begin_src bash
emacs -nw -e org-capture
#+end_src

I call this in the shell via =CRTL-r capture ENTER=: Search backwards for the last command with capture.

[2021-11-11 Do]

* How I stay ahead of tasks with org-mode
  :PROPERTIES:
  :CUSTOM_ID: ahead-of-tasks
  :ID:       13c4a3de-9eb6-43ae-848b-569365913c5b
  :PUBDATE:  <2022-03-01 Di 09:48>
  :END:

I found that org-mode is the only organization tool for which using the
tool actually reduces the time I need for organization. That works by
taking notes in org-mode, too, and keeping it simple.

I also found that whenever I skip organizing in org-mode, I lose focus
and time used (lost?) for tasks extends a lot.

The basics of my setup are:

** Custom starting point: agenda-with-kanban
:PROPERTIES:
:ID:       79e93734-4187-48d0-b590-254d51c4547b
:END:
  A function to show the agenda it besides the Kanban table. I start
  each day and after each larger break by hitting F12. It shows me the
  agenda and entry points into my work. This enables me to stay focussed.

** One planning file
:PROPERTIES:
:ID:       6feb36da-e46c-4b87-b67b-090bdf84ce66
:END:
  I have a single file for all my tasks. That keeps working
  surprisingly long. Once a year or so it needs some cleanup to become
  faster again.

** Kanban Table at the top
:PROPERTIES:
:ID:       cdbeb26e-ab8c-48e1-a8e5-67ba0054f5a7
:END:
  I have a kanban table. It shows as most important information the
  tasks I am doing right now. If I am doing more than three work-tasks
  at the same time, it’s warning sign that I’m becoming inefficient.
  With this I start every day in org-mode by clicking on the link of the
  project from the kanban table to get to its notes (which I also track
  in org-mode). See
  https://www.draketo.de/light/english/free-software/el-kanban-org-table
  → https://hg.sr.ht/~arnebab/kanban.el

** Capture tasks for Projects
:PROPERTIES:
:ID:       003f1a8c-9ff7-48b2-b5ea-6fff3a64427b
:END:
  Projects have as many tasks as I need to track. At work they are
  usually Stories (3-5 days). Nowadays I create new tasks by using
  org-capture templates with one template per larger project and one for
  bugs, but I used to just use two templates (which might be a
  better fit for you):
  - (i) task to start immediately and
  - (l) task to start later

** Setup
:PROPERTIES:
:ID:       3597b5f5-312a-436c-b751-b28e6127ace3
:END:

#+begin_src elisp
(with-eval-after-load 'org
  (setq org-agenda-custom-commands
        '(("o" "Agenda and TODOs"
           ((agenda)
            (tags-todo "-notodo-TERMIN" ((org-agenda-block-separator ?-)))
	        (tags "KANBAN" ((org-agenda-block-separator ?-)
                            (org-agenda-compact-blocks nil)
                            (org-agenda-overriding-header ""))))))))
  (defun my/org-agenda-show-kanban ()
  (interactive)
  (save-excursion
    (search-forward ":KANBAN:") ;; uses the KANBAN tag
    (org-agenda-goto)
    (org-narrow-to-subtree)
    (show-all)
    (fit-window-to-buffer)
    (widen)
    (recenter-top-bottom 0)))

(defun agenda-and-todo ()
  (interactive)
  (org-agenda nil "o")
  (delete-other-windows)
  (my/org-agenda-show-kanban)
;;      desktop systemsettings shortcuts: map f12 to
;;        emacsclient -e '(progn (show-frame)(agenda-and-todo))'
(global-set-key (kbd "<f12>") 'agenda-and-todo)
#+end_src


[2022-03-01 Di]

* Effort in Clocktable and Columns
  :PROPERTIES:
  :CUSTOM_ID: effort-clocktable-columns
  :ID:       ae7d317f-b73b-4fd4-ace0-d67784fe4646
  :PUBDATE:  <2022-03-01 Di 09:48>
  :END:

To track how much time you need for tasks and train to get better at estimating, you can use org-set-effort.
I did that at work for a while. 

By having the effort in a clocktable I could see progress *when needed*.

Hitting R in the org-agenda shows the clockreport-mode and you can see
the Effort in the agenda by customizing
org-agenda-clockreport-parameter-plist (with =M-x customize-variable=):

#+begin_src elisp
(org-agenda-clockreport-parameter-plist
 (quote (:link t :maxlevel 2 :properties ("Effort"))))
#+end_src

For a while I had the clocktable active by default in the org-agenda.

You can also add that to the column-mode (org-columns) to get a quick
overview for a file (leave with org-columns-quit). Customize:

#+begin_src elisp
(org-columns-default-format
   "%25ITEM %TODO %3PRIORITY %TAGS %17Effort(Estimated Effort){:} %CLOCKSUM")
#+end_src


[2022-03-01 Di]

* integrating accounting with ledger into org-mode
  :PROPERTIES:
  :CUSTOM_ID: ledger-org
  :ID:       1a89893b-3aba-4414-91a3-20392f8e4ef9
  :PUBDATE:  2023-02-05 So 02:31
  :END:

#+begin_src elisp :exports results
(org-babel-do-load-languages
 'org-babel-load-languages
 '((ledger . t)         ;this is the important one for this tutorial
  ))
nil
#+end_src

#+RESULTS:

If you use ledger-cli for accounting, you can do pretty clever
post-processing inside org-mode. Here’s an example that uses
[[https://www.ledger-cli.org/3.0/doc/ledger3.html#Output-customization][--register-format]] to provide the register results directly as an
org-mode table:

#+begin_src org
,#+name: ledger-to-table
,#+begin_src elisp :var data=""
(concat "#+name: ledger-results\n"
          data
          "#+tblfm: \n"))
,#+end_src

,#+header: :post ledger-to-table(*this*)
,#+header: :cmdline reg -D --register-format "| [%(format_date(date)) %(payee)] | %(display_account) | %(display_amount) | %(display_total) | \n" --wide --date-format %Y-%m-%d
,#+begin_src ledger :results raw
2022-06-15 * py2guile
    Assets:epubli             3.13€
    Income:epubli
,#+end_src

#+end_src

This results in output like this (evaluated live on every export of this website):

#+name: ledger-to-table
#+begin_src elisp :var data=""
(concat "#+name: ledger-results\n"
          data
          "#+tblfm: \n"))
#+end_src

#+header: :post ledger-to-table(*this*)
#+header: :cmdline reg -D --register-format "| [%(format_date(date)) %(payee)] | %(display_account) | %(display_amount) | %(display_total) | \n" --wide --date-format %Y-%m-%d
#+begin_src ledger :exports both :noweb-ref ledger-data :results raw
2022-06-15 * py2guile
    Assets:epubli             3.13€
    Income:epubli
#+end_src

#+RESULTS:
#+name: ledger-results
| [2022-06-15 - 2022-06-15] | Assets:epubli | 3.13€ | 3.13€ | 
| [2022-06-15 - 2022-06-15] | Income:epubli | -3.13€ | 0.00€ | 
#+tblfm: 

To supercharge this, use noweb to re-use your filings for other
formats. Set :noweb-ref in the data-block and then use it for other
reports. This for example gives todays balance for the different
accounts:

#+begin_src org
,#+header: :post ledger-to-table(*this*)
,#+header: :cmdline bal --wide --date-format %Y-%m-%d --flat --balance-format "| %(partial_account) | %(display_total) | \n" 
,#+begin_src ledger :exports both :noweb no-export :results raw 
{{{ledger-data}}}
,#+end_src
#+end_src

#+header: :post ledger-to-table(*this*)
#+header: :cmdline bal --wide --date-format %Y-%m-%d --flat --balance-format "| %(partial_account) | %(display_total) | \n" 
#+begin_src ledger :exports both :noweb no-export :results raw 
{{{ledger-data}}}
#+end_src

#+RESULTS:
#+name: ledger-results
| Assets:epubli | 3.13€ | 
| Income:epubli | -3.13€ | 
|  | 0 | 
#+tblfm: 



/This uses direct evaluation and customized noweb-delimiters via:/

#+begin_src org
# Local Variables:
# org-confirm-babel-evaluate: nil
# org-babel-noweb-wrap-start: "{{{"
# org-babel-noweb-wrap-end: "}}}"
# End:
#+end_src


Also see 

- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
- https://www.ledger-cli.org/3.0/doc/ledger3.html#Org-mode-with-Babel



[2023-02-04 Sa]


# specific RSS feed
#+HTML_HEAD: <link rel="alternate" type="application/rss+xml" title="Emacs Org-Mode" href="https://www.draketo.de/software/org-mode-tipps.xml" />
#+setupfile: ../org-templates/level-1-software.org
#+RSS_BASE_URL: https://www.draketo.de/software
#+RSS_FEED_URL: https://www.draketo.de/software/org-mode-tipps.xml
#+RSS_IMAGE_URL: https://www.draketo.de/assets/portrait.png
# Local Variables:
# org-confirm-babel-evaluate: nil
# org-export-default-language: de
# org-babel-noweb-wrap-start: "{{{"
# org-babel-noweb-wrap-end: "}}}"
# org-latex-images-centered: nil
# End:
# override template options:
#+options: toc:nil H:2 num:nil ^:nil

* Easy signature-block for multiple signatures in org
  :PROPERTIES:
  :CUSTOM_ID: signature
  :ID:       0495eb86-daf6-4319-b63e-a14cfb5c77a4
  :PUBDATE:  2023-10-06 Fr 16:36
  :END:

I’ve long struggled to create simple signature lines, using
=\hrulefill=, =\uline= and some of [[https://tex.stackexchange.com/a/368419/53957][the other options]].

But all of these didn’t really match what I wanted, so here’s a
simpler version for org-mode:

#+begin_src org
,#+latex: \vfill

,#+latex_header: \usepackage[ngerman]{babel} % for German-formatted dates
,#+latex: \newcommand{\pA}{THE NAME 1}
,#+latex: \newcommand{\dA}{\today}
,#+latex: \newcommand{\lA}{LOCATION}

,#+latex: \newcommand{\pB}{THE NAME 2}
,#+latex: \newcommand{\dB}{\today}
,#+latex: \newcommand{\lB}{LOCATION}

| @@latex:\pA@@                       | @@latex:\hspace{1cm}@@ | @@latex:\pB@@                       |
|                                     |                        |                                     |
| @@latex:\underline{\phantom{\pA}}@@ |                        | @@latex:\underline{\phantom{\pB}}@@ |
| @@latex:\tiny \dA, \lA@@            |                        | @@latex:\tiny \dB, \lB@@            |
#+end_src




[2023-10-06 Fr]

* Include an imagemap with a plantuml diagram
  :PROPERTIES:
  :CUSTOM_ID: plantuml-imagemap
  :ID:       48204540-5349-4d3d-be2d-43328e9c4fc9
  :PUBDATE:  2024-01-10 Mi 10:22
  :END:

Embed a plantuml diagram with clickable links via simple imagemap.

** Example
:PROPERTIES:
:ID:       64dd9366-afa7-49ab-92ac-f51a3e6e5dce
:END:


#+begin_src plantuml :noweb-ref plantuml-imagemap-diagram :file plantuml-imagemap-diagram.png
title Plantuml diagram with Imagemap
hide empty members
hide circle
' scale dpi to fit the width of the page, otherwise the imagemap below is broken
skinparam dpi 72
class link [[#plantuml-imagemap-code]] #skyblue
link : to code
link -> example
#+end_src

#+attr_html: :style width:unset;max-width:unset :usemap #plantuml_map
#+RESULTS:
[[file:plantuml-imagemap-diagram.png]]

#+html: <div style="visibility: hidden">
#+begin_src plantuml :noweb yes :file plantuml-imagemap-diagram.map :cmdline "-pipemap" :exports results
<<plantuml-imagemap-diagram>>
#+end_src

#+RESULTS:
[[file:plantuml-imagemap-diagram.map]]
#+html: </div>

#+begin_src bash :results output html :exports results
cat plantuml-imagemap-diagram.map
#+end_src



** Code
:PROPERTIES:
:CUSTOM_ID: plantuml-imagemap-code
:ID:       036e3452-4891-4626-81fb-31a6aa482ee1
:END:

#+begin_src org
,#+begin_src plantuml :noweb-ref plantuml-imagemap-diagram :file plantuml-imagemap-diagram.png
title Plantuml diagram with Imagemap
hide empty members
hide circle
' scale dpi to be small enough so the image does not get scaled, otherwise the imagemap is broken
skinparam dpi 72
class link [[#plantuml-imagemap-code]] #skyblue
link : to code
link -> example
,#+end_src

,#+attr_html: :style width:unset;max-width:unset :usemap #plantuml_map
,#+RESULTS:
[[file:plantuml-imagemap-diagram.png]]

,#+html: <div style="visibility: hidden">
,#+begin_src plantuml :noweb yes :file plantuml-imagemap-diagram.map :cmdline "-pipemap" :exports results
<<plantuml-imagemap-diagram>>
,#+end_src

,#+RESULTS:
[[file:plantuml-imagemap-diagram.map]]
,#+html: </div>

,#+begin_src bash :results output html :exports results
cat plantuml-imagemap-diagram.map
,#+end_src

#+end_src

/This is a quite contrived hack, but it works. Note that the width
*must* be *unset* to avoid breaking the imagemap coordinates./

/Stackoverflow provides several answers to avoid this limitation in
case you want responsive images: [[https://stackoverflow.com/questions/7844399/responsive-image-map][Responsive Image Map]]./

I’m using this is [[file:programming-basics-wisp.org][Programming Basics: a map of Scheme with Wisp]].

[2024-01-10 Mi]


# Local Variables:
# org-confirm-babel-evaluate: nil
# End: