emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] LaTeX export > Avoid \newline command after timestampsX-Dr


From: David Maus
Subject: Re: [Orgmode] LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")
Date: Thu, 18 Mar 2010 16:41:23 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/24.0.50 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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.... address@hidden
Email..... address@hidden

Attachment: latex-newline-2.diff
Description: Binary data

Attachment: pgp75doub3SJh.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]