emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Disable fontification when exporting tables
@ 2017-09-27  8:29 Amos Bird
  2017-09-28 18:51 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Amos Bird @ 2017-09-27  8:29 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Hi,

How can I disable fontifications when exporting this:

   | QueryID | SQL Text                                                                                                            | Query Time (Seconds) | Query Time Hot (Seconds) |
   |---------+---------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
   | Q0      | SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);                          |                 1.27 |                     0.13 |
   | Q1      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC; |                 1.23 |                     0.21 |

regards,

--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 1141 bytes --]

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

* Re: Disable fontification when exporting tables
  2017-09-27  8:29 Disable fontification when exporting tables Amos Bird
@ 2017-09-28 18:51 ` Nicolas Goaziou
  2017-09-29  2:08   ` Amos Bird
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-09-28 18:51 UTC (permalink / raw)
  To: Amos Bird; +Cc: emacs-orgmode@gnu.org

Hello,

Amos Bird <amosbird@gmail.com> writes:

> How can I disable fontifications when exporting this:
>
>   QueryID  SQL Text  Query Time (Seconds)  Query Time Hot (Seconds)    
>   Q0  SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);  1.27  0.13    
>   Q1  SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;  1.23  0.21    

There are multiple solutions:
- include this in an example block,
- include this in a fixed-width area,
- use \star instead of *
- ...

Regards,

-- 
Nicolas Goaziou

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

* Re: Disable fontification when exporting tables
  2017-09-28 18:51 ` Nicolas Goaziou
@ 2017-09-29  2:08   ` Amos Bird
  2017-09-29 19:38     ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Amos Bird @ 2017-09-29  2:08 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Hi Nicolas,

I've tried the example block but it doesn't export well.

[[file:/home/amos/Pictures/Screenshots/img-2017-09-29-100634.png]]


> - include this in a fixed-width area,

Um, do you mean putting a <10> at the top of the second column? I tried that but it still doesn't
export cleanly.

> - use \star instead of *

Yeah, this is a valid option but it's a bit unconvenient....

regards,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Amos Bird <amosbird@gmail.com> writes:
>
>> How can I disable fontifications when exporting this:
>>
>>   QueryID  SQL Text  Query Time (Seconds)  Query Time Hot (Seconds)
>>   Q0  SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);  1.27  0.13
>>   Q1  SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;  1.23  0.21
>
> There are multiple solutions:
> - include this in an example block,
> - include this in a fixed-width area,
> - use \star instead of *
> - ...
>
> Regards,


--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 1531 bytes --]

[-- Attachment #2.2: img-2017-09-29-100634.png --]
[-- Type: image/png, Size: 42349 bytes --]

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

* Re: Disable fontification when exporting tables
  2017-09-29  2:08   ` Amos Bird
@ 2017-09-29 19:38     ` Nicolas Goaziou
  2017-09-30  1:13       ` Amos Bird
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-09-29 19:38 UTC (permalink / raw)
  To: Amos Bird; +Cc: emacs-orgmode@gnu.org

Hello,

Amos Bird <amosbird@gmail.com> writes:

> I've tried the example block but it doesn't export well.
>
> img-2017-09-29-100634.png

You didn't specify you were trying to export an Org table in the first
place. You need to give as much information as possible if you want to
have useful answers.

So, let's start again:

- what are you trying to export?
- to what back-end?
- what is the exact problem?

Regards,

-- 
Nicolas Goaziou

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

* Re: Disable fontification when exporting tables
  2017-09-29 19:38     ` Nicolas Goaziou
@ 2017-09-30  1:13       ` Amos Bird
  2017-09-30  7:36         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Amos Bird @ 2017-09-30  1:13 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2781 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Hi,

> - what are you trying to export?

an Org table like this:

#+BEGIN_EXAMPLE
| QueryID | SQL Text                                                                                                                                                                                  | Query Time (Seconds) | Query Time Hot (Seconds) |
|---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
| Q0      | SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;                                                                                                                               |                10.14 |                    11.57 |
| Q1      | SELECT passenger_count, avg(total_amount) FROM trips_log GROUP BY passenger_count;                                                                                                        |                12.00 |                     6.27 |
| Q2      | SELECT passenger_count, toYear(pickup_datetime) AS year, count(*) FROM trips_log GROUP BY passenger_count, year;                                                                          |                10.45 |                     7.23 |
| Q3      | SELECT passenger_count, toYear(pickup_datetime) AS year, round(trip_distance) AS distance, count(*) FROM trips_log GROUP BY passenger_count, year, distance ORDER BY year, count(*) DESC; |                13.03 |                    10.80 |
#+END_EXAMPLE

> - to what back-end?

ODT and HTML

> - what is the exact problem?

I'd like to export this table with *:nil ^:nil options while exporting other subtrees with *:t ^:t.

I tried surrounding the table with example block and src block but both look bad after exportation.

I added <10> to the SQL column but it doesn't help quoting the * and _ characters when exporting.

#+BEGIN_EXAMPLE
I also tried changing _ to \under{} and * to \asc{} but it doesn't look well in the Org buffer.

I did turn on org-toggle-pretty-entities but it changes the appearance of other subtrees which I don't want to.
#+END_EXAMPLE

regards,


Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Amos Bird <amosbird@gmail.com> writes:
>
>> I've tried the example block but it doesn't export well.
>>
>> img-2017-09-29-100634.png
>
> You didn't specify you were trying to export an Org table in the first
> place. You need to give as much information as possible if you want to
> have useful answers.
>
> So, let's start again:
>
> - what are you trying to export?
> - to what back-end?
> - what is the exact problem?
>
> Regards,


--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 3161 bytes --]

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

* Re: Disable fontification when exporting tables
  2017-09-30  1:13       ` Amos Bird
@ 2017-09-30  7:36         ` Nicolas Goaziou
  2017-09-30  7:43           ` Amos Bird
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-09-30  7:36 UTC (permalink / raw)
  To: Amos Bird; +Cc: emacs-orgmode@gnu.org

Hello,

Amos Bird <amosbird@gmail.com> writes:

>> - what are you trying to export?
>
> an Org table like this:
>
>
> | QueryID | SQL Text                                                                                                                                                                                  | Query Time (Seconds) | Query Time Hot (Seconds) |
> |---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
> | Q0      | SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;                                                                                                                               |                10.14 |                    11.57 |
> | Q1      | SELECT passenger_count, avg(total_amount) FROM trips_log GROUP BY passenger_count;                                                                                                        |                12.00 |                     6.27 |
> | Q2      | SELECT passenger_count, toYear(pickup_datetime) AS year, count(*) FROM trips_log GROUP BY passenger_count, year;                                                                          |                10.45 |                     7.23 |
> | Q3      | SELECT passenger_count, toYear(pickup_datetime) AS year, round(trip_distance) AS distance, count(*) FROM trips_log GROUP BY passenger_count, year, distance ORDER BY year, count(*) DESC; |                13.03 |                    10.80 |

OK.

>> - to what back-end?
>
> ODT and HTML

OK.

>> - what is the exact problem?
>
> I'd like to export this table with *:nil ^:nil options while exporting other subtrees with *:t ^:t.

This is not my question. You are explaining me how you are trying to
proceed. I want to know what it the problem you are trying to solve.

Anyway, it seems you are conflating fontification in the Org buffer and
export. I guess there is no issue related to export in this thread.

> I tried surrounding the table with example block and src block but
> both look bad after exportation.

Of course. I didn't know you were exporting an Org table.

However, you could add verbatim markup

  =SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;=

but, again, since I don't know exactly what the issue is, I may be wide
of the mark.

> characters when exporting.

I never suggested that.

> I also tried changing _ to \under{} and * to \asc{} but it doesn't look well in the Org buffer.
>
> I did turn on org-toggle-pretty-entities but it changes the appearance
> of other subtrees which I don't want to.

Maybe Org mode is not the appropriate mode for the task?

Regards,

-- 
Nicolas Goaziou

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

* Re: Disable fontification when exporting tables
  2017-09-30  7:36         ` Nicolas Goaziou
@ 2017-09-30  7:43           ` Amos Bird
  2017-09-30  7:49             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Amos Bird @ 2017-09-30  7:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 5358 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Hi,

> However, you could add verbatim markup
>
> =SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;=
>
> but, again, since I don't know exactly what the issue is, I may be wide
> of the mark.

Well, this solves my issue :).

But I also have a table like this :
#+BEGIN_EXAMPLE
   | QueryID | SQL Text                                                                                                                                            | Query Time (Seconds) | Query Time Hot (Seconds) |
   |---------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
   | Q0      | SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);                                                          |                 1.27 |                     0.13 |
   | Q1      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                                 |                 1.23 |                     0.21 |
   | Q2      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                 |                  1.4 |                     0.25 |
   | Q3      | SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10;              |                  5.2 |                     0.29 |
   | Q4      | SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10  AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC;                                    |                  1.0 |                     0.09 |
   | Q5      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier;                                    |                 0.12 |                     0.04 |
   | Q6      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier;                  |                 0.42 |                     0.26 |
#+END_EXAMPLE

that is, it contains = characters which breaks the verbatim markup.

Is there a way to specify the whole column to be verbatim?

regards,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Amos Bird <amosbird@gmail.com> writes:
>
>>> - what are you trying to export?
>>
>> an Org table like this:
>>
>>
>> | QueryID | SQL Text                                                                                                                                                                                  | Query Time (Seconds) | Query Time Hot (Seconds) |
>> |---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
>> | Q0      | SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;                                                                                                                               |                10.14 |                    11.57 |
>> | Q1      | SELECT passenger_count, avg(total_amount) FROM trips_log GROUP BY passenger_count;                                                                                                        |                12.00 |                     6.27 |
>> | Q2      | SELECT passenger_count, toYear(pickup_datetime) AS year, count(*) FROM trips_log GROUP BY passenger_count, year;                                                                          |                10.45 |                     7.23 |
>> | Q3      | SELECT passenger_count, toYear(pickup_datetime) AS year, round(trip_distance) AS distance, count(*) FROM trips_log GROUP BY passenger_count, year, distance ORDER BY year, count(*) DESC; |                13.03 |                    10.80 |
>
> OK.
>
>>> - to what back-end?
>>
>> ODT and HTML
>
> OK.
>
>>> - what is the exact problem?
>>
>> I'd like to export this table with *:nil ^:nil options while exporting other subtrees with *:t ^:t.
>
> This is not my question. You are explaining me how you are trying to
> proceed. I want to know what it the problem you are trying to solve.
>
> Anyway, it seems you are conflating fontification in the Org buffer and
> export. I guess there is no issue related to export in this thread.
>
>> I tried surrounding the table with example block and src block but
>> both look bad after exportation.
>
> Of course. I didn't know you were exporting an Org table.
>
> However, you could add verbatim markup
>
>   =SELECT cab_type, count(*) FROM trips_log GROUP BY cab_type;=
>
> but, again, since I don't know exactly what the issue is, I may be wide
> of the mark.
>
>> characters when exporting.
>
> I never suggested that.
>
>> I also tried changing _ to \under{} and * to \asc{} but it doesn't look well in the Org buffer.
>>
>> I did turn on org-toggle-pretty-entities but it changes the appearance
>> of other subtrees which I don't want to.
>
> Maybe Org mode is not the appropriate mode for the task?
>
> Regards,


--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 6393 bytes --]

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

* Re: Disable fontification when exporting tables
  2017-09-30  7:43           ` Amos Bird
@ 2017-09-30  7:49             ` Nicolas Goaziou
  2017-09-30  7:56               ` Amos Bird
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2017-09-30  7:49 UTC (permalink / raw)
  To: Amos Bird; +Cc: emacs-orgmode@gnu.org

Amos Bird <amosbird@gmail.com> writes:

> | QueryID | SQL Text                                                                                                                                            | Query Time (Seconds) | Query Time Hot (Seconds) |
> |---------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
> | Q0      | SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);                                                          |                 1.27 |                     0.13 |
> | Q1      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                                 |                 1.23 |                     0.21 |
> | Q2      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                 |                  1.4 |                     0.25 |
> | Q3      | SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10;              |                  5.2 |                     0.29 |
> | Q4      | SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10  AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC;                                    |                  1.0 |                     0.09 |
> | Q5      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier;                                    |                 0.12 |                     0.04 |
> | Q6      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier;                  |                 0.42 |                     0.26 |
>
> that is, it contains = characters which breaks the verbatim markup.

Then use `code' markup:

  ~SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier;~

which is more appropriate than `verbatim' for SQL code anyway.

> Is there a way to specify the whole column to be verbatim?

No, there isn't.

Regards,

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

* Re: Disable fontification when exporting tables
  2017-09-30  7:49             ` Nicolas Goaziou
@ 2017-09-30  7:56               ` Amos Bird
  0 siblings, 0 replies; 9+ messages in thread
From: Amos Bird @ 2017-09-30  7:56 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2509 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Thanks!

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Amos Bird <amosbird@gmail.com> writes:
>
>> | QueryID | SQL Text                                                                                                                                            | Query Time (Seconds) | Query Time Hot (Seconds) |
>> |---------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+--------------------------|
>> | Q0      | SELECT avg(c1) from (select Year, Month, count(*) as c1 from ontime group by Year, Month);                                                          |                 1.27 |                     0.13 |
>> | Q1      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                                 |                 1.23 |                     0.21 |
>> | Q2      | SELECT DayOfWeek, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY DayOfWeek ORDER BY c DESC;                 |                  1.4 |                     0.25 |
>> | Q3      | SELECT Origin, count(*) AS c FROM ontime WHERE DepDelay>10 AND Year >= 2000 AND Year <= 2008 GROUP BY Origin ORDER BY c DESC LIMIT 10;              |                  5.2 |                     0.29 |
>> | Q4      | SELECT Carrier, count(*) FROM ontime WHERE DepDelay>10  AND Year = 2007 GROUP BY Carrier ORDER BY count(*) DESC;                                    |                  1.0 |                     0.09 |
>> | Q5      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year = 2007 GROUP BY Carrier ORDER BY Carrier;                                    |                 0.12 |                     0.04 |
>> | Q6      | SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier;                  |                 0.42 |                     0.26 |
>>
>> that is, it contains = characters which breaks the verbatim markup.
>
> Then use `code' markup:
>
>   ~SELECT Carrier, avg(DepDelay > 10) * 1000 AS c3 FROM ontime WHERE Year >= 2000 AND Year <= 2008 GROUP BY Carrier ORDER BY Carrier;~
>
> which is more appropriate than `verbatim' for SQL code anyway.
>
>> Is there a way to specify the whole column to be verbatim?
>
> No, there isn't.
>
> Regards,


--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 2954 bytes --]

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

end of thread, other threads:[~2017-09-30  7:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27  8:29 Disable fontification when exporting tables Amos Bird
2017-09-28 18:51 ` Nicolas Goaziou
2017-09-29  2:08   ` Amos Bird
2017-09-29 19:38     ` Nicolas Goaziou
2017-09-30  1:13       ` Amos Bird
2017-09-30  7:36         ` Nicolas Goaziou
2017-09-30  7:43           ` Amos Bird
2017-09-30  7:49             ` Nicolas Goaziou
2017-09-30  7:56               ` Amos Bird

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).