emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* latex-export + columnview: misinterpretation of section prefixes as emphasis
@ 2010-05-31  3:38 Juan Pechiar
       [not found] ` <D96E521D-17DE-4725-AD9A-363522C9B1E9@tsdye.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Juan Pechiar @ 2010-05-31  3:38 UTC (permalink / raw)
  To: Emacs-orgmode

Hi!

The test file below contains a columnview table showing section
headers.

Export to HTML works OK: the asterisks inside the table are
transformed into indentation.

Export to LaTeX: asterisk pairs are interpreted as emphasis, resulting
in an incorrect renering of asterisks and bold asterisks.

Following the code, I got lost at org-export-latex-fontify.

I will keep searching for what is happening, but any guidance will be
appreciated.

Thanks!

.j.


Test file:
========================================
#+COLUMNS: %25ITEM

* There comes the table

#+BEGIN: columnview :vlines 1 :id global
|   | ITEM                    |
|---+-------------------------|
|   | * There comes the table |
|   | * first                 |
|   | ** second               |
|   | *** third               |
|   | *** other third         |
|   | **** fourth             |
|   | ** other second         |
| / | <>                      |
#+END:

* first
** second
*** third
*** other third
**** fourth
** other second
========================================

LaTeX output:
========================================
\begin{tabular}{l}
 ITEM                     \\
\hline
 * There comes the table  \\
 * first                  \\
 ** second                \\
 *** third                \\
 \textbf{*} other third   \\
 \textbf{**} fourth       \\
 ** other second          \\
\end{tabular}
========================================

And the PDF display reads:
========================================
ITEM
* There comes the table
first
* second
** third
* other third
** fourth
* other second
========================================

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
       [not found]   ` <20100531130409.GE27574@soloJazz.com>
@ 2010-05-31 16:57     ` Thomas S. Dye
  0 siblings, 0 replies; 19+ messages in thread
From: Thomas S. Dye @ 2010-05-31 16:57 UTC (permalink / raw)
  To: Juan; +Cc: Org Mode

Thanks Juan.

That's an interesting idea.  I can't think of a way to do something  
equivalent, though others on the list might offer some possibilities.

All the best,
Tom

On May 31, 2010, at 3:04 AM, Juan wrote:

> On Sun, May 30, 2010 at 09:06:53PM -1000, Thomas S. Dye wrote:
>> Can I ask why you want headlines inside a table?
>
> Hi Tom,
>
> When producing specifications, I always add a table with modification
> time for each section, so that other colleagues can have a quick view
> of what has changed recently. I use it thus:
>
>   #+COLUMNS: %ITEM(Section) %TIMESTAMP_IA(Modified)
>   #+TODO: NEW(n!) UPDATED(u@/!) FINAL(f@/!)
>
> And each section keeps a LOGBOOK of changes (todo states
> NEW/UPDATED/FINAL, with comment added on each update).
>
> Is there any other way I can have something equivalent?
>
> Thanks, & best regards.
>
> .j.
>
>> On May 30, 2010, at 5:38 PM, Juan Pechiar wrote:
>>> The test file below contains a columnview table showing section
>>> headers.
>>>
>>> Export to HTML works OK: the asterisks inside the table are
>>> transformed into indentation.
>>>
>>> Export to LaTeX: asterisk pairs are interpreted as emphasis,  
>>> resulting
>>> in an incorrect renering of asterisks and bold asterisks.
>
>
>>> Test file:
>>> ========================================
>>> #+COLUMNS: %25ITEM
>>>
>>> * There comes the table
>>>
>>> #+BEGIN: columnview :vlines 1 :id global
>>> |   | ITEM                    |
>>> |---+-------------------------|
>>> |   | * There comes the table |
>>> |   | * first                 |
>>> |   | ** second               |
>>> |   | *** third               |
>>> |   | *** other third         |
>>> |   | **** fourth             |
>>> |   | ** other second         |
>>> | / | <>                      |
>>> #+END:
>>>
>>> * first
>>> ** second
>>> *** third
>>> *** other third
>>> **** fourth
>>> ** other second
>>> ========================================
>>>
>>> LaTeX output:
>>> ========================================
>>> \begin{tabular}{l}
>>> ITEM                     \\
>>> \hline
>>> * There comes the table  \\
>>> * first                  \\
>>> ** second                \\
>>> *** third                \\
>>> \textbf{*} other third   \\
>>> \textbf{**} fourth       \\
>>> ** other second          \\
>>> \end{tabular}
>>> ========================================

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2010-05-31  3:38 latex-export + columnview: misinterpretation of section prefixes as emphasis Juan Pechiar
       [not found] ` <D96E521D-17DE-4725-AD9A-363522C9B1E9@tsdye.com>
@ 2010-06-01  7:32 ` Carsten Dominik
  2010-06-01 10:51   ` Tim Burt
  2016-06-22 18:45 ` Lele Gaifax
  2 siblings, 1 reply; 19+ messages in thread
From: Carsten Dominik @ 2010-06-01  7:32 UTC (permalink / raw)
  To: Juan Pechiar; +Cc: Emacs-orgmode

Hi Juan,
On May 31, 2010, at 5:38 AM, Juan Pechiar wrote:

> Hi!
>
> The test file below contains a columnview table showing section
> headers.
>
> Export to HTML works OK: the asterisks inside the table are
> transformed into indentation.
>
> Export to LaTeX: asterisk pairs are interpreted as emphasis, resulting
> in an incorrect renering of asterisks and bold asterisks.
>
> Following the code, I got lost at org-export-latex-fontify.
>
> I will keep searching for what is happening, but any guidance will be
> appreciated.

I have fixed at least part of the problem, so the stars will no longer  
be
interpreted as emphasis.

However, I am still getting strange results.  FOrmatting a latex file
with this:

\begin{center}
\begin{tabular}{l}
  ITEM                     \\
\hline
* There comes the table  \\
* first                  \\
** second                \\
*** third                \\
*** other third          \\
**** fourth              \\
** other second          \\
\end{tabular}
\end{center}

somehow swallows some of the stars, but seemingly random.
For example, the star before "There" remains, but the star
before "first" disappears.

This must be some strange LaTeX thing - does anyone
understand what is going on here?

- Carsten


>
> Thanks!
>
> .j.
>
>
> Test file:
> ========================================
> #+COLUMNS: %25ITEM
>
> * There comes the table
>
> #+BEGIN: columnview :vlines 1 :id global
> |   | ITEM                    |
> |---+-------------------------|
> |   | * There comes the table |
> |   | * first                 |
> |   | ** second               |
> |   | *** third               |
> |   | *** other third         |
> |   | **** fourth             |
> |   | ** other second         |
> | / | <>                      |
> #+END:
>
> * first
> ** second
> *** third
> *** other third
> **** fourth
> ** other second
> ========================================
>
> LaTeX output:
> ========================================
> \begin{tabular}{l}
> ITEM                     \\
> \hline
> * There comes the table  \\
> * first                  \\
> ** second                \\
> *** third                \\
> \textbf{*} other third   \\
> \textbf{**} fourth       \\
> ** other second          \\
> \end{tabular}
> ========================================
>
> And the PDF display reads:
> ========================================
> ITEM
> * There comes the table
> first
> * second
> ** third
> * other third
> ** fourth
> * other second
> ========================================
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2010-06-01  7:32 ` Carsten Dominik
@ 2010-06-01 10:51   ` Tim Burt
  2010-06-01 13:34     ` Carsten Dominik
  0 siblings, 1 reply; 19+ messages in thread
From: Tim Burt @ 2010-06-01 10:51 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Emacs-orgmode, Juan Pechiar



Carsten Dominik <carsten.dominik@gmail.com> writes:

> Hi Juan,
> On May 31, 2010, at 5:38 AM, Juan Pechiar wrote:
>
>> Hi!
>>
>> The test file below contains a columnview table showing section
>> headers.
>>
>> Export to HTML works OK: the asterisks inside the table are
>> transformed into indentation.
>>
>> Export to LaTeX: asterisk pairs are interpreted as emphasis, resulting
>> in an incorrect renering of asterisks and bold asterisks.
>>
>> Following the code, I got lost at org-export-latex-fontify.
>>
>> I will keep searching for what is happening, but any guidance will be
>> appreciated.
>
> I have fixed at least part of the problem, so the stars will no longer
> be
> interpreted as emphasis.
>
> However, I am still getting strange results.  FOrmatting a latex file
> with this:
>
> \begin{center}
> \begin{tabular}{l}
>  ITEM                     \\
> \hline
> * There comes the table  \\
> * first                  \\
> ** second                \\
> *** third                \\
> *** other third          \\
> **** fourth              \\
> ** other second          \\
> \end{tabular}
> \end{center}
>
> somehow swallows some of the stars, but seemingly random.
> For example, the star before "There" remains, but the star
> before "first" disappears.
>
> This must be some strange LaTeX thing - does anyone
> understand what is going on here?

This is indeed a LaTeX thing.  The newline sequence (\\) has more than
one signature
 - \\ :: simple newline
 - \\[additionalSpace] :: newline with additionalSpace
 - \\*[additionalSpace] :: same as above but will not break a page  
After the \\ sequence, LaTeX looks for a [ or a * in case the optional
argument exists.  In the example above the star is found as _part of a
command sequence_ and is therefore not available as something to
typeset.  

One solution in this situation is to put an empty group before the
stars: 
   \begin{center}
   \begin{tabular}{l}
    ITEM                     \\
   \hline
   {}* There comes the table  \\
   {}* first                  \\
   {}** second                \\
   {}*** third                \\
   {}*** other third          \\
   {}**** fourth              \\
   {}** other second          \\
   \end{tabular}
   \end{center}

I will think on other possible options.  I hope this helps.
Tim


>
> - Carsten
>
>
>>
>> Thanks!
>>
>> .j.
>>
>>
>> Test file:
>> ========================================
>> #+COLUMNS: %25ITEM
>>
>> * There comes the table
>>
>> #+BEGIN: columnview :vlines 1 :id global
>> |   | ITEM                    |
>> |---+-------------------------|
>> |   | * There comes the table |
>> |   | * first                 |
>> |   | ** second               |
>> |   | *** third               |
>> |   | *** other third         |
>> |   | **** fourth             |
>> |   | ** other second         |
>> | / | <>                      |
>> #+END:
>>
>> * first
>> ** second
>> *** third
>> *** other third
>> **** fourth
>> ** other second
>> ========================================
>>
>> LaTeX output:
>> ========================================
>> \begin{tabular}{l}
>> ITEM                     \\
>> \hline
>> * There comes the table  \\
>> * first                  \\
>> ** second                \\
>> *** third                \\
>> \textbf{*} other third   \\
>> \textbf{**} fourth       \\
>> ** other second          \\
>> \end{tabular}
>> ========================================
>>
>> And the PDF display reads:
>> ========================================
>> ITEM
>> * There comes the table
>> first
>> * second
>> ** third
>> * other third
>> ** fourth
>> * other second
>> ========================================
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> - Carsten
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2010-06-01 10:51   ` Tim Burt
@ 2010-06-01 13:34     ` Carsten Dominik
  2010-06-01 14:52       ` tcburt
  0 siblings, 1 reply; 19+ messages in thread
From: Carsten Dominik @ 2010-06-01 13:34 UTC (permalink / raw)
  To: Tim Burt; +Cc: Emacs-orgmode, Juan Pechiar


On Jun 1, 2010, at 12:51 PM, Tim Burt wrote:

>
>
> Carsten Dominik <carsten.dominik@gmail.com> writes:
>
>> Hi Juan,
>> On May 31, 2010, at 5:38 AM, Juan Pechiar wrote:
>>
>>> Hi!
>>>
>>> The test file below contains a columnview table showing section
>>> headers.
>>>
>>> Export to HTML works OK: the asterisks inside the table are
>>> transformed into indentation.
>>>
>>> Export to LaTeX: asterisk pairs are interpreted as emphasis,  
>>> resulting
>>> in an incorrect renering of asterisks and bold asterisks.
>>>
>>> Following the code, I got lost at org-export-latex-fontify.
>>>
>>> I will keep searching for what is happening, but any guidance will  
>>> be
>>> appreciated.
>>
>> I have fixed at least part of the problem, so the stars will no  
>> longer
>> be
>> interpreted as emphasis.
>>
>> However, I am still getting strange results.  FOrmatting a latex file
>> with this:
>>
>> \begin{center}
>> \begin{tabular}{l}
>> ITEM                     \\
>> \hline
>> * There comes the table  \\
>> * first                  \\
>> ** second                \\
>> *** third                \\
>> *** other third          \\
>> **** fourth              \\
>> ** other second          \\
>> \end{tabular}
>> \end{center}
>>
>> somehow swallows some of the stars, but seemingly random.
>> For example, the star before "There" remains, but the star
>> before "first" disappears.
>>
>> This must be some strange LaTeX thing - does anyone
>> understand what is going on here?
>
> This is indeed a LaTeX thing.  The newline sequence (\\) has more than
> one signature
> - \\ :: simple newline
> - \\[additionalSpace] :: newline with additionalSpace
> - \\*[additionalSpace] :: same as above but will not break a page
> After the \\ sequence, LaTeX looks for a [ or a * in case the optional
> argument exists.  In the example above the star is found as _part of a
> command sequence_ and is therefore not available as something to
> typeset.
>
> One solution in this situation is to put an empty group before the
> stars:
>   \begin{center}
>   \begin{tabular}{l}
>    ITEM                     \\
>   \hline
>   {}* There comes the table  \\
>   {}* first                  \\
>   {}** second                \\
>   {}*** third                \\
>   {}*** other third          \\
>   {}**** fourth              \\
>   {}** other second          \\
>   \end{tabular}
>   \end{center}
>
> I will think on other possible options.  I hope this helps.

Well, it certainly helps!  Thanks a lot. At least I understand
now what is going on.  I guess one solution would be to add an empty  
column into the Org table and export this as an empty column.   
Whatever we do, it will be a hack.

- Carsten


> Tim
>
>
>>
>> - Carsten
>>
>>
>>>
>>> Thanks!
>>>
>>> .j.
>>>
>>>
>>> Test file:
>>> ========================================
>>> #+COLUMNS: %25ITEM
>>>
>>> * There comes the table
>>>
>>> #+BEGIN: columnview :vlines 1 :id global
>>> |   | ITEM                    |
>>> |---+-------------------------|
>>> |   | * There comes the table |
>>> |   | * first                 |
>>> |   | ** second               |
>>> |   | *** third               |
>>> |   | *** other third         |
>>> |   | **** fourth             |
>>> |   | ** other second         |
>>> | / | <>                      |
>>> #+END:
>>>
>>> * first
>>> ** second
>>> *** third
>>> *** other third
>>> **** fourth
>>> ** other second
>>> ========================================
>>>
>>> LaTeX output:
>>> ========================================
>>> \begin{tabular}{l}
>>> ITEM                     \\
>>> \hline
>>> * There comes the table  \\
>>> * first                  \\
>>> ** second                \\
>>> *** third                \\
>>> \textbf{*} other third   \\
>>> \textbf{**} fourth       \\
>>> ** other second          \\
>>> \end{tabular}
>>> ========================================
>>>
>>> And the PDF display reads:
>>> ========================================
>>> ITEM
>>> * There comes the table
>>> first
>>> * second
>>> ** third
>>> * other third
>>> ** fourth
>>> * other second
>>> ========================================
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> - Carsten
>>
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2010-06-01 13:34     ` Carsten Dominik
@ 2010-06-01 14:52       ` tcburt
  0 siblings, 0 replies; 19+ messages in thread
From: tcburt @ 2010-06-01 14:52 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Emacs-orgmode, Juan Pechiar


---- Carsten Dominik <carsten.dominik@gmail.com> wrote: 
> 
> On Jun 1, 2010, at 12:51 PM, Tim Burt wrote:
> 
> >
> >
> > Carsten Dominik <carsten.dominik@gmail.com> writes:
> >
> >> Hi Juan,
> >> On May 31, 2010, at 5:38 AM, Juan Pechiar wrote:
> >>
> >>> Hi!
> >>>
> >>> The test file below contains a columnview table showing section
> >>> headers.
> >>>
> >>> Export to HTML works OK: the asterisks inside the table are
> >>> transformed into indentation.
> >>>
> >>> Export to LaTeX: asterisk pairs are interpreted as emphasis,  
> >>> resulting
> >>> in an incorrect renering of asterisks and bold asterisks.
> >>>
> >>> Following the code, I got lost at org-export-latex-fontify.
> >>>
> >>> I will keep searching for what is happening, but any guidance will  
> >>> be
> >>> appreciated.
> >>
> >> I have fixed at least part of the problem, so the stars will no  
> >> longer
> >> be
> >> interpreted as emphasis.
> >>
> >> However, I am still getting strange results.  FOrmatting a latex file
> >> with this:
> >>
> >> \begin{center}
> >> \begin{tabular}{l}
> >> ITEM                     \\
> >> \hline
> >> * There comes the table  \\
> >> * first                  \\
> >> ** second                \\
> >> *** third                \\
> >> *** other third          \\
> >> **** fourth              \\
> >> ** other second          \\
> >> \end{tabular}
> >> \end{center}
> >>
> >> somehow swallows some of the stars, but seemingly random.
> >> For example, the star before "There" remains, but the star
> >> before "first" disappears.
> >>
> >> This must be some strange LaTeX thing - does anyone
> >> understand what is going on here?
> >
> > This is indeed a LaTeX thing.  The newline sequence (\\) has more than
> > one signature
> > - \\ :: simple newline
> > - \\[additionalSpace] :: newline with additionalSpace
> > - \\*[additionalSpace] :: same as above but will not break a page
> > After the \\ sequence, LaTeX looks for a [ or a * in case the optional
> > argument exists.  In the example above the star is found as _part of a
> > command sequence_ and is therefore not available as something to
> > typeset.
> >
> > One solution in this situation is to put an empty group before the
> > stars:
> >   \begin{center}
> >   \begin{tabular}{l}
> >    ITEM                     \\
> >   \hline
> >   {}* There comes the table  \\
> >   {}* first                  \\
> >   {}** second                \\
> >   {}*** third                \\
> >   {}*** other third          \\
> >   {}**** fourth              \\
> >   {}** other second          \\
> >   \end{tabular}
> >   \end{center}
> >
> > I will think on other possible options.  I hope this helps.
> 
> Well, it certainly helps!  Thanks a lot. At least I understand
> now what is going on.  I guess one solution would be to add an empty  
> column into the Org table and export this as an empty column.   
> Whatever we do, it will be a hack.

I have not found a hack-free solution yet.  Here are some other things I've tried that would be less hackish, but have all failed:
 - Replace \\ with \tabularnewline :: Same behavior as with \\
 - Replace \\ with \\{} :: Extra horizontal space before the *
 - Replace \\ with \tabularnewline{} :: Same behavior as \\{}

I just now tried another solution that does work, but may still be considered a hack.  In short, use the optional argument explicitly:
 - Replace \\ with \\[0pt] :: This has the expected behavior for the * and for the spacing

Tim


> 
> - Carsten
> 
> 
> > Tim
> >
> >
> >>
> >> - Carsten
> >>
> >>
> >>>
> >>> Thanks!
> >>>
> >>> .j.
> >>>
> >>>
> >>> Test file:
> >>> ========================================
> >>> #+COLUMNS: %25ITEM
> >>>
> >>> * There comes the table
> >>>
> >>> #+BEGIN: columnview :vlines 1 :id global
> >>> |   | ITEM                    |
> >>> |---+-------------------------|
> >>> |   | * There comes the table |
> >>> |   | * first                 |
> >>> |   | ** second               |
> >>> |   | *** third               |
> >>> |   | *** other third         |
> >>> |   | **** fourth             |
> >>> |   | ** other second         |
> >>> | / | <>                      |
> >>> #+END:
> >>>
> >>> * first
> >>> ** second
> >>> *** third
> >>> *** other third
> >>> **** fourth
> >>> ** other second
> >>> ========================================
> >>>
> >>> LaTeX output:
> >>> ========================================
> >>> \begin{tabular}{l}
> >>> ITEM                     \\
> >>> \hline
> >>> * There comes the table  \\
> >>> * first                  \\
> >>> ** second                \\
> >>> *** third                \\
> >>> \textbf{*} other third   \\
> >>> \textbf{**} fourth       \\
> >>> ** other second          \\
> >>> \end{tabular}
> >>> ========================================
> >>>
> >>> And the PDF display reads:
> >>> ========================================
> >>> ITEM
> >>> * There comes the table
> >>> first
> >>> * second
> >>> ** third
> >>> * other third
> >>> ** fourth
> >>> * other second
> >>> ========================================
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Emacs-orgmode mailing list
> >>> Please use `Reply All' to send replies to the list.
> >>> Emacs-orgmode@gnu.org
> >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> >>
> >> - Carsten
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Emacs-orgmode mailing list
> >> Please use `Reply All' to send replies to the list.
> >> Emacs-orgmode@gnu.org
> >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 
> - Carsten
> 
> 
> 

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2010-05-31  3:38 latex-export + columnview: misinterpretation of section prefixes as emphasis Juan Pechiar
       [not found] ` <D96E521D-17DE-4725-AD9A-363522C9B1E9@tsdye.com>
  2010-06-01  7:32 ` Carsten Dominik
@ 2016-06-22 18:45 ` Lele Gaifax
  2016-06-22 19:56   ` Nicolas Goaziou
  2 siblings, 1 reply; 19+ messages in thread
From: Lele Gaifax @ 2016-06-22 18:45 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I know this is an ancient thread, but it seems the problem is still there, in
Emacs 25.

FWIW, this is my quick and dirty fix, that at least produce a readable output,
in Emacs as well as in the PDF output.

    (require 'org-colview)

    ;; Quick&dirty workaround to http://article.gmane.org/gmane.emacs.orgmode/25821: replace
    ;; asterisks with some other character in the table automatically built by org-colview, because
    ;; when the table is exported to LaTeX they are misinterpreted as emphasis markup, resulting in
    ;; an unreadable hierarchy.

    (defun esk/org-replace-section-prefix (s)
      "Replace asterisks in  Org heading with em-dashes."
      (when (string-match org-outline-regexp-bol s)
        (setq s (replace-match
                 (concat (make-string (- (match-end 0) (match-beginning 0) 1) ?—)
                         " ")
                 t t s)))
      s)

    (defun org-listtable-to-string (tbl)
      "Convert a listtable TBL to a string that contains the Org-mode table.
    The table still need to be aligned.  The resulting string has no leading
    and trailing newline characters."
      (mapconcat
       (lambda (x)
         (cond
          ((listp x)
           (concat "|" (esk/org-replace-section-prefix (mapconcat 'identity x "|")) "|"))
          ((eq x 'hline) "|-|")
          (t (error "Garbage in listtable: %s" x))))
       tbl "\n"))

Of course I'll be happy to hear about any better way to do it!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-22 18:45 ` Lele Gaifax
@ 2016-06-22 19:56   ` Nicolas Goaziou
  2016-06-22 20:16     ` Lele Gaifax
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-22 19:56 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Hello,

Lele Gaifax <lele@metapensiero.it> writes:

> I know this is an ancient thread, but it seems the problem is still there, in
> Emacs 25.

"org-colview" was rewritten recently. IIRC, this is fixed in development
version of Org.

Regards,

-- 
Nicolas Goaziou

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-22 19:56   ` Nicolas Goaziou
@ 2016-06-22 20:16     ` Lele Gaifax
  2016-06-22 20:46       ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Lele Gaifax @ 2016-06-22 20:16 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Lele Gaifax <lele@metapensiero.it> writes:
>
>> I know this is an ancient thread, but it seems the problem is still there, in
>> Emacs 25.
>
> "org-colview" was rewritten recently. IIRC, this is fixed in development
> version of Org.

Great, thank you!

Do you know if/when it will be merged into Emacs? I will probably try it out
on my own machine, but I guess a few coworkers won't be going to install it
from upstream repos...

bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-22 20:16     ` Lele Gaifax
@ 2016-06-22 20:46       ` Nicolas Goaziou
  2016-06-23  6:36         ` Lele Gaifax
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-22 20:46 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Hello,

Lele Gaifax <lele@metapensiero.it> writes:

> Do you know if/when it will be merged into Emacs?

I don't know, but that will not happen before Emacs 25.1 release.

Regards,

-- 
Nicolas Goaziou

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-22 20:46       ` Nicolas Goaziou
@ 2016-06-23  6:36         ` Lele Gaifax
  2016-06-24  9:38           ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Lele Gaifax @ 2016-06-23  6:36 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

>> Do you know if/when it will be merged into Emacs?
>
> I don't know, but that will not happen before Emacs 25.1 release.

Thanks anyway, I installed latest development sources and I appreciate the
work that has been done in this (and many other) areas: the new colview
produces a much nicer LaTeX!

One minor issue: previously I used a custom setting for the variable
`org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
03:10". With the version currently distributed with Emacs 25.1 it was used for
both the "effort" and "clocksum" columns, now only on the latter (matching
name and documentation). Is there an equivalent setting for the "effort"
sum, to get a table with the two columns sharing the same style? I tried to
look around in the sources and in the doc but I missed it...

BTW, in lisp/org-colview.el there is what seems a typo in the name of the
function `org-columns-hscoll-title`: since accordingly with "git grep" it is
referenced in two places and only in that source, is the following acceptable?

    diff --git a/lisp/org-colview.el b/lisp/org-colview.el
    index e29f88a..6809305 100644
    --- a/lisp/org-colview.el
    +++ b/lisp/org-colview.el
    @@ -438,9 +438,9 @@ for the duration of the command.")
               (org-add-props " " nil 'display '(space :align-to 0))
               (org-add-props (substring title 0 -1) nil 'face 'org-column-title)))
         (setq org-columns-previous-hscroll -1)
    -    (add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
    +    (add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local)))

    -(defun org-columns-hscoll-title ()
    +(defun org-columns-hscroll-title ()
       "Set the `header-line-format' so that it scrolls along with the table."
       (sit-for .0001) ; need to force a redisplay to update window-hscroll
       (when (not (= (window-hscroll) org-columns-previous-hscroll))
    @@ -463,7 +463,7 @@ for the duration of the command.")
           (when (local-variable-p 'org-previous-header-line-format)
            (setq header-line-format org-previous-header-line-format)
            (kill-local-variable 'org-previous-header-line-format)
    -       (remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
    +       (remove-hook 'post-command-hook 'org-columns-hscroll-title 'local))
           (move-marker org-columns-begin-marker nil)
           (move-marker org-columns-top-level-marker nil)
           (org-with-silent-modifications

Thanks a lot,
bye, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-23  6:36         ` Lele Gaifax
@ 2016-06-24  9:38           ` Nicolas Goaziou
  2016-06-24 12:08             ` Lele Gaifax
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-24  9:38 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Hello,

Lele Gaifax <lele@metapensiero.it> writes:

> One minor issue: previously I used a custom setting for the variable
> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
> 03:10". With the version currently distributed with Emacs 25.1 it was used for
> both the "effort" and "clocksum" columns, now only on the latter (matching
> name and documentation). Is there an equivalent setting for the "effort"
> sum, to get a table with the two columns sharing the same style?

I don't think so, but I may be wrong. Anyway, you can define your own
summary function (and formatter) in Org colums. See
`org-columns-summary-types' for details.

> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
> referenced in two places and only in that source, is the following
> acceptable?

Sure. Could you provide a proper commit message and send the patch using
"git format-patch" command? See
<http://orgmode.org/worg/org-contribute.html#patches> for details.

Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-24  9:38           ` Nicolas Goaziou
@ 2016-06-24 12:08             ` Lele Gaifax
  2016-06-24 12:26               ` [PATCH] org-colview.el: Fix typo in function name Lele Gaifax
  2016-06-24 12:47               ` latex-export + columnview: misinterpretation of section prefixes as emphasis Nicolas Goaziou
  0 siblings, 2 replies; 19+ messages in thread
From: Lele Gaifax @ 2016-06-24 12:08 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Lele Gaifax <lele@metapensiero.it> writes:
>
>> One minor issue: previously I used a custom setting for the variable
>> `org-time-clocksum-format`, to print something like "2gg 03:10" instead of "2d
>> 03:10". With the version currently distributed with Emacs 25.1 it was used for
>> both the "effort" and "clocksum" columns, now only on the latter (matching
>> name and documentation). Is there an equivalent setting for the "effort"
>> sum, to get a table with the two columns sharing the same style?
>
> I don't think so, but I may be wrong. Anyway, you can define your own
> summary function (and formatter) in Org colums. See
> `org-columns-summary-types' for details.

This is a simple file, made with the version of org-mode that comes from
current Emacs 25 branch:

    # -*- coding: utf-8 -*-
    #+TITLE: Test with Emacs 25.0.95 org-mode
    #+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

    * This is a test
      CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03

    #+BEGIN: columnview :hlines 1 :id global
    | Item             |   Effort | Work     |
    |------------------+----------+----------|
    | * This is a test | 1gg 6:00 | 3gg 0:03 |
    | ** Task A        |    10:00 |          |
    | ** Task B        |    10:00 |          |
    | ** Task C        |    10:00 |          |
    #+END:

    ** Task A
       :PROPERTIES:
       :Effort:   10:00
       :END:

    ** Task B
       :PROPERTIES:
       :Effort:   10:00
       :END:

    ** Task C
       :PROPERTIES:
       :Effort:   10:00
       :END:

    # Local Variables:
    # org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)
    # End:

This is the equivalent, made with current master development org-mode:

    # -*- coding: utf-8 -*-
    #+TITLE: Test with current master revision of org-mode
    #+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)

    * This is a test
      :LOGBOOK:
      CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
      :END:

    #+BEGIN: columnview :hlines 1 :id global
    | Item           | Effort | Work     |
    |----------------+--------+----------|
    | This is a test |  30:00 | 3gg 0:03 |
    | Task A         |  10:00 |          |
    | Task B         |  10:00 |          |
    | Task C         |  10:00 |          |
    #+END:

    ** Task A
       :PROPERTIES:
       :Effort:   10:00
       :END:

    ** Task B
       :PROPERTIES:
       :Effort:   10:00
       :END:

    ** Task C
       :PROPERTIES:
       :Effort:   10:00
       :END:

    # Local Variables:
    # org-time-clocksum-format: (:days "%dgg " :hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)
    # End:

Can you reproduce the case?

>> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
>> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
>> referenced in two places and only in that source, is the following
>> acceptable?
>
> Sure. Could you provide a proper commit message and send the patch using
> "git format-patch" command? See
> <http://orgmode.org/worg/org-contribute.html#patches> for details.

Sure, I will do that ASAP!

Thank you,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* [PATCH] org-colview.el: Fix typo in function name
  2016-06-24 12:08             ` Lele Gaifax
@ 2016-06-24 12:26               ` Lele Gaifax
  2016-06-24 12:49                 ` Nicolas Goaziou
  2016-06-24 12:47               ` latex-export + columnview: misinterpretation of section prefixes as emphasis Nicolas Goaziou
  1 sibling, 1 reply; 19+ messages in thread
From: Lele Gaifax @ 2016-06-24 12:26 UTC (permalink / raw)
  To: emacs-orgmode

>>> BTW, in lisp/org-colview.el there is what seems a typo in the name of the
>>> function `org-columns-hscoll-title`: since accordingly with "git grep" it is
>>> referenced in two places and only in that source, is the following
>>> acceptable?
>>
>> Sure. Could you provide a proper commit message and send the patch using
>> "git format-patch" command? See
>> <http://orgmode.org/worg/org-contribute.html#patches> for details.

Here it is!

From 7919e3ecb9362451a2f1f5e919e378dadadaf8de Mon Sep 17 00:00:00 2001
From: Lele Gaifax <lele@metapensiero.it>
Date: Fri, 24 Jun 2016 14:14:34 +0200
Subject: [PATCH] org-colview.el: Fix typo in function name

* lisp/org-colview.el (org-columns-hscroll-title): rename from
  `org-columns-hscoll-title'
(org-columns--display-here-title): adjust reference to renamed function
(org-columns-remove-overlays): likewise
---
 lisp/org-colview.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 864b221..d26f16a 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -438,9 +438,9 @@ for the duration of the command.")
 	   (org-add-props " " nil 'display '(space :align-to 0))
 	   (org-add-props (substring title 0 -1) nil 'face 'org-column-title)))
     (setq org-columns-previous-hscroll -1)
-    (add-hook 'post-command-hook 'org-columns-hscoll-title nil 'local)))
+    (add-hook 'post-command-hook 'org-columns-hscroll-title nil 'local)))
 
-(defun org-columns-hscoll-title ()
+(defun org-columns-hscroll-title ()
   "Set the `header-line-format' so that it scrolls along with the table."
   (sit-for .0001) ; need to force a redisplay to update window-hscroll
   (when (not (= (window-hscroll) org-columns-previous-hscroll))
@@ -463,7 +463,7 @@ for the duration of the command.")
       (when (local-variable-p 'org-previous-header-line-format)
 	(setq header-line-format org-previous-header-line-format)
 	(kill-local-variable 'org-previous-header-line-format)
-	(remove-hook 'post-command-hook 'org-columns-hscoll-title 'local))
+	(remove-hook 'post-command-hook 'org-columns-hscroll-title 'local))
       (move-marker org-columns-begin-marker nil)
       (move-marker org-columns-top-level-marker nil)
       (org-with-silent-modifications
-- 
2.8.1

Thank you,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-24 12:08             ` Lele Gaifax
  2016-06-24 12:26               ` [PATCH] org-colview.el: Fix typo in function name Lele Gaifax
@ 2016-06-24 12:47               ` Nicolas Goaziou
  2016-06-24 13:03                 ` Lele Gaifax
  1 sibling, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-24 12:47 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Lele Gaifax <lele@metapensiero.it> writes:

> This is the equivalent, made with current master development org-mode:
>
>     # -*- coding: utf-8 -*-
>
>     #+TITLE: Test with current master revision of org-mode
>     #+COLUMNS: %40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)
>
>
>     * This is a test
>       :LOGBOOK:
>       CLOCK: [2016-06-21 mar 13:40]--[2016-06-24 ven 13:43] => 72:03
>       :END:
>
>
>     #+BEGIN: columnview :hlines 1 :id global
>     | Item           | Effort | Work     |
>
>     |----------------+--------+----------|
>     | This is a test |  30:00 | 3gg 0:03 |
>     | Task A         |  10:00 |          |
>     | Task B         |  10:00 |          |
>     | Task C         |  10:00 |          |
>     #+END:
>
>     ** Task A
>        :PROPERTIES:
>        :Effort:   10:00
>        :END:
>
>     ** Task B
>        :PROPERTIES:
>        :Effort:   10:00
>        :END:
>
>     ** Task C
>        :PROPERTIES:
>        :Effort:   10:00
>        :END:

All your "Effort" values are expressed as HH:MM so Org does its best to
produce a HH:MM summary. If you write at least one value as a duration,
e.g., "10 h", the summary will also be expressed as a duration.


Regards,

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

* Re: [PATCH] org-colview.el: Fix typo in function name
  2016-06-24 12:26               ` [PATCH] org-colview.el: Fix typo in function name Lele Gaifax
@ 2016-06-24 12:49                 ` Nicolas Goaziou
  2016-06-24 13:06                   ` Lele Gaifax
  0 siblings, 1 reply; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-24 12:49 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Lele Gaifax <lele@metapensiero.it> writes:

> Here it is!

It looks good. Thank you.

> From 7919e3ecb9362451a2f1f5e919e378dadadaf8de Mon Sep 17 00:00:00 2001
> From: Lele Gaifax <lele@metapensiero.it>
> Date: Fri, 24 Jun 2016 14:14:34 +0200
> Subject: [PATCH] org-colview.el: Fix typo in function name
>
> * lisp/org-colview.el (org-columns-hscroll-title): rename from
>   `org-columns-hscoll-title'
> (org-columns--display-here-title): adjust reference to renamed function
> (org-columns-remove-overlays): likewise

I see you didn't add TINYCHANGE at the end of the commit message.
I assume you have signed FSF papers already. Am I correct?

Regards,

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

* Re: latex-export + columnview: misinterpretation of section prefixes as emphasis
  2016-06-24 12:47               ` latex-export + columnview: misinterpretation of section prefixes as emphasis Nicolas Goaziou
@ 2016-06-24 13:03                 ` Lele Gaifax
  0 siblings, 0 replies; 19+ messages in thread
From: Lele Gaifax @ 2016-06-24 13:03 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> All your "Effort" values are expressed as HH:MM so Org does its best to
> produce a HH:MM summary. If you write at least one value as a duration,
> e.g., "10 h", the summary will also be expressed as a duration.

I see, thank you!
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: [PATCH] org-colview.el: Fix typo in function name
  2016-06-24 12:49                 ` Nicolas Goaziou
@ 2016-06-24 13:06                   ` Lele Gaifax
  2016-06-24 14:01                     ` Nicolas Goaziou
  0 siblings, 1 reply; 19+ messages in thread
From: Lele Gaifax @ 2016-06-24 13:06 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> I see you didn't add TINYCHANGE at the end of the commit message.
> I assume you have signed FSF papers already. Am I correct?

Yes, sorry for not mentioning it explicitly.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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

* Re: [PATCH] org-colview.el: Fix typo in function name
  2016-06-24 13:06                   ` Lele Gaifax
@ 2016-06-24 14:01                     ` Nicolas Goaziou
  0 siblings, 0 replies; 19+ messages in thread
From: Nicolas Goaziou @ 2016-06-24 14:01 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Lele Gaifax <lele@metapensiero.it> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
>> I see you didn't add TINYCHANGE at the end of the commit message.
>> I assume you have signed FSF papers already. Am I correct?
>
> Yes, sorry for not mentioning it explicitly.

No problem. I just wanted to be sure. 

I applied your patch. Thank you again.

Regards,

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

end of thread, other threads:[~2016-06-24 14:01 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-31  3:38 latex-export + columnview: misinterpretation of section prefixes as emphasis Juan Pechiar
     [not found] ` <D96E521D-17DE-4725-AD9A-363522C9B1E9@tsdye.com>
     [not found]   ` <20100531130409.GE27574@soloJazz.com>
2010-05-31 16:57     ` Thomas S. Dye
2010-06-01  7:32 ` Carsten Dominik
2010-06-01 10:51   ` Tim Burt
2010-06-01 13:34     ` Carsten Dominik
2010-06-01 14:52       ` tcburt
2016-06-22 18:45 ` Lele Gaifax
2016-06-22 19:56   ` Nicolas Goaziou
2016-06-22 20:16     ` Lele Gaifax
2016-06-22 20:46       ` Nicolas Goaziou
2016-06-23  6:36         ` Lele Gaifax
2016-06-24  9:38           ` Nicolas Goaziou
2016-06-24 12:08             ` Lele Gaifax
2016-06-24 12:26               ` [PATCH] org-colview.el: Fix typo in function name Lele Gaifax
2016-06-24 12:49                 ` Nicolas Goaziou
2016-06-24 13:06                   ` Lele Gaifax
2016-06-24 14:01                     ` Nicolas Goaziou
2016-06-24 12:47               ` latex-export + columnview: misinterpretation of section prefixes as emphasis Nicolas Goaziou
2016-06-24 13:03                 ` Lele Gaifax

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