emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: Francesco Pizzolante <fpz@missioncriticalit.com>
Cc: mailing-list-org-mode <emacs-orgmode@gnu.org>,
	Carsten Dominik <carsten.dominik@gmail.com>
Subject: Re: LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb")
Date: Thu, 18 Mar 2010 16:41:23 +0100	[thread overview]
Message-ID: <87wrx9skm4.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <871vfhspjj.fsf@mundaneum.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 3140 bytes --]

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.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.1.2: latex-newline-2.diff --]
[-- Type: application/octet-stream, Size: 482 bytes --]

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 1f697d5..d50dc2d 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1517,7 +1517,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 			   (match-string 0)) t t)
     (save-excursion
       (beginning-of-line 1)
-      (unless (looking-at ".*\\\\newline[ \t]*$")
+      (unless (or (looking-at ".*\n[ \t]*\n") (looking-at ".*\\\\newline[ \t]*$"))
 	(end-of-line 1)
 	(insert "\\newline")))))
 

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: 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

  reply	other threads:[~2010-03-18 15:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 12:43 LaTeX export > Avoid \newline command after timestampsX-Draft-From: ("nnimap+mc:INBOX.sncb") Francesco Pizzolante
2010-03-17 14:35 ` Carsten Dominik
2010-03-17 20:00   ` David Maus
2010-03-18  5:47     ` Carsten Dominik
     [not found]       ` <F8590385-44EE-4081-81FA-FC10AA364CA0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-03-18  9:07         ` Francesco Pizzolante
2010-03-18 11:45           ` David Maus
     [not found]             ` <87y6hpkg4f.wl%dmaus-lYycHbxpNtazQB+pC5nmwQ@public.gmane.org>
2010-03-18 13:54               ` Francesco Pizzolante
2010-03-18 15:41                 ` David Maus [this message]
     [not found]                   ` <87wrx9skm4.wl%dmaus-lYycHbxpNtazQB+pC5nmwQ@public.gmane.org>
2010-03-18 16:06                     ` Francesco Pizzolante
2010-03-19 17:20                 ` Carsten Dominik

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=87wrx9skm4.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fpz@missioncriticalit.com \
    /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).