emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: [BUG] [new exporter] \cite and \ref in odt export
Date: Mon, 18 Jun 2012 09:55:34 +0200	[thread overview]
Message-ID: <87bokhawax.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: 4FDEDBE9.5020703@christianmoe.com

Hi Christian,

> On 6/18/12 9:41 AM, Christian Moe wrote:
>> Hi again,
>>
>> I'm sorry, I'm not looking into it as such -- I haven't had time to
>> catch up with the new exporter goodies. I was just wondering if Org or
>> ODT had suddenly developed any built-in bibtex formatting capabilities
>> I wasn't aware of. :-)
>>
>> But if you want to test-pilot my clumsy first stab at getting bibtex
>> bibliographies from Org into ODT and other non-latex backends, I'd
>> value your feedback, and would hope to find the time somewhere down
>> the line to improve it.
>>
>> http://lists.gnu.org/archive/html/emacs-orgmode/2012-01/msg00128.html

I had read that and wanted to take a look, but completely forgot about
it...

I have used org-bibtex already
successfully in the past.  And it still is enabled in my config, which
might add to/be the cause of the error here.

Thanks for reminding me on org-cite.  I'll try to remember to take a
look this time.  But this will have to wait until the end of next week.

Regards,
Andreas

>>
>> I've found Zotero -> Org -> ODT a more rewarding route, but Zotero's
>> indifference to citekeys makes it difficult to adapt that to existing
>> documents with bibtex cites.
>>
>> Yours,
>> Christian
>>
>>
>> On 6/18/12 8:59 AM, Andreas Leha wrote:
>>> Hi Christian,
>>>
>>> thanks for looking into this.
>>>
>>>> Could you say what behavior you expect when exporting \cite commands
>>>> to ODT?
>>>
>>> I would say:
>>> Minimal expectation: error-free export
>>> Maximal expectation: LaTeX-like reference ;-)
>>> Realistic expectation: literal export (e.g. \cite{xxx}) as in the
>>> ascii export
>>>
>>> Regards,
>>> Andreas
>>>
>>>
>>>>
>>>> Yours,
>>>> Christian
>>>>
>>>> On 6/17/12 10:57 PM, Andreas Leha wrote:
>>>>> Hi all,
>>>>>
>>>>> I experience problems when using \ref and \cite in documents, and
>>>>> then
>>>>> exporting to odt.
>>>>>
>>>>> I can replace the \ref{uuu} with [[uuu]] (breaking compatibility with
>>>>> the legacy exporter), but how would I replace \cite?
>>>>>
>>>>> My only 'solution' momentarily is to export with #+OPTIONS: LaTeX:nil
>>>>>
>>>>>
>>>>> I guess this is a bug?
>>>>>
>>>>> Regards,
>>>>> Andreas
>>>>>
>>>>> PS:
>>>>> Here follows an example:
>>>>>
>>>>> Use this bib-file:
>>>>>
>>>>> ,----[ literature.bib ]
>>>>> | @article{schulte:2012,
>>>>> | author = "Eric Schulte and Dan Davison and Thomas Dye and
>>>>> | Carsten Dominik",
>>>>> | title = "A Multi-Language Computing Environment for Literate
>>>>> | Programming and Reproducible Research",
>>>>> | journal = "Journal of Statistical Software",
>>>>> | volume = "46",
>>>>> | number = "3",
>>>>> | pages = "1--24",
>>>>> | day = "25",
>>>>> | month = "1",
>>>>> | year = "2012",
>>>>> | CODEN = "JSSOBK",
>>>>> | ISSN = "1548-7660",
>>>>> | bibdate = "2011-10-03",
>>>>> | URL = "http://www.jstatsoft.org/v46/i03",
>>>>> | accepted = "2011-10-03",
>>>>> | acknowledgement ="",
>>>>> | keywords = "",
>>>>> | submitted = "2010-12-22",
>>>>> | }
>>>>> `----
>>>>>
>>>>> When I try to export this file to odt:
>>>>>
>>>>> ,----
>>>>> | #+TITLE: Citations in non-LaTeX
>>>>> |
>>>>> |
>>>>> | * Related Work...
>>>>> | can be found in \cite{schulte:2012}.
>>>>> |
>>>>> |
>>>>> |
>>>>> | #+LATEX_HEADER:
>>>>> \usepackage[natbib,backref,backend=bibtex,style=authoryear,isbn=false,url=false,eprint=false]{biblatex}
>>>>>
>>>>> | #+LATEX_HEADER: \bibliography{literature}
>>>>> | #+LATEX_HEADER: \setlength{\bibhang}{1em}
>>>>> | #+LATEX_HEADER: \usepackage{hyperref}
>>>>> `----
>>>>>
>>>>> I get this backtrace:
>>>>>
>>>>> ,----
>>>>> | Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>>>> | expand-file-name(nil "/home/andreas/org/")
>>>>> | (let* ((src-file (expand-file-name path (file-name-directory
>>>>> | org-current-export-file))) (target-dir (format "Formula-%04d/"
>>>>> | (incf org-e-odt-embedded-formulas-count))) (target-file (concat
>>>>> | target-dir "content.xml"))) (message "Embedding %s as %s ..."
>>>>> | (substring-no-properties path) target-file) (make-directory
>>>>> | target-dir) (org-e-odt-create-manifest-file-entry
>>>>> | "application/vnd.oasis.opendocument.formula" target-dir "1.2")
>>>>> | (case (org-e-odt-is-formula-link-p src-file) (mathml (copy-file
>>>>> | src-file target-file (quote overwrite))) (odf
>>>>> | (org-e-odt-zip-extract-one src-file "content.xml" target-dir)) (t
>>>>> | (error "%s is not a formula file" src-file)))
>>>>> | (org-e-odt-create-manifest-file-entry "text/xml" target-file)
>>>>> | target-file)
>>>>> | org-e-odt-copy-formula-file(nil)
>>>>> | (file-name-directory (org-e-odt-copy-formula-file src))
>>>>> | (org-e-odt-format-tags "<draw:object xlink:href=\"%s\"
>>>>> | xlink:type=\"simple\" xlink:show=\"embed\"
>>>>> | xlink:actuate=\"onLoad\"/>" "" (file-name-directory
>>>>> | (org-e-odt-copy-formula-file src)))
>>>>> | (let* ((src (cond ((eq (org-element-type element) (quote link))
>>>>> | (let* ((type ...) (raw-path ...)) (cond (... ...) (t raw-path))))
>>>>> | ((member (org-element-type element) (quote (latex-fragment
>>>>> | latex-environment))) (let* ((latex-frag ...) (formula-link ...))
>>>>> | (and formula-link (string-match "file:\\([^]]*\\)" formula-link)
>>>>> | (match-string 1 formula-link)))) (t (error "what is this?"))))
>>>>> | (caption-from (case (org-element-type element) (link
>>>>> | (org-export-get-parent-element element)) (t element))) (captions
>>>>> | (org-e-odt-format-label caption-from info (quote definition)))
>>>>> | (caption (car captions)) (href (org-e-odt-format-tags
>>>>> | "<draw:object xlink:href=\"%s\" xlink:type=\"simple\"
>>>>> | xlink:show=\"embed\" xlink:actuate=\"onLoad\"/>" ""
>>>>> | (file-name-directory (org-e-odt-copy-formula-file src))))
>>>>> | (embed-as (if
>>>> caption (quote paragraph) (quote character))) width height) (cond
>>>> ((eq embed-as (quote character)) (org-e-odt-format-entity
>>>> "InlineFormula" href width height)) (t (let ((table-info nil)
>>>> (table-info (quote (:alignment ["c" "c"] :column-groups [nil nil]
>>>> :row-groups ... :special-column-p nil :width [8 1])))
>>>> (org-lparse-table-ncols 2)) (org-e-odt-list-table (list (list
>>>> (org-e-odt-format-entity "CaptionedDisplayFormula" href width height
>>>> captions) (let* ... ...))) (quote (table (:attr_odt ...))) info)))))
>>>>> | org-e-odt-format-formula((latex-fragment (:value
>>>>> | "\\cite{schulte:2012}" :begin 70 :end 89 :post-blank 0 :parent
>>>>> | (paragraph (:begin 54 :end 94 :contents-begin 54 :contents-end 90
>>>>> | :post-blank 3 :parent (section (:begin 54 :end 336 :contents-begin
>>>>> | 54 :contents-end 336 :post-blank 0 :parent (headline (:raw-value
>>>>> | "Related Work..." :title ... :begin 36 :end 336 :pre-blank 0
>>>>> | :hiddenp nil :contents-begin 54 :contents-end 336 :level 1
>>>>> | :priority nil :tags nil :todo-keyword nil :todo-type nil
>>>>> | :scheduled nil :deadline nil :timestamp nil :clock nil :post-blank
>>>>> | 0 :footnote-section-p nil :archivedp nil :commentedp nil :quotedp
>>>>> | nil :category nil :parent ...) #4)) #2 (keyword (:key
>>>>> | "LATEX_HEADER" :value
>>>>> |
>>>>> "\\usepackage[natbib,backref,backend=bibtex,style=authoryear,isbn=false,url=false,eprint=false]{bi
>>>>>
>>>> blatex}" :begin 94 :end 214 :post-blank 0 :parent #4)) (keyword (:key
>>>> "LATEX_HEADER" :value "\\bibliography{literature}" :begin 214 :end 256
>>>> :post-blank 0 :parent #4)) (keyword (:key "LATEX_HEADER" :
>>>> value "\\setlength{\\bibhang}{1em}" :begin 256 :end 298 :post-blank 0
>>>> :parent #4)) (keyword (:key "LATEX_HEADER" :value
>>>> "\\usepackage{hyperref}" :begin 298 :end 336 :post-blank 0 :parent
>>>> #4)))) "can be found in " #0 "."))) (:author "Andreas Leha" :creator
>>>> "Generated by Org mode 7.8.11 in Emacs 24.1.50.1." :date nil
>>>> :description nil :email "andreas@werner" :exclude-tags ("noexport")
>>>> :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil
>>>> :section-numbers t :select-tags ("export") :time-stamp-file t :title
>>>> ("Citations in non-LaTeX") :with-archived-trees headline :with-author
>>>> t :with-clocks nil :with-creator comment :with-drawers nil :with-email
>>>> nil :with-emphasize t :with-entities t :with-fixed-width t
>>>> :with-footnotes t :with-plannings nil ...))
>>>>> | ....
>>>>> | ....
>>>>> | ....
>>>>> | org-export-dispatch()
>>>>> | call-interactively(org-export-dispatch record nil)
>>>>> | command-execute(org-export-dispatch record)
>>>>> | execute-extended-command(nil "org-export-dispatch")
>>>>> | call-interactively(execute-extended-command nil nil)
>>>>> `----
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>

  reply	other threads:[~2012-06-18  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-17 20:57 [BUG] [new exporter] \cite and \ref in odt export Andreas Leha
2012-06-18  6:40 ` Christian Moe
2012-06-18  6:59   ` Andreas Leha
     [not found]     ` <4FDEDB9A.1040000@christianmoe.com>
2012-06-18  7:42       ` Christian Moe
2012-06-18  7:55         ` Andreas Leha [this message]
2012-09-13 21:33 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bokhawax.fsf@med.uni-goettingen.de \
    --to=andreas.leha@med.uni-goettingen.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).