From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: [PATCH] Compiling multiple times the LaTeX output Date: Thu, 30 Sep 2010 15:27:49 +0200 Message-ID: <874od7uzsa.fsf_-_@mundaneum.com> References: <87zkv0pqyi.fsf@mundaneum.com> <87r5gcshnf.fsf@noorul.maa.corp.collab.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Noorul and all, Noorul Islam K M wrote: > S=C3=A9bastien Vauban writes: >> I've been taught of a weird observation: the page number indicated in the >> TOC of a PDFLaTeX output is wrong by one page... > > Quoting from source code > > (defcustom org-latex-to-pdf-process > '("pdflatex -interaction nonstopmode -output-directory %o %f" > "pdflatex -interaction nonstopmode -output-directory %o %f") > "Commands to process a LaTeX file to a PDF file. > This is a list of strings, each of them will be given to the shell > as a command. Attached my proposed patch for fixing this, regarding the TOC error (needed= a third compilation). Here, as many compilations as necessary are run, up to when LaTeX confirms the result is stable (no message "please re-run..."). Best regards, Seb --=20 S=C3=A9bastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=org-latex-patch Changes in HEAD Modified lisp/org-latex.el diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 9a62457..4b3e7f2 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -456,17 +456,17 @@ allowed. The default we use here encompasses both." :group 'org-export) (defcustom org-latex-to-pdf-process - '("pdflatex -interaction nonstopmode -output-directory %o %f" - "pdflatex -interaction nonstopmode -output-directory %o %f") + '("rm -f %b.log; pdflatex -interaction nonstopmode -output-directory %o %f; while (grep -e \"Rerun .* cross-references\" %b.log > /dev/null); do rm -f %b.log; pdflatex -interaction nonstopmode -output-directory %o %f; done") "Commands to process a LaTeX file to a PDF file. This is a list of strings, each of them will be given to the shell as a command. %f in the command will be replaced by the full file name, %b by the file base name (i.e. without extension) and %o by the base directory of the file. The reason why this is a list is that it usually takes several runs of -pdflatex, maybe mixed with a call to bibtex. Org does not have a clever -mechanism to detect which of these commands have to be run to get to a stable -result, and it also does not do any error checking. +pdflatex, maybe mixed with a call to bibtex. Org does now have a clever +mechanism to detect how many times the document has to be compiled to +get to a stable result for the cross-references. Though, bibtex calls +are still missing and it also does not do any error checking. Alternatively, this may be a Lisp function that does the processing, so you could use this to apply the machinery of AUCTeX or the Emacs LaTeX mode. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--