From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Subject: Re: Enforcing newlines in plain text export Date: Fri, 26 Sep 2014 23:59:52 -0400 Message-ID: References: <87r3yybcqs.fsf@berkeley.edu> <87ppehao11.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0118451edde14d0504041090 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXjAv-0003Rq-9u for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 00:00:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXjAu-0006tI-1m for emacs-orgmode@gnu.org; Sat, 27 Sep 2014 00:00:01 -0400 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:51566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXjAt-0006s9-Ml for emacs-orgmode@gnu.org; Fri, 26 Sep 2014 23:59:59 -0400 Received: by mail-wg0-f43.google.com with SMTP id y10so11058553wgg.14 for ; Fri, 26 Sep 2014 20:59:52 -0700 (PDT) In-Reply-To: <87ppehao11.fsf@berkeley.edu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Lawrence Cc: emacs-orgmode@gnu.org --089e0118451edde14d0504041090 Content-Type: text/plain; charset=ISO-8859-1 I am requesting a consistent solution. If "//" at the end of a line inserts newline when exporting in all formats, then it should do the same when used in between a line too for ALL export formats. Example: #+TITLE: Line one // Line two I am simply trying to explain why we need another solution for the sake of consistency across all org exported formats. But I understand if the org team doesn't think it worthwhile to implement. I'll look into the export filter configuration. Thanks. Kaushal On Sep 26, 2014 8:47 PM, "Richard Lawrence" wrote: > Kaushal writes: > > > Interesting thing is that `\\` work fine at the end of the lines. > > Yes, this is the behavior documented in the manual. > > > I need to force line breaks in cases like these > > > > ----- > > For example, to execute the =example_1= test and run in the {{{NEWLINE}}} > > > > > =/some/long/path/that/wouldn't/fit/along/with/the/above/line/in/the/same/line= > > directory, > > do the following.. > > ----- > > > > In the above example, org-export will not wrap the text between the > > verbatim formatting characters "=". > > To ensure that the exported formats (html/pdf/ascii) look clean, I have > to > > force a newline character just before that long string. > > > > Now using "\\" here instead of {{{NEWLINE}}} works but then I have to > > ensure that I place the "\\" character at the very end. If they are > placed > > mid-line then they will be interpreted as newline by latex but simply > "\\" > > character by html exporter. > > As you say, "\\" at the end of the line works fine in this case. So it > seems you do not have a need for another solution. > > > For consistency, the {{{NEWLINE}}} approach looks better; hoping that > > org-mode will support a special newline character for ascii exports at > some > > time: > > > > ----- > > #+MACRO: NEWLINE @@latex:\\@@ @@html:
@@ @@ascii:NEWLINE_CHARACTERS_ > > FOR_ASCII_EXPORT@@ > > ----- > > This would really not be a great solution, and I don't think you should > expect Org mode to support it. If you really need something like this, > you could write an export filter for yourself (e.g., one that replaces > the string "ASCII_NEWLINE_CHARACTER" with "\n" in the exported buffer). > See the "Advanced configuration" section of the Exporting chapter in the > manual. > > A better and more general solution, I think, would be to allow "\\" to > be used in other contexts, such as in headlines, title/author/date > declarations, etc. But that is a change to the currently documented > syntax, and it is probably a fair amount of work to implement, so it > probably isn't going to happen unless a variety of users really need it > and the maintainers think it would be an improvement to Org. > > Best, > Richard > --089e0118451edde14d0504041090 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I am requesting a consistent solution.

If "//" at the end of a line inserts newline when = exporting in all formats, then it should do the same when used in between a= line too for ALL export formats.

Example: #+TITLE: Line one // Line two

I am simply trying to explain why we need another solution f= or the sake of consistency across all org exported formats. But I understan= d if the org team doesn't think it worthwhile to implement.

I'll look into the export filter configuration.

Thanks.
Kaushal

On Sep 26, 2014 8:47 PM, "Richard Lawrence&= quot; <richard.lawrence= @berkeley.edu> wrote:
Kaushal <kaushal.modi= @gmail.com> writes:

> Interesting thing is that `\\` work fine at the end of the lines.

Yes, this is the behavior documented in the manual.

> I need to force line breaks in cases like these
>
> -----
> For example, to execute the =3Dexample_1=3D test and run in the {{{NEW= LINE}}}
>
> =3D/some/long/path/that/wouldn't/fit/along/with/the/above/line/in/= the/same/line=3D
> directory,
> do the following..
> -----
>
> In the above example, org-export will not wrap the text between the > verbatim formatting characters "=3D".
> To ensure that the exported formats (html/pdf/ascii) look clean, I hav= e to
> force a newline character just before that long string.
>
> Now using "\\" here instead of {{{NEWLINE}}} works but then = I have to
> ensure that I place the "\\" character at the very end. If t= hey are placed
> mid-line then they will be interpreted as newline by latex but simply = "\\"
> character by html exporter.

As you say, "\\" at the end of the line works fine in this case.= =A0 So it
seems you do not have a need for another solution.

> For consistency, the {{{NEWLINE}}} approach looks better; hoping that<= br> > org-mode will support a special newline character for ascii exports at= some
> time:
>
> -----
> #+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:NEWLINE_CHAR= ACTERS_
> FOR_ASCII_EXPORT@@
> -----

This would really not be a great solution, and I don't think you should=
expect Org mode to support it.=A0 If you really need something like this, you could write an export filter for yourself (e.g., one that replaces
the string "ASCII_NEWLINE_CHARACTER" with "\n" in the e= xported buffer).
See the "Advanced configuration" section of the Exporting chapter= in the
manual.

A better and more general solution, I think, would be to allow "\\&quo= t; to
be used in other contexts, such as in headlines, title/author/date
declarations, etc.=A0 But that is a change to the currently documented
syntax, and it is probably a fair amount of work to implement, so it
probably isn't going to happen unless a variety of users really need it=
and the maintainers think it would be an improvement to Org.

Best,
Richard
--089e0118451edde14d0504041090--