From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amos Bird Subject: Re: Disable fontification when exporting tables Date: Sat, 30 Sep 2017 15:43:56 +0800 Message-ID: <877ewgskar.fsf@gmail.com> References: <8737785ytb.fsf@gmail.com> <874lrmodvo.fsf@nicolasgoaziou.fr> <87bmlus1ci.fsf@gmail.com> <878tgxmh1q.fsf@nicolasgoaziou.fr> <87a81drnsv.fsf@gmail.com> <87ing0ljso.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyCRR-0005RB-KD for emacs-orgmode@gnu.org; Sat, 30 Sep 2017 03:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyCRN-0003hv-Ne for emacs-orgmode@gnu.org; Sat, 30 Sep 2017 03:44:05 -0400 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:43701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyCRN-0003hc-EO for emacs-orgmode@gnu.org; Sat, 30 Sep 2017 03:44:01 -0400 Received: by mail-pf0-x230.google.com with SMTP id y29so848220pff.0 for ; Sat, 30 Sep 2017 00:44:01 -0700 (PDT) In-reply-to: <87ing0ljso.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --=-=-= Content-Type: text/plain #+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 writes: > Hello, > > Amos Bird 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 --=-=-= Content-Type: multipart/related; boundary="==-=-=" --==-=-= Content-Type: text/html

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 :

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

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 cabtype, count(*) FROM tripslog GROUP BY cabtype; | 10.14 | 11.57 |
>> | Q1 | SELECT passengercount, avg(totalamount) FROM tripslog GROUP BY passengercount; | 12.00 | 6.27 |
>> | Q2 | SELECT passengercount, toYear(pickupdatetime) AS year, count() FROM tripslog GROUP BY passengercount, year; | 10.45 | 7.23 |
>> | Q3 | SELECT passengercount, toYear(pickupdatetime) AS year, round(tripdistance) AS distance, count(
) FROM tripslog GROUP BY passengercount, 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 _ and * to 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

--==-=-=-- --=-=-=--