emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-table export to ods/xlsx etc
@ 2017-06-16 10:25 Uwe Brauer
  0 siblings, 0 replies; 14+ messages in thread
From: Uwe Brauer @ 2017-06-16 10:25 UTC (permalink / raw)
  To: emacs-orgmode

Hi

I am sometimes in need to send my org-table spreadhseets to colleagues
who are using (sigh) excel. I thought sending csv would be enough but it
turns out, 

    -  that sometimes technical inapt people don't know how to open it,

    -  when using a non english language setting say spanish, numbers
       like 3.4 are interpreted as text.

That can be circumvented by sending the spreadheet as ods/xlsx

I did not find any built in function so I came up with two solutions.
One is using gnumeric but then a path must be set to its binaries and
that is platform dependent. The other relies on `org-odt-convert' which
uses in my case LO/OO.

Somebody with better lisp skills might want to generalize the function
to include in a more comfortable way other formats

(defun org-table-export-to-xlsx () 
  (interactive)
  (let* ((source-file  (file-name-sans-extension (buffer-file-name (current-buffer))))
         (csv-file (concat source-file ".csv")))
    (org-table-export csv-file "orgtbl-to-csv")
    (org-odt-convert csv-file "xlsx")))

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

* Re: org-table export to ods/xlsx etc
       [not found] <eca7bd11a4eb4d3bbb600d77484d4449@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-16 15:25 ` Eric S Fraga
  2017-06-17 14:54   ` Nicolas Goaziou
                     ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Eric S Fraga @ 2017-06-16 15:25 UTC (permalink / raw)
  To: emacs-orgmode

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

On Friday, 16 Jun 2017 at 10:25, Uwe Brauer wrote:
> Hi
>
> I am sometimes in need to send my org-table spreadhseets to colleagues
> who are using (sigh) excel. I thought sending csv would be enough but it
> turns out, 

[...]

> I did not find any built in function so I came up with two solutions.
> One is using gnumeric but then a path must be set to its binaries and
> that is platform dependent. The other relies on `org-odt-convert' which
> uses in my case LO/OO.

Thanks for this.  Works nicely!  Great addition to the repertoire of
useful emacs-lisp snippets.  Would be great to have this incorporated
into org.

If gnumeric (ssconvert) can be an option, that would be great as well.

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.7-531-g530113

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: org-table export to ods/xlsx etc
       [not found] <mailman.87.1497628817.13493.emacs-orgmode@gnu.org>
@ 2017-06-17  1:41 ` edgar
  2017-06-17  2:25 ` Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style) edgar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: edgar @ 2017-06-17  1:41 UTC (permalink / raw)
  To: oub; +Cc: emacs-orgmode

> Message: 19
> Date: Fri, 16 Jun 2017 10:25:55 +0000
> From: Uwe Brauer <oub@mat.ucm.es>
> To: emacs-orgmode@gnu.org
> Subject: [O] org-table export to ods/xlsx etc
> Message-ID: <87fuf0i5zg.fsf@mat.ucm.es>
> Content-Type: text/plain
> 
> I am sometimes in need to send my org-table spreadhseets to colleagues
> who are using (sigh) excel. I thought sending csv would be enough but 
> it
> turns out,
I want to join you in that *deep* sigh! and thank you for your 
contribution. I may eventually have to use it.

> (defun org-table-export-to-xlsx ()
>   (interactive)
>   (let* ((source-file  (file-name-sans-extension (buffer-file-name
> (current-buffer))))
>          (csv-file (concat source-file ".csv")))
>     (org-table-export csv-file "orgtbl-to-csv")
>     (org-odt-convert csv-file "xlsx")))

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

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

* Re: Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style)
       [not found] <mailman.87.1497628817.13493.emacs-orgmode@gnu.org>
  2017-06-17  1:41 ` org-table export to ods/xlsx etc edgar
@ 2017-06-17  2:25 ` edgar
  2017-06-18 20:38   ` John Kitchin
  2017-06-17  2:34 ` How to export LaTeX amsmath align bmatrix to ODT? edgar
       [not found] ` <540c9e41077e41ed940a64e1caaebb3f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  3 siblings, 1 reply; 14+ messages in thread
From: edgar @ 2017-06-17  2:25 UTC (permalink / raw)
  To: emacs-orgmode

Hello Lars,

I am a beginner with Emacs, so my advice may not be very good. I assume 
that you are using org-ref (I missed part of the conversation). I have 
no problems with PDF and References (well, except that I don't know how 
to set an independent headline. I know this is not clear, but I won't 
hijack your post).

> If I want HTML export with citations, I need to use
> `bibliography:ref.bib' at the end, where I want the list of
> references. However, when exporting to pdf, it works only if I have
> \printbibliography at the end. If I use bibliograph:ref.bib, I get the

In my Org file, I have this at the end:

    bibliographystyle:unsrt
    bibliography:../References.bib

  I have no #+LATEX_HEADER, but I tried this with a clean Emacs (emacs 
-Q; you may need to evaluate line by line), and it works for me:

my_file.org
=================================
#+BEGIN_SRC emacs-lisp
   (require 'package)
   (package-initialize)
   (require 'org)
   (require 'org-ref)
   (require 'ox-latex)

   (setq org-latex-pdf-process
	    '("pdflatex -interaction nonstopmode -output-directory %o %f"
	      "bibtex %b"
	      "pdflatex -interaction nonstopmode -output-directory %o %f"
	      "pdflatex -interaction nonstopmode -output-directory %o %f"))
#+END_SRC

* My first section
   According to cite:SmartGuy17, this should work!

* I want this to say "References"
   I don't need this to say References again:
   bibliographystyle:unsrt
   bibliography:References.bib
=================================

References.bib
=================================
@article{SmartGuy17,
   author =       {A. Smart and Handsome Guy},
   title =        {Enjoying Emacs and Org-mode},
   journal =      {Hacking Accounts of Freedom},
   volume =       {2},
   number =       {4},
   pages =        {1858-1894},
   year =         {2017},
}
=================================

I hope that this helps :) . Good hacking!

Org mode version 9.0.7
GNU Emacs 24.4.1
org-ref: Version 0.9.0

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

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

* Re: How to export LaTeX amsmath align bmatrix to ODT?
       [not found] <mailman.87.1497628817.13493.emacs-orgmode@gnu.org>
  2017-06-17  1:41 ` org-table export to ods/xlsx etc edgar
  2017-06-17  2:25 ` Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style) edgar
@ 2017-06-17  2:34 ` edgar
       [not found] ` <540c9e41077e41ed940a64e1caaebb3f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  3 siblings, 0 replies; 14+ messages in thread
From: edgar @ 2017-06-17  2:34 UTC (permalink / raw)
  To: emacs-orgmode

> Check out org-format-latex-options.  I have, for the same or similar 
> scenario:
> 
> #+begin_src emacs-lisp
>   (setq org-format-latex-options
>         '(:foreground "white" :background "black" :scale 3
>                       :html-foreground "Black" :html-background 
> "Transparent"
>                       :html-scale 1.0
>                       :matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
> #+end_src

Thanks, Eric. Unfortunately, that did not work. It does change the 
background and foreground colors, but the \tensor symbol is now 
"invisible" (it is black, and the background is also black). The rest of 
the equation looks fine.

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

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

* Re: org-table export to ods/xlsx etc
  2017-06-16 15:25 ` org-table export to ods/xlsx etc Eric S Fraga
@ 2017-06-17 14:54   ` Nicolas Goaziou
  2017-06-21 13:01     ` Uwe Brauer
       [not found]     ` <4e6e65e9ba354c9a8dab18796c1e92dc@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
       [not found]   ` <a7f661839cd64e268ffe1ccbeb208777@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  2017-06-17 16:38   ` Uwe Brauer
  2 siblings, 2 replies; 14+ messages in thread
From: Nicolas Goaziou @ 2017-06-17 14:54 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> On Friday, 16 Jun 2017 at 10:25, Uwe Brauer wrote:
>> Hi
>>
>> I am sometimes in need to send my org-table spreadhseets to colleagues
>> who are using (sigh) excel. I thought sending csv would be enough but it
>> turns out, 
>
> [...]
>
>> I did not find any built in function so I came up with two solutions.
>> One is using gnumeric but then a path must be set to its binaries and
>> that is platform dependent. The other relies on `org-odt-convert' which
>> uses in my case LO/OO.
>
> Thanks for this.  Works nicely!  Great addition to the repertoire of
> useful emacs-lisp snippets.  Would be great to have this incorporated
> into org.

According to `org-odt-convert-processes', `org-odt-convert-capabilities'
and `org-odt-convert', isn't it already possible?

Regards,

-- 
Nicolas Goaziou

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

* Re: org-table export to ods/xlsx etc
       [not found]   ` <a7f661839cd64e268ffe1ccbeb208777@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-17 15:50     ` Eric S Fraga
  0 siblings, 0 replies; 14+ messages in thread
From: Eric S Fraga @ 2017-06-17 15:50 UTC (permalink / raw)
  To: emacs-orgmode

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

On Saturday, 17 Jun 2017 at 14:54, Nicolas Goaziou wrote:

[...]

> According to `org-odt-convert-processes', `org-odt-convert-capabilities'
> and `org-odt-convert', isn't it already possible?

Indeed.  <blush>  Adding this

  (add-to-list 'org-odt-convert-processes '("gnumeric" "ssconvert %i %o"))
  (setq org-odt-convert-process "gnumeric")

is all that is needed.  As always, why am I surprised? :-)

Thanks.

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.6-425-gf4fca1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: How to export LaTeX amsmath align bmatrix to ODT?
       [not found] ` <540c9e41077e41ed940a64e1caaebb3f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-17 15:56   ` Eric S Fraga
  0 siblings, 0 replies; 14+ messages in thread
From: Eric S Fraga @ 2017-06-17 15:56 UTC (permalink / raw)
  To: emacs-orgmode

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

On Saturday, 17 Jun 2017 at 02:34, edgar@openmail.cc wrote:

[...]

> Thanks, Eric. Unfortunately, that did not work. It does change the 
> background and foreground colors, but the \tensor symbol is now 
> "invisible" (it is black, and the background is also black). The rest of 
> the equation looks fine.

Strange.  Maybe post an ECM for others to experiment with?
-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.6-425-gf4fca1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: org-table export to ods/xlsx etc
  2017-06-16 15:25 ` org-table export to ods/xlsx etc Eric S Fraga
  2017-06-17 14:54   ` Nicolas Goaziou
       [not found]   ` <a7f661839cd64e268ffe1ccbeb208777@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-17 16:38   ` Uwe Brauer
  2 siblings, 0 replies; 14+ messages in thread
From: Uwe Brauer @ 2017-06-17 16:38 UTC (permalink / raw)
  To: emacs-orgmode


   > On Friday, 16 Jun 2017 at 10:25, Uwe Brauer wrote:

   > [...]


   > Thanks for this.  Works nicely!  Great addition to the repertoire of
   > useful emacs-lisp snippets.  Would be great to have this incorporated
   > into org.

Maybe this is even more useful?

(defun org-table-export-to-spreadsheet (arg) 
  "Export org table to varios first to cvs and then via LO/OO (or gnumeric)
to various  spreadsheet  format, the most common are `ods', `xls' and 
`xlsx'."
  (interactive "sFormat: ")
  (let* ((source-file  (file-name-sans-extension (buffer-file-name (current-buffer))))
         (csv-file (concat source-file ".csv")))
    (org-table-export csv-file "orgtbl-to-csv")
    (org-odt-convert csv-file arg)))


   > If gnumeric (ssconvert) can be an option, that would be great as well.

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

* Re: Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style)
  2017-06-17  2:25 ` Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style) edgar
@ 2017-06-18 20:38   ` John Kitchin
  2017-06-21 19:54     ` edgar
  0 siblings, 1 reply; 14+ messages in thread
From: John Kitchin @ 2017-06-18 20:38 UTC (permalink / raw)
  To: edgar; +Cc: emacs-orgmode

Try this to get the heading you want. It seems to work for me.

# https://tex.stackexchange.com/questions/17445/how-can-i-change-the-references-to-reference-in-the-thebibliography-environm
# This makes the bibliography section title empty and un-numbered
#+latex: \renewcommand{\bibsection}{\subsection*{}}

* References
bibliographystyle:unsrt
bibliography:References.bib

>
> * I want this to say "References"
>    I don't need this to say References again:
>    bibliographystyle:unsrt
>    bibliography:References.bib
> =================================
>
> References.bib
> =================================
> @article{SmartGuy17,
>    author =       {A. Smart and Handsome Guy},
>    title =        {Enjoying Emacs and Org-mode},
>    journal =      {Hacking Accounts of Freedom},
>    volume =       {2},
>    number =       {4},
>    pages =        {1858-1894},
>    year =         {2017},
> }
> =================================
>
> I hope that this helps :) . Good hacking!
>
> Org mode version 9.0.7
> GNU Emacs 24.4.1
> org-ref: Version 0.9.0
>
> -------------------------------------------------
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!
> 15GB disk! No bandwidth quotas!
> Commercial and Bulk Mail Options!


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

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

* Re: org-table export to ods/xlsx etc
  2017-06-17 14:54   ` Nicolas Goaziou
@ 2017-06-21 13:01     ` Uwe Brauer
       [not found]     ` <4e6e65e9ba354c9a8dab18796c1e92dc@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
  1 sibling, 0 replies; 14+ messages in thread
From: Uwe Brauer @ 2017-06-21 13:01 UTC (permalink / raw)
  To: emacs-orgmode


   > Hello,
   > Eric S Fraga <e.fraga@ucl.ac.uk> writes:


   > According to `org-odt-convert-processes', `org-odt-convert-capabilities'
   > and `org-odt-convert', isn't it already possible?


Hm I set

(add-to-list 'org-odt-convert-processes '("gnumeric" "ssconvert %i %o"))
(setq org-odt-convert-process "gnumeric")

But then my function returns

Debugger entered--Lisp error: (error "Cannot convert from csv format to xlsx format?")
  signal(error ("Cannot convert from csv format to xlsx format?"))
  error("Cannot convert from %s format to %s format?" "csv" "xlsx")
  org-odt-do-convert("/home/oub/ALLES/tex/vorlesungen/HG/HGQuim-Num-Estad/Notas/Notas2017/Controles/Rosa/rosa4.csv" "xlsx" nil)
  org-odt-convert("/home/oub/ALLES/tex/vorlesungen/HG/HGQuim-Num-Estad/Notas/Notas2017/Controles/Rosa/rosa4.csv" "xlsx")
  org-export-to-xlsx()
  funcall-interactively(org-export-to-xlsx)
  call-interactively(org-export-to-xlsx nil nil)
  command-execute(org-export-to-xlsx)

   > Regards,

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

* Re: org-table export to ods/xlsx etc
       [not found]     ` <4e6e65e9ba354c9a8dab18796c1e92dc@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
@ 2017-06-21 13:43       ` Eric S Fraga
  2017-06-22  6:57         ` Uwe Brauer
  0 siblings, 1 reply; 14+ messages in thread
From: Eric S Fraga @ 2017-06-21 13:43 UTC (permalink / raw)
  To: emacs-orgmode

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

On Wednesday, 21 Jun 2017 at 13:01, Uwe Brauer wrote:
> Debugger entered--Lisp error: (error "Cannot convert from csv format
> to xlsx format?")

What does (org-odt-do-reachable-formats "csv") return?

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.8-582-g15c9e9

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

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

* Re: Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style)
  2017-06-18 20:38   ` John Kitchin
@ 2017-06-21 19:54     ` edgar
  0 siblings, 0 replies; 14+ messages in thread
From: edgar @ 2017-06-21 19:54 UTC (permalink / raw)
  To: John Kitchin; +Cc: John Kitchin, emacs-orgmode

On 2017-06-18 20:38, John Kitchin wrote:
> https://tex.stackexchange.com/questions/17445/how-can-i-change-the-references-to-reference-in-the-thebibliography-environm
> # This makes the bibliography section title empty and un-numbered
> #+latex: \renewcommand{\bibsection}{\subsection*{}}
> 
> * References
> bibliographystyle:unsrt
> bibliography:References.bib
> 
Thanks, I solved it by switching to BibLaTeX, as described in M-x 
org-ref-help :)



-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

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

* Re: org-table export to ods/xlsx etc
  2017-06-21 13:43       ` Eric S Fraga
@ 2017-06-22  6:57         ` Uwe Brauer
  0 siblings, 0 replies; 14+ messages in thread
From: Uwe Brauer @ 2017-06-22  6:57 UTC (permalink / raw)
  To: emacs-orgmode

>>> "Eric" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:

   > On Wednesday, 21 Jun 2017 at 13:01, Uwe Brauer wrote:
   >> Debugger entered--Lisp error: (error "Cannot convert from csv format
   >> to xlsx format?")

   > What does (org-odt-do-reachable-formats "csv") return?
Ha thanks

I had to set

(add-to-list 'org-odt-convert-processes '("gnumeric" "/usr/bin/ssconvert %i %o"))

Otherwise ssconvert was not found.
I reported the misbehavior of LO/OO concerning the coding in the
relevant list. Maybe it is a bug.

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

end of thread, other threads:[~2017-06-22  7:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.87.1497628817.13493.emacs-orgmode@gnu.org>
2017-06-17  1:41 ` org-table export to ods/xlsx etc edgar
2017-06-17  2:25 ` Bibliograph:ref.bib vs. \printbibliograpy (WAS: Re: > Citations with org-ref in apa style) edgar
2017-06-18 20:38   ` John Kitchin
2017-06-21 19:54     ` edgar
2017-06-17  2:34 ` How to export LaTeX amsmath align bmatrix to ODT? edgar
     [not found] ` <540c9e41077e41ed940a64e1caaebb3f@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-17 15:56   ` Eric S Fraga
     [not found] <eca7bd11a4eb4d3bbb600d77484d4449@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-16 15:25 ` org-table export to ods/xlsx etc Eric S Fraga
2017-06-17 14:54   ` Nicolas Goaziou
2017-06-21 13:01     ` Uwe Brauer
     [not found]     ` <4e6e65e9ba354c9a8dab18796c1e92dc@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-21 13:43       ` Eric S Fraga
2017-06-22  6:57         ` Uwe Brauer
     [not found]   ` <a7f661839cd64e268ffe1ccbeb208777@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-06-17 15:50     ` Eric S Fraga
2017-06-17 16:38   ` Uwe Brauer
2017-06-16 10:25 Uwe Brauer

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