Hi Jay,

Thanks for your suggestion, and thank you to all for your help. With a minor modification (changing "--clean" to "--build=local", since otherwise texi2dvi does not see my other included files unless I use "-I") it does solve the problem, except for the efficiency, as Nick pointed out.
I think the only alternative would be to call a Makefile through a lisp function in this variable.
For some reason, Org export to LaTeX (and full compilation) feels a little sluggish to me; the export to LaTeX (.org => .tex) part must be quick and the rest of compilation doesn't much have to do with Org. I could probably use only one invocation of "texi2dvi --pdf --clean --verbose --batch %f" and treat the PDF as a draft and then every once in while do a full compilation.

Do you, or anyone else, have any comments or any other suggestions for speeding things up?

--
Omid


On Sat, May 18, 2013 at 5:36 AM, Jay Kerns <gjkernsysu@gmail.com> wrote:
Hi Omid,

On Sat, May 18, 2013 at 4:40 AM, Omid <omidlink@gmail.com> wrote:
> - The \bibliographystyle and \bibliography commands are at the end of the
> document.
> - The question is about how to get Org mode to do the whole job, as there is
> a command for it which is supposed to do exactly that but it doesn't.
>

Have you tried (something like) the following in your init file?

(setq org-latex-pdf-process (quote ("texi2dvi --pdf --clean --verbose
--batch %f" "bibtex %b" "texi2dvi --pdf --clean --verbose --batch %f"
"texi2dvi --pdf --clean --verbose --batch %f")))

You can read more about this variable (and customize it) with

C-h v org-latex-pdf-process RET

I hope this helps,

--
Jay