* [PATCH] Suppress extra newlines around source code in LaTeX export
@ 2009-12-01 21:03 Nicolas Girard
2009-12-03 14:42 ` Carsten Dominik
2009-12-05 11:58 ` Nicolas Girard
0 siblings, 2 replies; 15+ messages in thread
From: Nicolas Girard @ 2009-12-01 21:03 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 173 bytes --]
Hi,
title says it all.
A single paragraph such as:
#===
Dura lex
#+begin_src emacs-lisp
(a)
#+end_src
sed lex
#===
should remain entire in the LaTeX export.
--
Nicolas
[-- Attachment #2: noextralines.patch --]
[-- Type: text/x-patch, Size: 1070 bytes --]
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 7509ba8..4c4d540 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -2403,7 +2403,7 @@ INDENT was the original indentation of the block."
(concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t)) "\n#+END_HTML\n\n"))
((eq backend 'latex)
(setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
- (concat "\n#+BEGIN_LaTeX\n"
+ (concat "#+BEGIN_LaTeX\n"
(org-add-props
(if org-export-latex-listings
(concat
@@ -2423,7 +2423,7 @@ INDENT was the original indentation of the block."
(concat (car org-export-latex-verbatim-wrap)
rtn (cdr org-export-latex-verbatim-wrap)))
'(org-protected t))
- "#+END_LaTeX\n\n"))
+ "#+END_LaTeX\n"))
((eq backend 'ascii)
;; This is not HTML or LaTeX, so just make it an example.
(setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont rpllbl fmt))
[-- 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] Suppress extra newlines around source code in LaTeX export
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
1 sibling, 0 replies; 15+ messages in thread
From: Carsten Dominik @ 2009-12-03 14:42 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
Applied, thanks.
- Carsten
On Dec 1, 2009, at 10:03 PM, Nicolas Girard wrote:
> Hi,
> title says it all.
>
> A single paragraph such as:
>
> #===
> Dura lex
> #+begin_src emacs-lisp
> (a)
> #+end_src
> sed lex
> #===
>
> should remain entire in the LaTeX export.
>
> --
> Nicolas
> <noextralines.patch>_______________________________________________
> 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
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] Suppress extra newlines around source code in LaTeX export
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
1 sibling, 1 reply; 15+ messages in thread
From: Nicolas Girard @ 2009-12-05 11:58 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
2009/12/1 Nicolas Girard <nicolas.girard@nerim.net>:
> Hi,
> title says it all.
>
Hi,
attached is a second patch which suppresses some other extra newlines
in the LaTeX export. Let me know if you need any explanation.
--
Nicolas
[-- Attachment #2: noextralines.patch --]
[-- Type: text/x-patch, Size: 1498 bytes --]
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 4c4d540..75ee548 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -2423,7 +2423,7 @@ INDENT was the original indentation of the block."
(concat (car org-export-latex-verbatim-wrap)
rtn (cdr org-export-latex-verbatim-wrap)))
'(org-protected t))
- "#+END_LaTeX\n"))
+ "#+END_LaTeX"))
((eq backend 'ascii)
;; This is not HTML or LaTeX, so just make it an example.
(setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont rpllbl fmt))
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))
@@ -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)))
[-- 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-05 11:58 ` Nicolas Girard
@ 2009-12-09 10:00 ` Carsten Dominik
2009-12-09 22:21 ` Nicolas Girard
2009-12-09 22:50 ` Nicolas Girard
0 siblings, 2 replies; 15+ messages in thread
From: Carsten Dominik @ 2009-12-09 10:00 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
Hi Nicolas,
I need additional information with respect to this patch:
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 4c4d540..75ee548 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -2423,7 +2423,7 @@ INDENT was the original indentation of the
> block."
> (concat (car org-export-latex-verbatim-
> wrap)
> rtn (cdr org-export-latex-
> verbatim-wrap)))
> '(org-protected t))
> - "#+END_LaTeX\n"))
> + "#+END_LaTeX"))
> ((eq backend 'ascii)
> ;; This is not HTML or LaTeX, so just make it an example.
> (setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont
> rpllbl fmt))
I have fixed this part, in a different way though.
> 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?
> @@ -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?
Thanks.
- Carsten
>
On Dec 5, 2009, at 12:58 PM, Nicolas Girard wrote:
> 2009/12/1 Nicolas Girard <nicolas.girard@nerim.net>:
>> Hi,
>> title says it all.
>>
>
> Hi,
>
> attached is a second patch which suppresses some other extra newlines
> in the LaTeX export. Let me know if you need any explanation.
>
> --
> Nicolas
> <noextralines.patch>_______________________________________________
> 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
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 10:00 ` Carsten Dominik
@ 2009-12-09 22:21 ` Nicolas Girard
2009-12-10 21:37 ` Nicolas Girard
2009-12-09 22:50 ` Nicolas Girard
1 sibling, 1 reply; 15+ messages in thread
From: Nicolas Girard @ 2009-12-09 22:21 UTC (permalink / raw)
To: emacs-orgmode
2009/12/9 Carsten Dominik <carsten.dominik@gmail.com>:
>> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
>> index 4c4d540..75ee548 100644
>> --- a/lisp/org-exp.el
>> +++ b/lisp/org-exp.el
>> @@ -2423,7 +2423,7 @@ INDENT was the original indentation of the block."
>> (concat (car org-export-latex-verbatim-wrap)
>> rtn (cdr
>> org-export-latex-verbatim-wrap)))
>> '(org-protected t))
>> - "#+END_LaTeX\n"))
>> + "#+END_LaTeX"))
>> ((eq backend 'ascii)
>> ;; This is not HTML or LaTeX, so just make it an example.
>> (setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont
>> rpllbl fmt))
>
>
> I have fixed this part, in a different way though.
>
I'm afraid there are still extra paragraphs resulting from an extra
newline after code blocs.
Consider the following test chunk:
#=====
This is a new paragraph
#+begin_src emacs-lisp
(setq ispell-program-name "aspell")
#+end_src
continuing after the code bloc.
#=====
Using the freshest code, is is translated to
%=====
This is a new paragraph
\lstset{language=Lisp}
\begin{lstlisting}
(setq ispell-program-name "aspell")
\end{lstlisting}
continuing after the code bloc.
%=====
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 10:00 ` Carsten Dominik
2009-12-09 22:21 ` Nicolas Girard
@ 2009-12-09 22:50 ` Nicolas Girard
2009-12-09 23:56 ` Nicolas Girard
2009-12-10 8:08 ` Carsten Dominik
1 sibling, 2 replies; 15+ messages in thread
From: Nicolas Girard @ 2009-12-09 22:50 UTC (permalink / raw)
To: emacs-orgmode
[-- 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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 22:50 ` Nicolas Girard
@ 2009-12-09 23:56 ` Nicolas Girard
2009-12-10 8:08 ` Carsten Dominik
2009-12-10 8:08 ` Carsten Dominik
1 sibling, 1 reply; 15+ messages in thread
From: Nicolas Girard @ 2009-12-09 23:56 UTC (permalink / raw)
To: emacs-orgmode
2009/12/9 Nicolas Girard <nicolas.girard@nerim.net>:
> 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>
>
Actually I do remember why I considered removing the '\\' : take this document:
#=============
Level 1
** Level 2
*** Level 3
**** Level 4
- itemized
- list
#=============
Since "Level 4" is expressed as an item, the only way of getting the
correct output is *not* to have any '\\' between "Level 4" and
"itemized". That is, in LaTeX, not to have '\\' between
\item Level 4
and
\begin{itemize} \item itemized \item list \end{itemize}
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 22:50 ` Nicolas Girard
2009-12-09 23:56 ` Nicolas Girard
@ 2009-12-10 8:08 ` Carsten Dominik
2009-12-10 21:39 ` Nicolas Girard
1 sibling, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-12-10 8:08 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
On Dec 9, 2009, at 11:50 PM, Nicolas Girard wrote:
> 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
> \\
I prefer to write
\label{...}%
if you can agree to that.
> 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
> <noextralines.patch>_______________________________________________
> 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
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 23:56 ` Nicolas Girard
@ 2009-12-10 8:08 ` Carsten Dominik
2009-12-10 21:38 ` Nicolas Girard
0 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-12-10 8:08 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
On Dec 10, 2009, at 12:56 AM, Nicolas Girard wrote:
> 2009/12/9 Nicolas Girard <nicolas.girard@nerim.net>:
>> 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>
>>
>
> Actually I do remember why I considered removing the '\\' : take
> this document:
>
> #=============
> Level 1
>
> ** Level 2
>
> *** Level 3
>
> **** Level 4
> - itemized
> - list
> #=============
>
> Since "Level 4" is expressed as an item, the only way of getting the
> correct output is *not* to have any '\\' between "Level 4" and
> "itemized". That is, in LaTeX, not to have '\\' between
> \item Level 4
> and
> \begin{itemize} \item itemized \item list \end{itemize}
OK, I am catching this case now as well.
Let me know if it works all right now.
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-09 22:21 ` Nicolas Girard
@ 2009-12-10 21:37 ` Nicolas Girard
2009-12-14 15:41 ` Carsten Dominik
0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Girard @ 2009-12-10 21:37 UTC (permalink / raw)
To: emacs-orgmode
2009/12/9 Nicolas Girard <nicolas.girard@nerim.net>:
> 2009/12/9 Carsten Dominik <carsten.dominik@gmail.com>:
>
>>> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
>>> index 4c4d540..75ee548 100644
>>> --- a/lisp/org-exp.el
>>> +++ b/lisp/org-exp.el
>>> @@ -2423,7 +2423,7 @@ INDENT was the original indentation of the block."
>>> (concat (car org-export-latex-verbatim-wrap)
>>> rtn (cdr
>>> org-export-latex-verbatim-wrap)))
>>> '(org-protected t))
>>> - "#+END_LaTeX\n"))
>>> + "#+END_LaTeX"))
>>> ((eq backend 'ascii)
>>> ;; This is not HTML or LaTeX, so just make it an example.
>>> (setq rtn (org-export-number-lines rtn 'ascii 0 0 num cont
>>> rpllbl fmt))
>>
>>
>> I have fixed this part, in a different way though.
>>
>
> I'm afraid there are still extra paragraphs resulting from an extra
> newline after code blocs.
>
> Consider the following test chunk:
>
> #=====
> This is a new paragraph
> #+begin_src emacs-lisp
> (setq ispell-program-name "aspell")
> #+end_src
> continuing after the code bloc.
> #=====
>
> Using the freshest code, is is translated to
>
> %=====
> This is a new paragraph
> \lstset{language=Lisp}
> \begin{lstlisting}
> (setq ispell-program-name "aspell")
> \end{lstlisting}
>
> continuing after the code bloc.
> %=====
>
>
Unfortunately this problem remains: processing
#=====
This is a new paragraph
#+begin_src emacs-lisp
(setq ispell-program-name "aspell")
#+end_src
continuing after the code bloc.
#=====
still inserts an extra newline just before "continuing (...)".
Cheers,
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-10 8:08 ` Carsten Dominik
@ 2009-12-10 21:38 ` Nicolas Girard
0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Girard @ 2009-12-10 21:38 UTC (permalink / raw)
To: emacs-orgmode
2009/12/10 Carsten Dominik <carsten.dominik@gmail.com>:
>
> On Dec 10, 2009, at 12:56 AM, Nicolas Girard wrote:
>
>> 2009/12/9 Nicolas Girard <nicolas.girard@nerim.net>:
>>>
>>
>> Actually I do remember why I considered removing the '\\' : take this
>> document:
>>
>> #=============
>> Level 1
>>
>> ** Level 2
>>
>> *** Level 3
>>
>> **** Level 4
>> - itemized
>> - list
>> #=============
>>
>> Since "Level 4" is expressed as an item, the only way of getting the
>> correct output is *not* to have any '\\' between "Level 4" and
>> "itemized". That is, in LaTeX, not to have '\\' between
>> \item Level 4
>> and
>> \begin{itemize} \item itemized \item list \end{itemize}
>
> OK, I am catching this case now as well.
>
> Let me know if it works all right now.
>
Hi Carsten,
this works fine now, thanks very much !
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-10 8:08 ` Carsten Dominik
@ 2009-12-10 21:39 ` Nicolas Girard
0 siblings, 0 replies; 15+ messages in thread
From: Nicolas Girard @ 2009-12-10 21:39 UTC (permalink / raw)
To: emacs-orgmode
>
> On Dec 9, 2009, at 11:50 PM, Nicolas Girard wrote:
>>
>> 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
>> \\
>
> I prefer to write
>
> \label{...}%
>
> if you can agree to that.
>
Sure, no problem !
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-10 21:37 ` Nicolas Girard
@ 2009-12-14 15:41 ` Carsten Dominik
2009-12-15 10:55 ` Nicolas Girard
0 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-12-14 15:41 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
Actually, I cannot reproduce this problem - I do not see the extra
newline.
- Carsten
On Dec 10, 2009, at 10:37 PM, Nicolas Girard wrote:
> 2009/12/9 Nicolas Girard <nicolas.girard@nerim.net>:
>> 2009/12/9 Carsten Dominik <carsten.dominik@gmail.com>:
>>
>>>> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
>>>> index 4c4d540..75ee548 100644
>>>> --- a/lisp/org-exp.el
>>>> +++ b/lisp/org-exp.el
>>>> @@ -2423,7 +2423,7 @@ INDENT was the original indentation of the
>>>> block."
>>>> (concat (car org-export-latex-
>>>> verbatim-wrap)
>>>> rtn (cdr
>>>> org-export-latex-verbatim-wrap)))
>>>> '(org-protected t))
>>>> - "#+END_LaTeX\n"))
>>>> + "#+END_LaTeX"))
>>>> ((eq backend 'ascii)
>>>> ;; This is not HTML or LaTeX, so just make it an
>>>> example.
>>>> (setq rtn (org-export-number-lines rtn 'ascii 0 0
>>>> num cont
>>>> rpllbl fmt))
>>>
>>>
>>> I have fixed this part, in a different way though.
>>>
>>
>> I'm afraid there are still extra paragraphs resulting from an extra
>> newline after code blocs.
>>
>> Consider the following test chunk:
>>
>> #=====
>> This is a new paragraph
>> #+begin_src emacs-lisp
>> (setq ispell-program-name "aspell")
>> #+end_src
>> continuing after the code bloc.
>> #=====
>>
>> Using the freshest code, is is translated to
>>
>> %=====
>> This is a new paragraph
>> \lstset{language=Lisp}
>> \begin{lstlisting}
>> (setq ispell-program-name "aspell")
>> \end{lstlisting}
>>
>> continuing after the code bloc.
>> %=====
>>
>>
>
>
> Unfortunately this problem remains: processing
>
> #=====
> This is a new paragraph
> #+begin_src emacs-lisp
> (setq ispell-program-name "aspell")
> #+end_src
> continuing after the code bloc.
> #=====
>
> still inserts an extra newline just before "continuing (...)".
>
> Cheers,
>
> --
> Nicolas
>
>
> _______________________________________________
> 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
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-14 15:41 ` Carsten Dominik
@ 2009-12-15 10:55 ` Nicolas Girard
2009-12-16 10:48 ` Carsten Dominik
0 siblings, 1 reply; 15+ messages in thread
From: Nicolas Girard @ 2009-12-15 10:55 UTC (permalink / raw)
To: emacs-orgmode
2009/12/14 Carsten Dominik <carsten.dominik@gmail.com>:
> Actually, I cannot reproduce this problem - I do not see the extra newline.
>
Hi Carsten,
you're absolutely right, I performed yet another git pull and couldn't
reproduce this either. Great !
Now, speaking of extra newlines, I'm puzzled about this: at some stage
(which I didn't identify yet, maybe when exporting to LaTeX), Org adds
an ID property to some headings in my document ; that is, for
instance,
* Aa
* Bb
Text
becomes
* Aa
* Bb
:PROPERTIES:
:ID: fa489059-d27e-47fb-929d-8ca9c749d079
:END:
Text
Notice the extra newline between :END: and Text. It's all good except
when exporting to LaTeX *and* the concerned heading is to be treated
as an item.
I've been thinking a bit about this special case ; and it seems to me
like, on one side, the extra newline should remain, and on the other
side, empty lines following a heading should be ignored by the LaTeX
translator when this heading is translated into an item.
What do you think ?
--
Nicolas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Re: [PATCH] Suppress extra newlines around source code in LaTeX export
2009-12-15 10:55 ` Nicolas Girard
@ 2009-12-16 10:48 ` Carsten Dominik
0 siblings, 0 replies; 15+ messages in thread
From: Carsten Dominik @ 2009-12-16 10:48 UTC (permalink / raw)
To: Nicolas Girard; +Cc: emacs-orgmode
On Dec 15, 2009, at 11:55 AM, Nicolas Girard wrote:
> 2009/12/14 Carsten Dominik <carsten.dominik@gmail.com>:
>> Actually, I cannot reproduce this problem - I do not see the extra
>> newline.
>>
> Hi Carsten,
>
> you're absolutely right, I performed yet another git pull and couldn't
> reproduce this either. Great !
>
> Now, speaking of extra newlines, I'm puzzled about this: at some stage
> (which I didn't identify yet, maybe when exporting to LaTeX), Org adds
> an ID property to some headings in my document ; that is, for
> instance,
>
> * Aa
> * Bb
> Text
>
> becomes
>
> * Aa
> * Bb
> :PROPERTIES:
> :ID: fa489059-d27e-47fb-929d-8ca9c749d079
> :END:
>
> Text
>
>
> Notice the extra newline between :END: and Text. It's all good except
> when exporting to LaTeX *and* the concerned heading is to be treated
> as an item.
> I've been thinking a bit about this special case ; and it seems to me
> like, on one side, the extra newline should remain, and on the other
> side, empty lines following a heading should be ignored by the LaTeX
> translator when this heading is translated into an item.
> What do you think ?
I do agree and have tried to fix it. Please verify.
- Carsten
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2009-12-16 10:48 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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).