From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Girard Subject: Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export Date: Wed, 9 Dec 2009 23:50:49 +0100 Message-ID: <51b0095d0912091450h6be7087bv2c68f9bd0b857a64@mail.gmail.com> References: <51b0095d0912011303n73abddefjfd37fa9fab055c03@mail.gmail.com> <51b0095d0912050358v4e0ec999k9a4e5826877ea995@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001485f6d9d0985d9b047a5385e9 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIVN1-0002Ap-Is for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 17:50:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIVMx-00027y-0N for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 17:50:55 -0500 Received: from [199.232.76.173] (port=41111 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIVMw-00027k-Qh for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 17:50:50 -0500 Received: from mail-fx0-f213.google.com ([209.85.220.213]:56233) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIVMw-0000Bo-9w for emacs-orgmode@gnu.org; Wed, 09 Dec 2009 17:50:50 -0500 Received: by fxm5 with SMTP id 5so7354894fxm.8 for ; Wed, 09 Dec 2009 14:50:49 -0800 (PST) In-Reply-To: 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: emacs-orgmode --001485f6d9d0985d9b047a5385e9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2009/12/9 Carsten Dominik : > Hi Nicolas, > > I need additional information with respect to this patch: > >> diff --git a/lisp/org-latex.el b/lisp/org-latex.el >> index ce697a3..18c2183 100644 >> --- a/lisp/org-latex.el >> +++ b/lisp/org-latex.el >> @@ -877,7 +877,7 @@ If NUM, export sections as numerical sections." >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (delete-region (point-at-bol 0) (point)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (insert (format "\\begin{%s}\n" >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (symbol-name= org-export-latex-low-levels)))) >> - =A0 =A0 =A0 =A0 =A0 =A0(insert (format "\n\\item %s\\\\\n%s\n" >> + =A0 =A0 =A0 =A0 =A0 =A0(insert (format "\\item %s\n%s" >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 heading >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if label (forma= t "\\label{%s}" label) ""))) >> =A0 =A0 =A0 =A0 =A0 =A0 (insert (org-export-latex-content content)) > > Why would you like to remove the "\\" as well? =A0When itemize lists are = used > to format headlines, I think there should be a line break after the end o= f > the original headline. =A0Otherwise the text below the headline will flow= into > the headline. =A0Or am I missing something here? I think you're right ; I may have been abused by what Adobe Reader displayed when performing my tests, as I just discovered that, for whatever reason, it doesn't always reload the pdf file when using Using this test document #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D * Level 1 ** Level 2 *** Level 3 **** Level 4 Text #=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D the current code produces %=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D \begin{itemize} \item Level 4\\ \label{sec-1.1.1.1} Text %=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D There's an extra space produced by the \label{} because there's no '%' at the end of it ; another solution is to move the \label before the \\ There's also an extra newline before "Text". Please find attached my second proposal to fix this. > > >> @@ -997,7 +997,7 @@ OPT-PLIST is the options plist for current buffer." >> =A0 =A0 =A0(org-export-apply-macros-in-string org-export-latex-append-he= ader) >> =A0 =A0 =A0;; insert the title >> =A0 =A0 =A0(format >> - =A0 =A0 =A0"\n\n\\title{%s}\n" >> + =A0 =A0 =A0"\n\\title{%s}\n" >> =A0 =A0 =A0 ;; convert the title >> =A0 =A0 =A0 (org-export-latex-content >> =A0 =A0 =A0 =A0title '(lists tables fixed-width keywords))) > > What is the problem with additional empty lines before \\title command. > =A0Does that really change anything in the output? It's not really a problem, it just seems to me like, the less extra '\n' you see in the output of a LaTeX code generator, the more confident you can be. --=20 Nicolas --001485f6d9d0985d9b047a5385e9 Content-Type: text/x-patch; charset=US-ASCII; name="noextralines.patch" Content-Disposition: attachment; filename="noextralines.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g30ozo360 ZGlmZiAtLWdpdCBhL2xpc3Avb3JnLWxhdGV4LmVsIGIvbGlzcC9vcmctbGF0ZXguZWwKaW5kZXgg YWQ0NDNhYS4uMTY1NzIwOSAxMDA2NDQKLS0tIGEvbGlzcC9vcmctbGF0ZXguZWwKKysrIGIvbGlz cC9vcmctbGF0ZXguZWwKQEAgLTg2NCw3ICs4NjQsNyBAQCBJZiBOVU0sIGV4cG9ydCBzZWN0aW9u cyBhcyBudW1lcmljYWwgc2VjdGlvbnMuIgogCQkJICAgICAgIChidWZmZXItc3Vic3RyaW5nIChw b2ludC1hdC1ib2wgMCkgKHBvaW50KSkpCiAJCSAoZGVsZXRlLXJlZ2lvbiAocG9pbnQtYXQtYm9s IDApIChwb2ludCkpCiAJICAgICAgIChpbnNlcnQgIlxcYmVnaW57ZGVzY3JpcHRpb259XG4iKSkK LQkgICAgIChpbnNlcnQgKGZvcm1hdCAiXG5cXGl0ZW1bJXNdJXN+XG5cbiIKKwkgICAgIChpbnNl cnQgKGZvcm1hdCAiXG5cXGl0ZW1bJXNdJXN+IgogCQkJICAgICBoZWFkaW5nCiAJCQkgICAgIChp ZiBsYWJlbCAoZm9ybWF0ICJcXGxhYmVseyVzfSIgbGFiZWwpICIiKSkpCiAJICAgICAoaW5zZXJ0 IChvcmctZXhwb3J0LWxhdGV4LWNvbnRlbnQgY29udGVudCkpCkBAIC04NzcsNyArODc3LDcgQEAg SWYgTlVNLCBleHBvcnQgc2VjdGlvbnMgYXMgbnVtZXJpY2FsIHNlY3Rpb25zLiIKIAkJIChkZWxl dGUtcmVnaW9uIChwb2ludC1hdC1ib2wgMCkgKHBvaW50KSkKIAkgICAgICAgKGluc2VydCAoZm9y bWF0ICJcXGJlZ2lueyVzfVxuIgogCQkJICAgICAgIChzeW1ib2wtbmFtZSBvcmctZXhwb3J0LWxh dGV4LWxvdy1sZXZlbHMpKSkpCi0JICAgICAoaW5zZXJ0IChmb3JtYXQgIlxuXFxpdGVtICVzXFxc XFxuJXNcbiIKKwkgICAgIChpbnNlcnQgKGZvcm1hdCAiXG5cXGl0ZW0gJXMlc35cXFxcIgogCQkJ ICAgICBoZWFkaW5nCiAJCQkgICAgIChpZiBsYWJlbCAoZm9ybWF0ICJcXGxhYmVseyVzfSIgbGFi ZWwpICIiKSkpCiAJICAgICAoaW5zZXJ0IChvcmctZXhwb3J0LWxhdGV4LWNvbnRlbnQgY29udGVu dCkpCg== --001485f6d9d0985d9b047a5385e9 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@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --001485f6d9d0985d9b047a5385e9--