When I create a clocktable without using :step
, like the block given below, the table generated has a #+CAPTION:
, that is exactly what I want.
Example:
#+BEGIN: clocktable :scope agenda-with-archives :block 2021-W31 :maxlevel 3 :hidefiles t :fileskip0 t :narrow 72! :match "-personal" :match "-nolog"
#+CAPTION: Clock summary at [2021-08-04 Wed 09:12], for week 2021-W31.
| Headline | Time | | |
|--------------------------------------------------+---------+------+------|
| *Total time* | *xxx* | | |
|--------------------------------------------------+---------+------+------|
| xxxx | xxxx | | |
| \_ xxxxxxxxxxxxxx | | xxxx | |
| \_ xxxxxxxxxxxxxxxxx | | | xxxx |
| \_ xxxxxxxxxxxxxxxxx | | | xxxx |
|--------------------------------------------------+---------+------+------|
| xxxxx | xxxx | | |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | xxxx | |
|--------------------------------------------------+---------+------+------|
| ... | .... | | |
| \_ LFA | | .... | |
| \_ Tarefas | | | .... |
#+END:
But when I give a :step
, the many tables generated do not have captions, instead they have a simple line of text before the tables.
Example:
#+BEGIN: clocktable :scope agenda-with-archives :block 2021-W31 :maxlevel 4 :hidefiles t :fileskip0 t :narrow 75! :step day :match "-personal" :match "-nolog"
Daily report: [2021-08-02 Mon]
| Headline | Time | | | |
|----------------------------------------------------+---------+------+------+------|
| *Total time* | *xx:xx* | | | |
|----------------------------------------------------+---------+------+------+------|
| 2021 | xx:xx | | | |
| \_ 2021-08 August | | | x:xx | |
| \_ 2021-08-02 Monday | | | x:xx | |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
|----------------------------------------------------+---------+------+------+------|
| ... | .... | | | |
Daily report: [2021-08-03 Tue]
| Headline | Time | | | |
|----------------------------------------------------+---------+------+------+------|
| *Total time* | *xx:xx* | | | |
|----------------------------------------------------+---------+------+------+------|
| 2021 | x:xx | | | |
| \_ 2021-08 August | | x:xx | | |
| \_ 2021-08-03 Tuesday | | | x:xx | |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
|----------------------------------------------------+---------+------+------+------|
| 2021i | x:xx | | | |
Daily report: [2021-08-04 Wed]
| Headline | Time | | | |
|----------------------------------------------------+--------+------+------+------|
| *Total time* | *x:xx* | | | |
|----------------------------------------------------+--------+------+------+------|
| 2021 | x:xx | | | |
| \_ 2021-08 August | | x:xx | | |
| \_ 2021-08-04 Wednesday | | | x:xx | |
| \_ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | | | | x:xx |
Daily report: [2021-08-05 Thu]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2021-08-06 Fri]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2021-08-07 Sat]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
Daily report: [2021-08-08 Sun]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:00* |
#+END:
Is there a way to may the clocktable generate #+CAPTION:
s for the tables when I use :step
?
Sorry if this is in the documentation, but I could not find it.
Thanks.
org-clocktable-steps
in fileorg-clock.el
, in the definition of the variablestep-header
- see the code here. The variable is used here.There is no provision for making the strings into captions: you will have to override that function with your own, almost identical function that does(insert "\n" "#+CAPTION: " step-header ...)
instead.my-clocktable-steps-with-captions
that is identical toorg-clocktable-steps
except for the(insert "\n" "#+CAPTION: " step-header ...)
part, and in my Emacs configuration file I did(setq org-clocktable-steps #'my-clocktable-steps-with-caption)
. The the result (the clocktables generated) remain the same. Do you have any idea of what am I missing?setq
will not work to set the function cell of a symbol: you needfset
for that - doC-h i g (elisp)Function cells
for details.. But for now, the easiest thing to do is to name your functionorg-clocktable-steps
: it will completely override the original. If you don't like it, delete it from your init file (if that's how you got it into the system in the first place - if you just evaluated it in the*scratch*
buffer or in an elisp buffer, you don't have to do anything special). Then restart emacs: that will install the standard function.fset
solved the problem. The function is working as intended now.