Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
On Mar 18, 2010, at 2:54 PM, Francesco Pizzolante wrote: Hi David, David Maus wrote: Took me a while to realize the problem with current implementation: If you already have a blank line between scheduled/deadline line and the content the newline forces extra spacing between scheduled/deadline and the following paragraph. I'm sorry if I wasn't clear enough. This cleary /is/ problem. Maybe we should catch these two cases (patch attached): , | (unless (and (looking-at .*\n[ \t]*\n) (looking-at .*\\\ \newline[ \t]*$)) ` Insert \newline only if there is no paragraph separator. As far as I can see the LaTeX code is already rendered when `org-export-latex-keywords' is called so this should work out. I tried your patch, but I still get extra \newline commands in the generated LaTeX. Let's go back to examples, I think it will be easier to understand my problem. 1) Heading with no text --8---cut here---start-8--- ** STARTED First SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline --8---cut here---end---8--- Which gives me an extra vertical space between this heading and the next one. While I would expect this (with or without the extra blank line in this case, as there's no text after): --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} --8---cut here---end---8--- 2) Heading with text and no blank line between heading and text --8---cut here---start-8--- ** STARTED Second SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri This task is split among all services and communication between the entities. --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline\newline This task is split among all services and communication between the entities. --8---cut here---end---8--- I also get an extra vertical space between the timestamps and the text which is on a new paragraph. Instead, I was expecting this: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} This task is split among all services and communication between the entities. --8---cut here---end---8--- 3) Heading with text and blank line between heading and text --8---cut here---start-8--- ** DONE Third DEADLINE: 2010-03-26 Fri This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri}\newline This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- In this case, again, I get an extra vertical space between the timestamps and the text which is also in a new paragraph. Instead, I would simply expect this: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri} This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- As you can see from these 3 examples, it is safer to always generate blank lines only instead of \newline commands. Sorry for the length of this message. On the contrary, thank you for this long message. This is exactly what nails the discussion and shows the problems. I agree with what I think is the conclusion of this discussion: No \newline, only an empty line to star a new paragraph, in all three example cases. I have made this change now, thank you both. - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list.
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
On Mar 17, 2010, at 9:00 PM, David Maus wrote: Carsten Dominik wrote: Hi Francesco, thanks for this. The reason why I put this is is to make sure that text after that line will start in a new line, and now flow into the scheduled/deadline line. For example: *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri this should start a new line but does not with your patch Do you disagree that this is the right thing to do? Do you know a method to achieve the same result without generating extra white space? We could simply insert a blank line (e.g. \n\n), couldn't we? This would let LaTeX start a new paragraph if there's no space between scheduled/deadline line and do no harm if there is, because LaTeX doesn't care about multiple newlines. Yes, we could, but what I tries was to *not* start a new paragraph... - Carsten HTH -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de - Carsten ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi, Thanks for your remarks. thanks for this. The reason why I put this is is to make sure that text after that line will start in a new line, and now flow into the scheduled/deadline line. For example: *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri this should start a new line but does not with your patch Do you disagree that this is the right thing to do? Do you know a method to achieve the same result without generating extra white space? We could simply insert a blank line (e.g. \n\n), couldn't we? This would let LaTeX start a new paragraph if there's no space between scheduled/deadline line and do no harm if there is, because LaTeX doesn't care about multiple newlines. Yes, we could, but what I tries was to *not* start a new paragraph... Why not? From my point of view, the timestamps are more technical information and the text you have after is the real text regarding the heading, so why not put them on separate paragraphs? After a few more tests, I think that David's suggestion is the best one: having a simple blank line after the timestamps in the generated LaTex code. This way, if we have some text in the heading, LaTex will simply start a new paragraph and we will have the correct spacing. If don't have text in the heading, LaTeX will simply ignore the blank line and will format the next heading according to the document class chosen. The problem with the actual implementation is that it forces a newline in all cases (both if you have text in the heading or not) which does not respect the document class formatting that you've chosen. What do you think? Thanks a lot, Francesco ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Francesco Pizzolante wrote: The problem with the actual implementation is that it forces a newline in all cases (both if you have text in the heading or not) which does not respect the document class formatting that you've chosen. Took me a while to realize the problem with current implementation: If you already have a blank line between scheduled/deadline line and the content the newline forces extra spacing between scheduled/deadline and the following paragraph. This cleary /is/ problem. Maybe we should catch these two cases (patch attached): , | (unless (and (looking-at .*\n[ \t]*\n) (looking-at .*newline[ \t]*$)) ` Insert \newline only if there is no paragraph separator. As far as I can see the LaTeX code is already rendered when `org-export-latex-keywords' is called so this should work out. HTH -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de fix-latex-newline.diff Description: Binary data pgpNqxRcOj6rA.pgp Description: PGP signature ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi David, David Maus wrote: Took me a while to realize the problem with current implementation: If you already have a blank line between scheduled/deadline line and the content the newline forces extra spacing between scheduled/deadline and the following paragraph. I'm sorry if I wasn't clear enough. This cleary /is/ problem. Maybe we should catch these two cases (patch attached): , | (unless (and (looking-at .*\n[ \t]*\n) (looking-at .*newline[ \t]*$)) ` Insert \newline only if there is no paragraph separator. As far as I can see the LaTeX code is already rendered when `org-export-latex-keywords' is called so this should work out. I tried your patch, but I still get extra \newline commands in the generated LaTeX. Let's go back to examples, I think it will be easier to understand my problem. 1) Heading with no text --8---cut here---start-8--- ** STARTED First SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline --8---cut here---end---8--- Which gives me an extra vertical space between this heading and the next one. While I would expect this (with or without the extra blank line in this case, as there's no text after): --8---cut here---start-8--- \subsection{\textbf{STARTED} First} \label{sec-1.1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} --8---cut here---end---8--- 2) Heading with text and no blank line between heading and text --8---cut here---start-8--- ** STARTED Second SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri This task is split among all services and communication between the entities. --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline\newline This task is split among all services and communication between the entities. --8---cut here---end---8--- I also get an extra vertical space between the timestamps and the text which is on a new paragraph. Instead, I was expecting this: --8---cut here---start-8--- \subsection{\textbf{STARTED} Second} \label{sec-1.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} This task is split among all services and communication between the entities. --8---cut here---end---8--- 3) Heading with text and blank line between heading and text --8---cut here---start-8--- ** DONE Third DEADLINE: 2010-03-26 Fri This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- This gives the following: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri}\newline This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- In this case, again, I get an extra vertical space between the timestamps and the text which is also in a new paragraph. Instead, I would simply expect this: --8---cut here---start-8--- \subsection{\textbf{DONE} Third} \label{sec-1.3} \texttt{DEADLINE:} \textit{2010-03-26 Fri} This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- As you can see from these 3 examples, it is safer to always generate blank lines only instead of \newline commands. Sorry for the length of this message. I hope, the problem is clearer now. Please let me know what you think. Francesco ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Francesco Pizzolante wrote: Hi David, This cleary /is/ problem. Maybe we should catch these two cases (patch attached): , | (unless (and (looking-at .*\n[ \t]*\n) (looking-at .*newline[ \t]*$)) ` Insert \newline only if there is no paragraph separator. As far as I can see the LaTeX code is already rendered when `org-export-latex-keywords' is called so this should work out. I tried your patch, but I still get extra \newline commands in the generated LaTeX. Yes, sorry, my brain's logical unit misfired. What I meant was , | (unless (or (looking-at .*\n[ \t]*\n) (looking-at .*newline[ \t]*$)) ` Translating to: insert /no/ \newline, if either (a) there is a empty line beneath this line or (b) there is already a \newline. Using this the examples give: 1) Heading with no text --8---cut here---start-8--- ** STARTED First SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \section{STARTED First} \label{sec-1} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri} --8---cut here---end---8--- No extra vertical space between this heading and the next one. 2) Heading with text and no blank line between heading and text --8---cut here---start-8--- ** STARTED Second SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-19 Fri This task is split among all services and communication between the entities. --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \section{STARTED Second} \label{sec-2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-19 Fri}\newline This task is split among all services and communication between the entities. --8---cut here---end---8--- This would be Carsten's case. 3) Heading with text and blank line between heading and text --8---cut here---start-8--- ** DONE Third DEADLINE: 2010-03-26 Fri This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- Gives the following: --8---cut here---start-8--- \section{\textbf{DONE} Third} \label{sec-3} \texttt{DEADLINE:} \textit{2010-03-26 Fri} This task is split among all services and communication between the entities. Second paragraph. fdqsfdq --8---cut here---end---8--- What you expected. IMO inserting a \newline after the deadline/scheduled line if text follows immediately (example 2) makes sense. HTH -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de latex-newline-2.diff Description: Binary data pgpuggBVRVQ5l.pgp Description: PGP signature ___ 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
[Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi, When exporting an Org buffer to latex, I can see that Org generates an extra \newline command just after exporting the timestamps to the heading. An example. This Org stuff: --8---cut here---start-8--- *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri :LOGBOOK: - State STARTEDfrom TODO [2010-03-02 Tue 09:30] - State DONE from STARTED[2010-03-02 Tue 10:00] CLOCK: [2010-03-02 Tue 09:30]--[2010-03-02 Tue 10:00] = 0:30 - PWA. :END: :PROPERTIES: :Effort: 4:00 :END: --8---cut here---end---8--- Is exported to latex this way: --8---cut here---start-8--- \subsubsection{\textbf{DONE} My Task \textbf{:Be:}} \label{sec-2.2.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-05 Fri}\newline --8---cut here---end---8--- At the end of the timestamps line, you can see the extra \newline command. This \newline command should be removed as it adds extra vertical space which does not respect the document class definition used for the document. In order to do that, I made the following change to org-latex.el and it works for me, but I'm not sure my change is completely safe: --8---cut here---start-8--- index 03216a8..88bd8c3 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1511,7 +1511,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER. (beginning-of-line 1) (unless (looking-at .*newline[ \t]*$) (end-of-line 1) - (insert \\newline) + (defun org-export-latex-fixed-width (opt) When OPT is non-nil convert fixed-width sections to LaTeX. --8---cut here---end---8--- Is this the right thing to do to avoid this extra \newline command? Thanks, Francesco ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Hi Francesco, thanks for this. The reason why I put this is is to make sure that text after that line will start in a new line, and now flow into the scheduled/deadline line. For example: *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri this should start a new line but does not with your patch Do you disagree that this is the right thing to do? Do you know a method to achieve the same result without generating extra white space? - Carsten On Mar 17, 2010, at 1:43 PM, Francesco Pizzolante wrote: Hi, When exporting an Org buffer to latex, I can see that Org generates an extra \newline command just after exporting the timestamps to the heading. An example. This Org stuff: --8---cut here---start-8--- *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri :LOGBOOK: - State STARTEDfrom TODO [2010-03-02 Tue 09:30] - State DONE from STARTED[2010-03-02 Tue 10:00] CLOCK: [2010-03-02 Tue 09:30]--[2010-03-02 Tue 10:00] = 0:30 - PWA. :END: :PROPERTIES: :Effort: 4:00 :END: --8---cut here---end---8--- Is exported to latex this way: --8---cut here---start-8--- \subsubsection{\textbf{DONE} My Task \textbf{:Be:}} \label{sec-2.2.2} \texttt{SCHEDULED:} \textit{2010-03-01 Mon} \texttt{DEADLINE:} \textit{2010-03-05 Fri}\newline --8---cut here---end---8--- At the end of the timestamps line, you can see the extra \newline command. This \newline command should be removed as it adds extra vertical space which does not respect the document class definition used for the document. In order to do that, I made the following change to org-latex.el and it works for me, but I'm not sure my change is completely safe: --8---cut here---start-8--- index 03216a8..88bd8c3 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1511,7 +1511,7 @@ The conversion is made depending of STRING- BEFORE and STRING-AFTER. (beginning-of-line 1) (unless (looking-at .*newline[ \t]*$) (end-of-line 1) - (insert \\newline) + (defun org-export-latex-fixed-width (opt) When OPT is non-nil convert fixed-width sections to LaTeX. --8---cut here---end---8--- Is this the right thing to do to avoid this extra \newline command? Thanks, Francesco ___ 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 ___ 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
Re: [Orgmode] LaTeX export Avoid \newline command after timestampsX-Draft-From: (nnimap+mc:INBOX.sncb)
Carsten Dominik wrote: Hi Francesco, thanks for this. The reason why I put this is is to make sure that text after that line will start in a new line, and now flow into the scheduled/deadline line. For example: *** DONE My Task :Be: SCHEDULED: 2010-03-01 Mon DEADLINE: 2010-03-05 Fri this should start a new line but does not with your patch Do you disagree that this is the right thing to do? Do you know a method to achieve the same result without generating extra white space? We could simply insert a blank line (e.g. \n\n), couldn't we? This would let LaTeX start a new paragraph if there's no space between scheduled/deadline line and do no harm if there is, because LaTeX doesn't care about multiple newlines. HTH -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpOpfqby69D8.pgp Description: PGP signature ___ 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