Re: [O] org-ref exports nicely to html but not to odt

2019-01-05 Thread Eric S Fraga
On Saturday,  5 Jan 2019 at 16:59, Uwe Brauer wrote:
> Thanks, right now I am struggling to install the pandoc-citeproc
> filter.

On Debian, it's its own package so easy but I do know that, at least in
the past, the version on Debian was quite significantly behind
upstream.  This may or may not matter to you, of course.
-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442



Re: [O] org-ref exports nicely to html but not to odt

2019-01-05 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > I use the following (attached) script to convert LaTeX files (usually
   > generated by org) to docx.  It sometimes works well, or at least well
   > enough for my uses.  Maybe you can adapt it to your needs.

Thanks, right now I am struggling to install the pandoc-citeproc filter.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-ref exports nicely to html but not to odt

2019-01-05 Thread Eric S Fraga
I use the following (attached) script to convert LaTeX files (usually
generated by org) to docx.  It sometimes works well, or at least well
enough for my uses.  Maybe you can adapt it to your needs.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.14-1035-gfeb442
#!/bin/sh -f
BASE=$(basename $1 .tex)
CSL="/home/ucecesf/synced/share/citation.styles/acm-siggraph.csl"
if [ -f default.csl ]; then
CSL="default.csl"
fi
echo "Converting " $BASE.tex " to " $BASE.docx " using bib style " $CSL
pandoc --bibliography=/home/ucecesf/synced/share/texmf/bibtex/bib/bibliography.bib --csl=${CSL} --filter pandoc-citeproc ${BASE}.tex -o ${BASE}.docx
#pandoc --bibliography=/home/ucecesf/share/texmf/bibtex/bib/papers.bib --csl=/home/ucecesf/synced/share/citation.styles/elsevier-with-titles.csl --filter pandoc-citeproc ${BASE}.tex -o ${BASE}.docx


Re: [O] org-ref exports nicely to html but not to odt

2019-01-05 Thread Uwe Brauer

   > I have used pandoc a little a while ago.   See
   > 
http://kitchingroup.cheme.cmu.edu/blog/2015/01/29/Export-org-mode-to-docx-with-citations-via-pandoc/

   > If you search pandoc on my blog you may find some more.

Thanks for pointing that out I did visit your blog. The resulting docx
does not contain hyperref links to the references, as far as I can see.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Uwe Brauer
>>> "Ken" == Ken Mankoff  writes:

   > On 2019-01-04 at 22:37 +0100, Uwe Brauer  wrote:
   >> I exported the org file in question to latex (I could also start
   >> directly with latex for that matter.)

   > Yes.

   >> Could I stick with bibtex?

   > Yes. No need to use biber + biblatex, you can stick with bibtex.

   > I only run that command because my massive 3000+ bib file contains
   > things that pandoc has trouble with (accents? Not sure). That command
   > extracts the bibtex entries used in the current document.

   > As I write this I realize this means you don't even need to compile
   > the PDF and/or run bibtex. If you have a TeX file and an appropriate
   > accompanying BiBTeX file, that should work.

   >> pandoc -f latex -t docx -o test.docx --bibliography 
/home/oub/texmf/bibtex/bib/bibgraf.bib  test.tex
   >> 
   >> /home/oub/texmf/bibtex/bib/bibgraf.bib is my main bibtex date base.
   >> 
   >> But this did not work pandoc gets frozen.
   >> 
   >> What do I miss.

   > I don't know. Try with a small bib file with 1 entry (and a TeX file
   > that only cites that one entry). Does that work? Then maybe your
   > bibgraf.bib has the same problem mine does (although I recall pandoc
   > issuing an error and crashing, not just freezing).


I tried that and it did not work neither, I might need to write the
pandoc list.


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Ken Mankoff


On 2019-01-04 at 22:37 +0100, Uwe Brauer  wrote:
> I exported the org file in question to latex (I could also start
> directly with latex for that matter.)

Yes.

> Could I stick with bibtex?

Yes. No need to use biber + biblatex, you can stick with bibtex.

I only run that command because my massive 3000+ bib file contains things that 
pandoc has trouble with (accents? Not sure). That command extracts the bibtex 
entries used in the current document.

As I write this I realize this means you don't even need to compile the PDF 
and/or run bibtex. If you have a TeX file and an appropriate accompanying 
BiBTeX file, that should work.

> pandoc -f latex -t docx -o test.docx --bibliography 
> /home/oub/texmf/bibtex/bib/bibgraf.bib  test.tex
>
> /home/oub/texmf/bibtex/bib/bibgraf.bib is my main bibtex date base.
>
> But this did not work pandoc gets frozen.
>
> What do I miss.

I don't know. Try with a small bib file with 1 entry (and a TeX file that only 
cites that one entry). Does that work? Then maybe your bibgraf.bib has the same 
problem mine does (although I recall pandoc issuing an error and crashing, not 
just freezing).

If this method works with a MWE, then the issue my be your full bib file. In 
this case you need to extract the entries used in this document (e.g. my 
method). Presumably this subset does not cause the pandoc issue. I also find 
extracting the entries useful for archiving a project.

You can extract entries as I showed, or "bibexport .aux" (requires a 
compiled PDF), or 
http://korrekt.org/page/Note:How_to_Extract_Used_Entries_From_BibTeX_Files or 
other methods...

  -k.



Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread John Kitchin
I have used pandoc a little a while ago.   See
http://kitchingroup.cheme.cmu.edu/blog/2015/01/29/Export-org-mode-to-docx-with-citations-via-pandoc/

If you search pandoc on my blog you may find some more.

On Fri, Jan 4, 2019 at 5:28 PM Uwe Brauer  wrote:

> >>> "Ken" == Ken Mankoff  writes:
>
>> On 2019-01-04 at 22:37 +0100, Uwe Brauer  wrote:
>>> I exported the org file in question to latex (I could also start
>>> directly with latex for that matter.)
>
>> Yes.
>
>>> Could I stick with bibtex?
>
>> Yes. No need to use biber + biblatex, you can stick with bibtex.
>
>> I only run that command because my massive 3000+ bib file contains
>> things that pandoc has trouble with (accents? Not sure). That command
>> extracts the bibtex entries used in the current document.
>
>> As I write this I realize this means you don't even need to compile
>> the PDF and/or run bibtex. If you have a TeX file and an appropriate
>> accompanying BiBTeX file, that should work.
>
>>> pandoc -f latex -t docx -o test.docx --bibliography
> /home/oub/texmf/bibtex/bib/bibgraf.bib  test.tex
>>>
>>> /home/oub/texmf/bibtex/bib/bibgraf.bib is my main bibtex date base.
>>>
>>> But this did not work pandoc gets frozen.
>>>
>>> What do I miss.
>
>> I don't know. Try with a small bib file with 1 entry (and a TeX file
>> that only cites that one entry). Does that work? Then maybe your
>> bibgraf.bib has the same problem mine does (although I recall pandoc
>> issuing an error and crashing, not just freezing).
>
>
> I tried that and it did not work neither, I might need to write the
> pandoc list.
>
-- 
John

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


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Uwe Brauer
>>> "Ken" == Ken Mankoff  writes:

   > On 2019-01-04 at 18:08 +0100, Uwe Brauer  wrote:
   >> When I export it to html, the bibliography comes out nice. When I
   >> export it to odt, the resulting odt files contains a lot of rubbish.
   >> 
   >> A kludge is to export it to html and then open it with LO/OO and copy
   >> it in an empty odt file, but is there any other solution?

   > I find the best ODT comes from LaTeX -> pandoc -> ODT. I have the
   > following section at the bottom of my default Org template
   > workbook.


That sounds very promising. But I am a bit confused.

I exported the org file in question to latex (I could also start
directly with latex for that matter.)

Now I can run without a problem bibtex on that file and several times
latex. But you propose to use biber which I have never used.

So when I run in the command line 
biber test.tex --output_format bibtex
INFO - This is Biber 2.4
INFO - Logfile is 'test.tex.blg'
ERROR - Cannot find control file 'test.tex.bcf'! - did you pass the 
"backend=biber" option to BibLaTeX?
INFO - ERRORS: 1


Could I stick with bibtex?

Now suppse I can then 
I tried 

pandoc -f latex -t docx -o test.docx --bibliography 
/home/oub/texmf/bibtex/bib/bibgraf.bib  test.tex

/home/oub/texmf/bibtex/bib/bibgraf.bib is my main bibtex date base.

But this did not work 
pandoc gets frozen.

What do I miss.

Thanks

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Ken Mankoff


On 2019-01-04 at 18:08 +0100, Uwe Brauer  wrote:
> When I export it to html, the bibliography comes out nice. When I
> export it to odt, the resulting odt files contains a lot of rubbish.
>
> A kludge is to export it to html and then open it with LO/OO and copy
> it in an empty odt file, but is there any other solution?

I find the best ODT comes from LaTeX -> pandoc -> ODT. I have the following 
section at the bottom of my default Org template workbook.

  -k.



* DOCX  :noexport:

Exporting to DOCX by using pandoc to convert the LaTeX export to DOCX seems to 
work much better than using Org directly. This means you need to export to 
LaTeX, properly compile the latex (to get the references correct), then run the 
BibTeX code block below 1x (and re-run each time you update any references), 
then run the Pandoc code block to convert the TeX file to DOCX.

** BibTeX   :noexport:
#+BEGIN_SRC sh :results verbatim :var fn=(file-name-sans-extension 
(buffer-name))
biber ${fn} --output_format bibtex
#+END_SRC
#+RESULTS:

** Pandoc
#+BEGIN_SRC sh :results verbatim :var fn=(file-name-sans-extension 
(buffer-name))
pandoc -f latex -t docx -o ${fn}.docx --bibliography ./${fn}_biber.bib ${fn}.tex
#+END_SRC
#+RESULTS:



Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread John Kitchin
It is identical to the html output, it just that odt doesn't render the
html tags. You can just customize that variable to get rid of the html
markers, and then it will look better. I don't know how to get bold/italics
in odt though.

John

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



On Fri, Jan 4, 2019 at 3:43 PM Uwe Brauer  wrote:

> >>> "John" == John Kitchin  writes:
>
>> Export to backends other than LaTeX have pretty limited support.
>> I assume by a lot of rubbish you mean there is a lot of html markers
> in
>> the bibliography.
>
> Right.
>
>> You can customize how these are formatted to some extent in the
>> variable: org-ref-bibliography-entry-format
>
>> This is not a citation preprocessor though, so it will not do things
>> like numbered references, or handle markup in the bibtex entries.
>
> I would be happy if the odt output were similar or identical to the
> html output.
>
>
>> You might check out https://github.com/andras-simonyi/citeproc-org,
> it
>> might have more capability along those lines.
>
> Thanks
>
>


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Uwe Brauer
>>> "John" == John Kitchin  writes:

   > Export to backends other than LaTeX have pretty limited support.
   > I assume by a lot of rubbish you mean there is a lot of html markers in
   > the bibliography.

Right.

   > You can customize how these are formatted to some extent in the
   > variable: org-ref-bibliography-entry-format

   > This is not a citation preprocessor though, so it will not do things
   > like numbered references, or handle markup in the bibtex entries.

I would be happy if the odt output were similar or identical to the
html output.


   > You might check out https://github.com/andras-simonyi/citeproc-org, it
   > might have more capability along those lines.

Thanks



smime.p7s
Description: S/MIME cryptographic signature


Re: [O] org-ref exports nicely to html but not to odt

2019-01-04 Thread John Kitchin
Export to backends other than LaTeX have pretty limited support.

I assume by a lot of rubbish you mean there is a lot of html markers in
the bibliography.

You can customize how these are formatted to some extent in the
variable: org-ref-bibliography-entry-format

This is not a citation preprocessor though, so it will not do things
like numbered references, or handle markup in the bibtex entries.

You might check out https://github.com/andras-simonyi/citeproc-org, it
might have more capability along those lines.

Uwe Brauer  writes:

> Hi
>
> Please look at the following example
>
> #+begin_example
> *  Bibliography
>
> citep:tao08:_global
>
> bibliographystyle:plain
> bibliography:test.bib
>
> #+end_example
>
> When I export it to html, the bibliography comes out nice.
> When I export it to odt, the resulting odt files contains a lot of
> rubbish.
>
> A kludge is to export it to html and then open it with LO/OO and copy
> it in an empty odt file, but is there any other solution?
>
> regards
>
> Uwe Brauer


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



[O] org-ref exports nicely to html but not to odt

2019-01-04 Thread Uwe Brauer
Hi

Please look at the following example 

#+begin_example
*  Bibliography

citep:tao08:_global

bibliographystyle:plain
bibliography:test.bib

#+end_example

When I export it to html, the bibliography comes out nice.
When I export it to odt, the resulting odt files contains a lot of
rubbish.

A kludge is to export it to html and then open it with LO/OO and copy
it in an empty odt file, but is there any other solution?

regards

Uwe Brauer

@Article{tao08:_global,
  author   = {Tao, Terence},
  fjournal = {Current Developments in Mathematics},
  journal  = {Current Developments in Mathematics},
  pages= {255-340},
  publisher= {International Press of Boston},
  title= {Global behaviour of nonlinear dispersive and wave
  equations},
  url  = {https://projecteuclid.org:443/euclid.cdm/1223654544},
  volume   = 2006,
  year = 2008
}