emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ATTR_LATEX not being applied on dynamic blocks
@ 2013-09-03 15:24 Francesco Pizzolante
  2013-09-03 15:46 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Francesco Pizzolante @ 2013-09-03 15:24 UTC (permalink / raw)
  To: mailing-list-org-mode

Hi,

I have an issue with ATTR_LATEX attributes not being applied to the clocktable
dynamic block.

This issue is similar to the one exposed by Sebastien in his post [1], so I took
his ECM and modified it a little bit.

Here's it is:

--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \usepackage{tabularx}

* Tasks

Some tasks with CLOCK lines.

** Design

*** TODO Do this
    :LOGBOOK:
    CLOCK: [2013-06-19 Wed 09:00]--[2013-06-19 Wed 10:11] =>  1:11
    :END:
    :PROPERTIES:
    :Effort:   2:00
    :END:

** Develop

*** TODO Do that
    :LOGBOOK:
    CLOCK: [2013-06-19 Wed 10:00]--[2013-06-19 Wed 12:22] =>  2:22
    CLOCK: [2013-06-20 Thu 10:01]--[2013-06-20 Thu 12:35] =>  2:34
    :END:

* Reporting

** Summary

#+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr
#+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang "en" :narrow 80! :indent t
Clock summary at [2013-09-03 Tue 17:16], for June 2013.

| Headline            | Time |      |      |
|---------------------+------+------+------|
| Total time          | 6:07 |      |      |
|---------------------+------+------+------|
| Tasks               | 6:07 |      |      |
| \__ Design          |      | 1:11 |      |
| \_____ TODO Do this |      |      | 1:11 |
| \__ Develop         |      | 4:56 |      |
| \_____ TODO Do that |      |      | 4:56 |
#+END:

--8<---------------cut here---------------end--------------->8---

This issue is a regression compared to Org 7 as this example works perfectly
with Org 7 (with this tiny change):

--8<---------------cut here---------------start------------->8---
#+ATTR_LATEX: tabularx width=\linewidth align=Xrrr
--8<---------------cut here---------------end--------------->8---

Any help is welcome.

Regards,
 Francesco

[1] http://lists.gnu.org/archive/html/emacs-orgmode/2013-07/msg00089.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ATTR_LATEX not being applied on dynamic blocks
  2013-09-03 15:24 ATTR_LATEX not being applied on dynamic blocks Francesco Pizzolante
@ 2013-09-03 15:46 ` Nicolas Goaziou
       [not found]   ` <87a9jt3o2l.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2013-09-03 15:46 UTC (permalink / raw)
  To: Francesco Pizzolante; +Cc: mailing-list-org-mode



Hello,

"Francesco Pizzolante"
<fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> writes:

> Hi,
>
> I have an issue with ATTR_LATEX attributes not being applied to the clocktable
> dynamic block.
>
> This issue is similar to the one exposed by Sebastien in his post [1], so I took
> his ECM and modified it a little bit.

Attributes are correctly applied to the block, but you want them to
apply on the inner table instead, which is different.  Correct syntax
should be something along the lines of:

  #+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang "en" :narrow 80! :indent t
  Clock summary at [2013-09-03 Tue 17:16], for June 2013.
  #+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr
  | Headline            | Time |      |      |
  |---------------------+------+------+------|
  | Total time          | 6:07 |      |      |
  |---------------------+------+------+------|
  | Tasks               | 6:07 |      |      |
  | \__ Design          |      | 1:11 |      |
  | \_____ TODO Do this |      |      | 1:11 |
  | \__ Develop         |      | 4:56 |      |
  | \_____ TODO Do that |      |      | 4:56 |
  #+END:


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ATTR_LATEX not being applied on dynamic blocks
       [not found]   ` <87a9jt3o2l.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-09-04  7:46     ` Francesco Pizzolante
  2013-09-04 11:41       ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Francesco Pizzolante @ 2013-09-04  7:46 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: mailing-list-org-mode, Francesco Pizzolante



Hi Nicolas,

> Attributes are correctly applied to the block, but you want them to
> apply on the inner table instead, which is different.

Indeed, this is a better expression of what I want.


>  Correct syntax should be something along the lines of:
>
>   #+BEGIN: clocktable :maxlevel 4 :scope file :block 2013-06 :lang "en" :narrow 80! :indent t
>   Clock summary at [2013-09-03 Tue 17:16], for June 2013.
>   #+ATTR_LATEX: :environment tabularx :width \linewidth :align Xrrr
>   | Headline            | Time |      |      |
>   |---------------------+------+------+------|
>   | Total time          | 6:07 |      |      |
>   |---------------------+------+------+------|
>   | Tasks               | 6:07 |      |      |
>   | \__ Design          |      | 1:11 |      |
>   | \_____ TODO Do this |      |      | 1:11 |
>   | \__ Develop         |      | 4:56 |      |
>   | \_____ TODO Do that |      |      | 4:56 |
>   #+END:

Well, you're probably right.

But if I try what you suggest and move the #+ATTR_LATEX line inside the
dynamic block (after the #+BEGIN: clocktable and just before the generated
table), then this line gets lost as soon as the dynamic block is regenerated,
which is not what I expect.

With Org 7, having the #+ATTR_LATEX line just before the #+BEGIN: clocktable
line applies the attributes to the inner table of the dynamic block and the
#+ATTR_LATEX line is not lost each time I regenerate the dynamic block.

Any other hint/solution for me?

Thanks a lot for your help.

Regards,
 Francesco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ATTR_LATEX not being applied on dynamic blocks
  2013-09-04  7:46     ` Francesco Pizzolante
@ 2013-09-04 11:41       ` Nicolas Goaziou
       [not found]         ` <878uzc4xwt.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2013-09-04 11:41 UTC (permalink / raw)
  To: Francesco Pizzolante; +Cc: mailing-list-org-mode, Francesco Pizzolante



Hello,

"Francesco Pizzolante" <fpz@missioncriticalit.com> writes:

> But if I try what you suggest and move the #+ATTR_LATEX line inside the
> dynamic block (after the #+BEGIN: clocktable and just before the generated
> table), then this line gets lost as soon as the dynamic block is regenerated,
> which is not what I expect.

Then some attribute could be added to dynamic block arguments in order
to re-create the ATTR_LATEX keyword each time. IIRC we did that
for #+CAPTION some months ago. It shouldn't be difficult to do it for
this one.

> With Org 7, having the #+ATTR_LATEX line just before the #+BEGIN: clocktable
> line applies the attributes to the inner table of the dynamic block and the
> #+ATTR_LATEX line is not lost each time I regenerate the dynamic
> block.

This is not possible anymore.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: ATTR_LATEX not being applied on dynamic blocks
       [not found]         ` <878uzc4xwt.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-09-05  8:18           ` Francesco Pizzolante
  2013-09-10 10:19             ` [PATCH] Allow caption and header text in clocktable dblocks Sebastien Vauban
  0 siblings, 1 reply; 6+ messages in thread
From: Francesco Pizzolante @ 2013-09-05  8:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: mailing-list-org-mode, Francesco Pizzolante



Hello Nicolas,

Nicolas Goaziou wrote:
> "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> writes:
>
>> But if I try what you suggest and move the #+ATTR_LATEX line inside the
>> dynamic block (after the #+BEGIN: clocktable and just before the generated
>> table), then this line gets lost as soon as the dynamic block is
>> regenerated, which is not what I expect.
>
> Then some attribute could be added to dynamic block arguments in order to
> re-create the ATTR_LATEX keyword each time. IIRC we did that for #+CAPTION
> some months ago. It shouldn't be difficult to do it for this one.

I've seen, indeed (thanks!), that there was a ":header" option, which you can
use to add free text in front of the dynamic table.

--8<---------------cut here---------------start------------->8---
#+BEGIN: clocktable :maxlevel 2 :scope ("clock-file.org") :block 2013-08 :fileskip0 t :lang "en" :header "#+ATTR_LaTeX: :environment longtabu :align lXrr\n"
#+ATTR_LaTeX: :environment longtabu :align lXrr
| File           | Headline            |   Time |      |
|----------------+---------------------+--------+------|
|                | ALL Total time      |   1:44 |      |
|----------------+---------------------+--------+------|
| clock-file.org | File time           | *1:44* |      |
|                | Projet management   |   1:44 |      |
|                | \__ Writing reports |        | 1:44 |
#+END:

Though, doing so, there is no CAPTION anymore...

I could add it in the "header", but then I loose the auto-generated (and
useful) stuff in the caption itself:

#+CAPTION: Clock summary at [2013-09-04 Wed 14:22], for August 2013.
--8<---------------cut here---------------end--------------->8---
                         ^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^
                         useful                     very useful

Maybe adding a ":header" should not strip the autogenerated caption?

>> With Org 7, having the #+ATTR_LATEX line just before the #+BEGIN:
>> clocktable line applies the attributes to the inner table of the dynamic
>> block and the #+ATTR_LATEX line is not lost each time I regenerate the
>> dynamic block.
>
> This is not possible anymore.

OK.

Regards,
 Francesco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Allow caption and header text in clocktable dblocks
  2013-09-05  8:18           ` Francesco Pizzolante
@ 2013-09-10 10:19             ` Sebastien Vauban
  0 siblings, 0 replies; 6+ messages in thread
From: Sebastien Vauban @ 2013-09-10 10:19 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Francesco,

"Francesco Pizzolante" wrote:
> Nicolas Goaziou wrote:
>> "Francesco Pizzolante" <fpz-djc/iPCCuDYQheJpep6IedvLeJWuRmrY@public.gmane.org> writes:
>>
>>> But if I try what you suggest and move the #+ATTR_LATEX line inside the
>>> dynamic block (after the #+BEGIN: clocktable and just before the generated
>>> table), then this line gets lost as soon as the dynamic block is
>>> regenerated, which is not what I expect.
>>
>> Then some attribute could be added to dynamic block arguments in order to
>> re-create the ATTR_LATEX keyword each time. IIRC we did that for #+CAPTION
>> some months ago. It shouldn't be difficult to do it for this one.
>
> I've seen, indeed (thanks!), that there was a ":header" option, which you
> can use to add free text in front of the dynamic table.
>
> #+BEGIN: clocktable :maxlevel 2 :scope ("clock-file.org") :block 2013-08 :fileskip0 t :lang "en" :header "#+ATTR_LaTeX: :environment longtabu :align lXrr\n"
> #+ATTR_LaTeX: :environment longtabu :align lXrr
> | File           | Headline            |   Time |      |
> |----------------+---------------------+--------+------|
> |                | ALL Total time      |   1:44 |      |
> |----------------+---------------------+--------+------|
> | clock-file.org | File time           | *1:44* |      |
> |                | Projet management   |   1:44 |      |
> |                | \__ Writing reports |        | 1:44 |
> #+END:
>
> Though, doing so, there is no CAPTION anymore...
>
> Maybe adding a ":header" should not strip the autogenerated caption?

I need that as well -- here is the patch (if Nicolas is OK with it)...

Best regards,
  Seb

From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Tue, 10 Sep 2013 12:15:26 +0200
Subject: [PATCH] Allow caption and header text in clocktable dblocks

* org-clock.el (org-clocktable-write-default): Allow caption and header text
  in clocktable dblocks.

---
 lisp/org-clock.el |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c39b589..27fba2a 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2388,19 +2388,21 @@ from the dynamic block definition."
     ;; Now we need to output this tsuff
     (goto-char ipos)
 
-    ;; Insert the text *before* the actual table
+    ;; Insert the caption
     (insert-before-markers
-     (or header
-	 ;; Format the standard header
-	 (concat
-	  "#+CAPTION: "
-	  (nth 9 lwords) " ["
-	  (substring
-	   (format-time-string (cdr org-time-stamp-formats))
-	   1 -1)
-	  "]"
-	  (if block (concat ", for " range-text ".") "")
-	  "\n")))
+     ;; Format the standard header
+     (concat
+      "#+CAPTION: "
+      (nth 9 lwords) " ["
+      (substring
+       (format-time-string (cdr org-time-stamp-formats))
+       1 -1)
+      "]"
+      (if block (concat ", for " range-text ".") "")
+      "\n"))
+
+    ;; Insert the header text *before* the actual table
+    (insert-before-markers header)
 
     ;; Insert the narrowing line
     (when (and narrow (integerp narrow) (not narrow-cut-p))
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-10 10:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 15:24 ATTR_LATEX not being applied on dynamic blocks Francesco Pizzolante
2013-09-03 15:46 ` Nicolas Goaziou
     [not found]   ` <87a9jt3o2l.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-04  7:46     ` Francesco Pizzolante
2013-09-04 11:41       ` Nicolas Goaziou
     [not found]         ` <878uzc4xwt.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-05  8:18           ` Francesco Pizzolante
2013-09-10 10:19             ` [PATCH] Allow caption and header text in clocktable dblocks Sebastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).