From: Nicolas Girard <nicolas.girard@nerim.net>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
Date: Wed, 9 Dec 2009 23:50:49 +0100 [thread overview]
Message-ID: <51b0095d0912091450h6be7087bv2c68f9bd0b857a64@mail.gmail.com> (raw)
In-Reply-To: <D1E0A9FB-CF4A-4746-9A50-CC9F2E010D4B@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2520 bytes --]
2009/12/9 Carsten Dominik <carsten.dominik@gmail.com>:
> 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."
>> (delete-region (point-at-bol 0) (point))
>> (insert (format "\\begin{%s}\n"
>> (symbol-name org-export-latex-low-levels))))
>> - (insert (format "\n\\item %s\\\\\n%s\n"
>> + (insert (format "\\item %s\n%s"
>> heading
>> (if label (format "\\label{%s}" label) "")))
>> (insert (org-export-latex-content content))
>
> Why would you like to remove the "\\" as well? When itemize lists are used
> to format headlines, I think there should be a line break after the end of
> the original headline. Otherwise the text below the headline will flow into
> the headline. Or 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
<Ctrl-r>
Using this test document
#===========
* Level 1
** Level 2
*** Level 3
**** Level 4
Text
#===========
the current code produces
%==========
\begin{itemize}
\item Level 4\\
\label{sec-1.1.1.1}
Text
%==========
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."
>> (org-export-apply-macros-in-string org-export-latex-append-header)
>> ;; insert the title
>> (format
>> - "\n\n\\title{%s}\n"
>> + "\n\\title{%s}\n"
>> ;; convert the title
>> (org-export-latex-content
>> title '(lists tables fixed-width keywords)))
>
> What is the problem with additional empty lines before \\title command.
> Does 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.
--
Nicolas
[-- Attachment #2: noextralines.patch --]
[-- Type: text/x-patch, Size: 973 bytes --]
diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ad443aa..1657209 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -864,7 +864,7 @@ If NUM, export sections as numerical sections."
(buffer-substring (point-at-bol 0) (point)))
(delete-region (point-at-bol 0) (point))
(insert "\\begin{description}\n"))
- (insert (format "\n\\item[%s]%s~\n\n"
+ (insert (format "\n\\item[%s]%s~"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
@@ -877,7 +877,7 @@ If NUM, export sections as numerical sections."
(delete-region (point-at-bol 0) (point))
(insert (format "\\begin{%s}\n"
(symbol-name org-export-latex-low-levels))))
- (insert (format "\n\\item %s\\\\\n%s\n"
+ (insert (format "\n\\item %s%s~\\\\"
heading
(if label (format "\\label{%s}" label) "")))
(insert (org-export-latex-content content))
[-- Attachment #3: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
next prev parent reply other threads:[~2009-12-09 22:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 21:03 [PATCH] Suppress extra newlines around source code in LaTeX export Nicolas Girard
2009-12-03 14:42 ` Carsten Dominik
2009-12-05 11:58 ` Nicolas Girard
2009-12-09 10:00 ` Carsten Dominik
2009-12-09 22:21 ` Nicolas Girard
2009-12-10 21:37 ` Nicolas Girard
2009-12-14 15:41 ` Carsten Dominik
2009-12-15 10:55 ` Nicolas Girard
2009-12-16 10:48 ` Carsten Dominik
2009-12-09 22:50 ` Nicolas Girard [this message]
2009-12-09 23:56 ` Nicolas Girard
2009-12-10 8:08 ` Carsten Dominik
2009-12-10 21:38 ` Nicolas Girard
2009-12-10 8:08 ` Carsten Dominik
2009-12-10 21:39 ` Nicolas Girard
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=51b0095d0912091450h6be7087bv2c68f9bd0b857a64@mail.gmail.com \
--to=nicolas.girard@nerim.net \
--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).