From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scot Becker Subject: Re: Exporting for word processors Date: Sat, 9 May 2009 17:37:03 +0100 Message-ID: References: <87ws8r5plf.fsf@fastmail.fm> <978fd2360905090456sd9b81afodf389ae72f4523ee@mail.gmail.com> <871vqycm6f.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0323504558==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M2pXy-0002Hk-HP for emacs-orgmode@gnu.org; Sat, 09 May 2009 12:37:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M2pXt-0002HX-RH for emacs-orgmode@gnu.org; Sat, 09 May 2009 12:37:09 -0400 Received: from [199.232.76.173] (port=51669 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M2pXt-0002HU-Ll for emacs-orgmode@gnu.org; Sat, 09 May 2009 12:37:05 -0400 Received: from mail-fx0-f169.google.com ([209.85.220.169]:58507) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M2pXs-0000KG-VX for emacs-orgmode@gnu.org; Sat, 09 May 2009 12:37:05 -0400 Received: by fxm17 with SMTP id 17so2032356fxm.42 for ; Sat, 09 May 2009 09:37:04 -0700 (PDT) In-Reply-To: <871vqycm6f.fsf@fastmail.fm> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matthew Lundin Cc: emacs-orgmode@gnu.org, windsor.10@osu.edu --===============0323504558== Content-Type: multipart/alternative; boundary=001636c5bdc4e9c36504697d5ad5 --001636c5bdc4e9c36504697d5ad5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit @Carsten. Thanks for pointing that variable out. I'll experiment. I was encouraged by the fact that even when italics didn't work the way I wanted, the /slashes/ were always still intact. I figured if I got desperate, I could always do a second pass on an export hook, but I'll mess with the variable. How nice that it's flexible. @ Matthew: Thanks for your setup. I'll be glad to poke around with it. @ Sebastian: Matthew's setup is considerably more refined than mine, but so far I've had good sucess with ebib, another BibTeX manager for Emacs. It lets you customize a few citation commands and makes it very easy to snag a quick citation key while writing. So far I write in org-mode and try to arrange it so I never have to look at the LaTeX file. But mine is a thesis, and it's not to the final stages yet. At the moment I still run (xe)latex-bibtex-(xe)latex manually, but that's only because I haven't sat down to customize the org variable to customize the latex command and run bibtex. Scot On Sat, May 9, 2009 at 4:48 PM, Matthew Lundin wrote: > Hi Sebastian, > > Sebastian Titz writes: > > > Matthew Lundin wrote: > > > >> I am in the same position --- i.e., I use emacs/auctex/org-mode/biblatex > >> in a field in which MS Word is the default option. Many of the things I > >> write have to be converted to doc format at some point. > > > could you elaborate on how you use biblatex with org-mode and auctex, > > since auctex doesn't support biblatex? > > I'll try to keep this brief, since I don't want to talk too much about > AUCTeX in the org-mode forum. > > I've found that AUCTeX and RefTeX work very well with biblatex, since > all biblatex requires is to run latex, then bibtex, then latex again. > > I use the Chicago Manual of Style biblatex package: > > > http://www.ctan.org/tex-archive/macros/latex/exptl/biblatex-contrib/biblatex-chicago-notes-df/ > > To make this work with AUCTeX, I've created a custom reftex-cite-format > for the citation types I use most often: > > --8<---------------cut here---------------start------------->8--- > (setq reftex-cite-format > '( > (?c . "\\cite[]{%l}") > (?C . "\\cites[]{%l}") > (?t . "\\citetitle[]{%l}") > (?T . "\\citetitles[]{%l}") > (?a . "\\autocite[]{%l}") > (?A . "\\autocites[]{%l}") > (?h . "\\headlessfullcite[]{%l}") > (?x . "[]{%l}") > (?X . "{%l}") > )) > > (setq reftex-cite-prompt-optional-args t) > --8<---------------cut here---------------end--------------->8--- > > I've also set the following variable to get the appropriate faces: > > --8<---------------cut here---------------start------------->8--- > (setq font-latex-match-reference-keywords > '(("cites" "[{") > ("autocite" "[{") > ("autocites" "[{") > ("citetitle" "[{") > ("citetitles" "[{") > ("headlessfullcite" "[{"))) > --8<---------------cut here---------------end--------------->8--- > > Finally, I've had to hack at a couple of reftex functions to change the > regular expressions that are used to identify citation macros for: > > 1) jumping to the matching entry in the bib file > (reftex-view-crossref) > > 2) generating a bib file from a tex file > (reftex-all-used-citation-keys). > > - This is necessary because the current regexps don't recognize > the plural citation macros (e.g. \cites, \autocites, etc.). > > Unfortunately, these regexps are hardcoded into reftex, so I have to > load the rewritten functions via a reftex-mode-hook. And since Carsten > is no longer the maintainer of RefTeX, it's not quite as easy to get a > customize option for a RefTeX regexp as it is to get one in org-mode. :) > > The whole setup is by no means perfect, but it works fine for me. > > Now, for the org-mode part of the post. I generally use org-mode for > drafting and AUCTeX for revising/polishing and adding formal citations. > > If I plan exporting something quickly from org-mode, I use the following > function for a quick and dirty way to get citation info from my bib > files into my org-mode files. (And, of course, I make heavy use of > org-mode's wonderful footnote features.) > > --8<---------------cut here---------------start------------->8--- > (defun my-reftex-citations () > (interactive) > (let ((reftex-cite-format > '( > (?f . "%a. %t. %j, %v, %b. %r: %u, %y. %p.\n") > (?F . "<<%l>>\n\n%a. %t. %j, %v, %b. %r: %u, %y. %p.\n") > (?s . "%a, %t, %y\n") > (?c . "\\cite[]{%l}" > (?l . "[[%l]]\n") > (?L . "%a, %t, %y. [[%l]]\n")))) > (reftex-citation))) > > (define-key text-mode-map (kbd "C-c y") 'my-reftex-citations) > --8<---------------cut here---------------end--------------->8--- > > If I wanted to export for biblatex directly from org-mode (which I > haven't tried yet), I think I would ignore most of the special > biblatex/Chicago macros and just use the \cite macro inside of footnotes > to make conversion/export to other formats a bit easier. > > Hope this helps. > > Matt > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --001636c5bdc4e9c36504697d5ad5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable @Carsten.

Thanks for pointing that variable out.=A0 I'll experim= ent.=A0 I was encouraged by the fact that even when italics didn't work= the way I wanted, the /slashes/ were always still intact.=A0 I figured if = I got desperate, I could always do a second pass on an export hook, but I&#= 39;ll mess with the variable.=A0 How nice that it's flexible.

@ Matthew:=A0

Thanks for your setup.=A0 I'll be glad to pok= e around with it.=A0

@ Sebastian:

Matthew's setup is con= siderably more refined than mine, but so far I've had good sucess with = ebib, another BibTeX manager for Emacs.=A0 It lets you customize a few cita= tion commands and makes it very easy to snag a quick citation key while wri= ting.=A0 So far I write in org-mode and try to arrange it so I never have t= o look at the LaTeX file.=A0 But mine is a thesis, and it's not to the = final stages yet.=A0 At the moment I still run (xe)latex-bibtex-(xe)latex m= anually, but that's only because I haven't sat down to customize th= e org variable to customize the latex command and run bibtex.=A0

Scot




On Sat, May 9, 2009 = at 4:48 PM, Matthew Lundin <mdl@imapmail.org> wrote:
Hi Sebastian,

Sebastian Titz <sebastian.ti= tz@gmail.com> writes:

> Matthew Lundin <mdl@imapmail.or= g> wrote:
>
>> I am in the same position --- i.e., I use emacs/auctex/org-mode/bi= blatex
>> in a field in which MS Word is the default option. Many of the thi= ngs I
>> write have to be converted to doc format at some point.

> could you elaborate on how you use biblatex wi= th org-mode and auctex,
> since auctex doesn't support biblatex?

I'll try to keep this brief, since I don't want to talk too m= uch about
AUCTeX in the org-mode forum.

I've found that AUCTeX and RefTeX work very well with biblatex, since all biblatex requires is to run latex, then bibtex, then latex again.

I use the Chicago Manual of Style biblatex package:

http://www.ctan.org/tex-a= rchive/macros/latex/exptl/biblatex-contrib/biblatex-chicago-notes-df/
To make this work with AUCTeX, I've created a custom reftex-cite-format=
for the citation types I use most often:

--8<---------------cut here---------------start------------->8---
(setq reftex-cite-format
=A0 =A0 =A0'(
=A0 =A0 =A0 =A0(?c . "\\cite[]{%l}")
=A0 =A0 =A0 =A0(?C . "\\cites[]{%l}")
=A0 =A0 =A0 =A0(?t . "\\citetitle[]{%l}")
=A0 =A0 =A0 =A0(?T . "\\citetitles[]{%l}")
=A0 =A0 =A0 =A0(?a . "\\autocite[]{%l}")
=A0 =A0 =A0 =A0(?A . "\\autocites[]{%l}")
=A0 =A0 =A0 =A0(?h . "\\headlessfullcite[]{%l}")
=A0 =A0 =A0 =A0(?x . "[]{%l}")
=A0 =A0 =A0 =A0(?X . "{%l}")
=A0 =A0 =A0 =A0))

(setq reftex-cite-prompt-optional-args t)
--8<---------------cut here---------------end---------= ------>8---

I've also set the following variable to get the appropriate faces= :

--8<---------------cut here---------------start------------->8---
(setq font-latex-match-reference-keywords
=A0 =A0 =A0'(("cites" "[{")
=A0 =A0 =A0 =A0("autocite" "[{")
=A0 =A0 =A0 =A0("autocites" "[{")
=A0 =A0 =A0 =A0("citetitle" "[{")
=A0 =A0 =A0 =A0("citetitles" "[{")
=A0 =A0 =A0 =A0("headlessfullcite" "[{")))
--8<---------------cut here---------------end---------= ------>8---

Finally, I've had to hack at a couple of reftex functions to chan= ge the
regular expressions that are used to identify citation macros for:

=A0 1) jumping to the matching entry in the bib file
=A0 =A0 =A0(reftex-view-crossref)

=A0 2) generating a bib file from a tex file
=A0 =A0 =A0(reftex-all-used-citation-keys).

=A0 =A0 =A0 =A0- This is necessary because the current regexps don't r= ecognize
=A0 =A0 =A0 =A0 =A0the plural citation macros (e.g. \cites, \autocites, et= c.).

Unfortunately, these regexps are hardcoded into reftex, so I have to
load the rewritten functions via a reftex-mode-hook. And since Carsten
is no longer the maintainer of RefTeX, it's not quite as easy to get a<= br> customize option for a RefTeX regexp as it is to get one in org-mode. :)
The whole setup is by no means perfect, but it works fine for me.

Now, for the org-mode part of the post. I generally use org-mode for
drafting and AUCTeX for revising/polishing and adding formal citations.

If I plan exporting something quickly from org-mode, I use the following function for a quick and dirty way to get citation info from my bib
files into my org-mode files. (And, of course, I make heavy use of
org-mode's wonderful footnote features.)

--8<---------------cut here---------------start------------->8---
(defun my-reftex-citations ()
=A0(interactive)
=A0(let ((reftex-cite-format
=A0 =A0 =A0 =A0 '(
=A0 =A0 =A0 =A0 =A0 (?f . "%a. %t. %j, %v, %b. %r: %u, %y. %p.\n"= ;)
=A0 =A0 =A0 =A0 =A0 (?F . "<<%l>>\n\n%a. %t. %j, %v, %b. = %r: %u, %y. %p.\n")
=A0 =A0 =A0 =A0 =A0 (?s . "%a, %t, %y\n")
=A0 =A0 =A0 =A0 =A0 (?c . "\\cite[]{%l}"
=A0 =A0 =A0 =A0 =A0 (?l . "[[%l]]\n")
=A0 =A0 =A0 =A0 =A0 (?L . "%a, %t, %y. [[%l]]\n"))))
=A0 =A0(reftex-citation)))

(define-key text-mode-map (kbd "C-c y") 'my-reftex-citations)=
--8<---------------cut here---------------end---------= ------>8---

If I wanted to export for biblatex directly from org-mode (which I haven't tried yet), I think I would ignore most of the special
biblatex/Chicago macros and just use the \cite macro inside of footnotes to make conversion/export to other formats a bit easier.

Hope this helps.

Matt


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

--001636c5bdc4e9c36504697d5ad5-- --===============0323504558== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0323504558==--