emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org export to latex tables, with hlines and |
@ 2016-03-09 14:40 Uwe Brauer
  2016-03-10  9:28 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2016-03-09 14:40 UTC (permalink / raw)
  To: emacs-orgmode


Hi

When I use
orgtab radio tables in latex files with orgtbl minor mode enabled
the following template



 '(orgtbl-radio-table-templates
   (quote
    ((latex-mode "% BEGIN RECEIVE ORGTBL %n
% END RECEIVE ORGTBL %n
\\begin{comment}
#+ORGTBL: SEND %n orgtbl-to-latex  :lend \"\\\\\\\\ \\\\hline\" :environment tabular
|/|<>|
| |  |
\\end{comment}
")


Does precisely what I want. Now I want the same behavior if I edit a
table in a org buffer and export it to latex.

Which variable needs to be set and how?

thanks

Uwe Brauer 

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

* Re: org export to latex tables, with hlines and |
  2016-03-09 14:40 org export to latex tables, with hlines and | Uwe Brauer
@ 2016-03-10  9:28 ` Nicolas Goaziou
  2016-03-10 13:51   ` Uwe Brauer
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2016-03-10  9:28 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Uwe Brauer <oub@mat.ucm.es> writes:

> When I use
> orgtab radio tables in latex files with orgtbl minor mode enabled
> the following template
>
>
>
>  '(orgtbl-radio-table-templates
>    (quote
>     ((latex-mode "% BEGIN RECEIVE ORGTBL %n
> % END RECEIVE ORGTBL %n
> \\begin{comment}
> #+ORGTBL: SEND %n orgtbl-to-latex  :lend \"\\\\\\\\ \\\\hline\" :environment tabular
> |/|<>|
> | |  |
> \\end{comment}
> ")
>
>
> Does precisely what I want. Now I want the same behavior if I edit a
> table in a org buffer and export it to latex.
>
> Which variable needs to be set and how?

IIUC you want to put a rule after every row in the table? If that's the
case, the straightforward way to do it is to explicitly put the rule in
your table:

  |/|<>|
  | |  |
  |-+--|

Otherwise you can use a filter, e.g.,
`org-export-filter-table-row-functions' and append "\\hine" there in
LaTeX-related back-ends.

Regards,

-- 
Nicolas Goaziou

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

* Re: org export to latex tables, with hlines and |
  2016-03-10  9:28 ` Nicolas Goaziou
@ 2016-03-10 13:51   ` Uwe Brauer
  2016-03-10 15:29   ` Uwe Brauer
  2016-03-10 16:04   ` Uwe Brauer
  2 siblings, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2016-03-10 13:51 UTC (permalink / raw)
  To: emacs-orgmode


    > Hello,
    > Uwe Brauer <oub@mat.ucm.es> writes:


    > IIUC you want to put a rule after every row in the table? If that's the
    > case, the straightforward way to do it is to explicitly put the rule in
    > your table:

    >   |/|<>|
    >   | |  |
    >   |-+--|

Thanks, right, but then I have to insert a hline for every line.

    > Otherwise you can use a filter, e.g.,
    > `org-export-filter-table-row-functions' and append "\\hine" there in
    > LaTeX-related back-ends.

That is more what I am looking for. But

org-export-filter-table-row-functions is nil.

So what do I have to set it to?

BTW I just realized that I wanted a similar functionality for the HTML
export, and in org version 7.8, this was controlled by


 '(org-export-html-table-tag
   "<table border=\"2\" cellspacing=\"0\" cellpadding=\"6\" rules=\"all\" frame=\"border\">")


But this variable does not exist any more so the same question arises
how can I obtain that behavior for html export?

Thanks

Uwe Brauer 

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

* Re: org export to latex tables, with hlines and |
  2016-03-10  9:28 ` Nicolas Goaziou
  2016-03-10 13:51   ` Uwe Brauer
@ 2016-03-10 15:29   ` Uwe Brauer
  2016-03-10 16:04   ` Uwe Brauer
  2 siblings, 0 replies; 6+ messages in thread
From: Uwe Brauer @ 2016-03-10 15:29 UTC (permalink / raw)
  To: emacs-orgmode


   > Hello,
   > Uwe Brauer <oub@mat.ucm.es> writes:


   > IIUC you want to put a rule after every row in the table? If that's the
   > case, the straightforward way to do it is to explicitly put the rule in
   > your table:

   >   |/|<>|
   >   | |  |
   >   |-+--|

   > Otherwise you can use a filter, e.g.,
   > `org-export-filter-table-row-functions' and append "\\hine" there in
   > LaTeX-related back-ends.


Hm it seems that the following works for html support



| <>   | <>   |
| this | that |
|      |      |
#+ATTR_HTML: border="2" rules="all" frame="border"


But unfortunately this


| \ | <>   | <>   | <> |
|   | this | that |    |
|   |      |      |    |
#+ATTR_LATEX: :environment tabular :lend "\\\\ \\hline"


Does not work.

Uwe Brauer 

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

* Re: org export to latex tables, with hlines and |
  2016-03-10  9:28 ` Nicolas Goaziou
  2016-03-10 13:51   ` Uwe Brauer
  2016-03-10 15:29   ` Uwe Brauer
@ 2016-03-10 16:04   ` Uwe Brauer
  2016-03-10 20:03     ` Nicolas Goaziou
  2 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2016-03-10 16:04 UTC (permalink / raw)
  To: emacs-orgmode


   > Hello,
   > Uwe Brauer <oub@mat.ucm.es> writes:


   > IIUC you want to put a rule after every row in the table? If that's the
   > case, the straightforward way to do it is to explicitly put the rule in
   > your table:

   >   |/|<>|
   >   | |  |
   >   |-+--|

   > Otherwise you can use a filter, e.g.,
   > `org-export-filter-table-row-functions' and append "\\hine" there in
   > LaTeX-related back-ends.

I got this to work:


(defun my-latex-insert-hline-always (row backend info)
       "Add a hline to every row when exporting to  LaTeX."
       (when (org-export-derived-backend-p backend 'latex)
	 (replace-regexp-in-string "\\\\\\\\" "\\\\\\\\ \\\\hline" row)))

(add-to-list 'org-export-filter-table-row-functions 'my-latex-insert-hline-always)


Is this what you meant?

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

* Re: org export to latex tables, with hlines and |
  2016-03-10 16:04   ` Uwe Brauer
@ 2016-03-10 20:03     ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2016-03-10 20:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Uwe Brauer <oub@mat.ucm.es> writes:

>    > Hello,
>    > Uwe Brauer <oub@mat.ucm.es> writes:
>
>
>    > IIUC you want to put a rule after every row in the table? If that's the
>    > case, the straightforward way to do it is to explicitly put the rule in
>    > your table:
>
>    >   |/|<>|
>    >   | |  |
>    >   |-+--|
>
>    > Otherwise you can use a filter, e.g.,
>    > `org-export-filter-table-row-functions' and append "\\hine" there in
>    > LaTeX-related back-ends.
>
> I got this to work:
>
>
> (defun my-latex-insert-hline-always (row backend info)
>        "Add a hline to every row when exporting to  LaTeX."
>        (when (org-export-derived-backend-p backend 'latex)
> 	 (replace-regexp-in-string "\\\\\\\\" "\\\\\\\\ \\\\hline" row)))
>
> (add-to-list 'org-export-filter-table-row-functions 'my-latex-insert-hline-always)
>
>
> Is this what you meant?

Something like that, yes.

Regards, 

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2016-03-10 20:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-09 14:40 org export to latex tables, with hlines and | Uwe Brauer
2016-03-10  9:28 ` Nicolas Goaziou
2016-03-10 13:51   ` Uwe Brauer
2016-03-10 15:29   ` Uwe Brauer
2016-03-10 16:04   ` Uwe Brauer
2016-03-10 20:03     ` Nicolas Goaziou

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