emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ox-ascii, bug?] aligning text withing footnotes
@ 2015-03-05 23:31 Rasmus
  2015-03-07  1:12 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-03-05 23:31 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

When writing plain text I might write something like:

See foo[fn:1] 

[fn:1] http://orgmode.org/\\
       http://www.gnu.org/software/emacs/

This is exported as:

See foo[1]

Footnotes
─────────

[1] [http://orgmode.org/]
       [http://www.gnu.org/software/emacs/]


I would like to have the links aligned after the ascii export.  That is,
if line 1 of a footnote is "shifted" n characters to the left, I would
like all subsequent lines of that element to be shirted n characters to
the left.

But maybe this would have other bad effects?

Thanks,
Rasmus

-- 
Don't panic!!!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ox-ascii, bug?] aligning text withing footnotes
  2015-03-05 23:31 [ox-ascii, bug?] aligning text withing footnotes Rasmus
@ 2015-03-07  1:12 ` Nicolas Goaziou
  2015-03-07 11:26   ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-03-07  1:12 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> When writing plain text I might write something like:
>
> See foo[fn:1] 
>
> [fn:1] http://orgmode.org/\\
>        http://www.gnu.org/software/emacs/
>
> This is exported as:
>
> See foo[1]
>
> Footnotes
> ─────────
>
> [1] [http://orgmode.org/]
>        [http://www.gnu.org/software/emacs/]

This should be fixed. Expected indentation is:


  [1] [http://orgmode.org/]
  [http://www.gnu.org/software/emacs/]


> I would like to have the links aligned after the ascii export.  That is,
> if line 1 of a footnote is "shifted" n characters to the left, I would
> like all subsequent lines of that element to be shirted n characters to
> the left.

You mean this this indentation scheme for footnotes

  [1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
      eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
      minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
      ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
      voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
      sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
      mollit anim id est laborum.

instead of

  [1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
  eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
  minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
  ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
  voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
  sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
  mollit anim id est laborum.

> But maybe this would have other bad effects?

It looks like plain lists. Anyway I don't have strong opinion about it.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ox-ascii, bug?] aligning text withing footnotes
  2015-03-07  1:12 ` Nicolas Goaziou
@ 2015-03-07 11:26   ` Rasmus
  2015-03-07 20:16     ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-03-07 11:26 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Rasmus <rasmus@gmx.us> writes:
>
>> When writing plain text I might write something like:
>>
>> See foo[fn:1] 
>>
>> [fn:1] http://orgmode.org/\\
>>        http://www.gnu.org/software/emacs/
>>
>> This is exported as:
>>
>> See foo[1]
>>
>> Footnotes
>> ─────────
>>
>> [1] [http://orgmode.org/]
>>        [http://www.gnu.org/software/emacs/]
>
> This should be fixed. Expected indentation is:
>
>
>   [1] [http://orgmode.org/]
>   [http://www.gnu.org/software/emacs/]

No.  In a normal paragraph when I do

para1\\
     para2

The whitespace indentation is respected.  All I'm saying that when I do
something equivalent in a footnote the amount of characters removed from
the first list (typically 3: "fn:") should also be removed from subsequent
lines.  E.g.

[fn:1] http://orgmode.org/\\
       http://www.gnu.org/software/emacs/

Becomes:

[1] http://orgmode.org/\\
       http://www.gnu.org/software/emacs/

But 

[fn:1] http://orgmode.org/ long text here
http://www.gnu.org/software/emacs/

Becomes 

[1] http://orgmode.org/ long text here
http://www.gnu.org/software/emacs/


> You mean this this indentation scheme for footnotes
>
>   [1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
>       eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
>       minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
>       ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
>       voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
>       sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
>       mollit anim id est laborum.
>
> instead of
>
>   [1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
>   eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
>   minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
>   ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
>   voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
>   sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
>   mollit anim id est laborum.


I would want the first scheme if I typed in my footnote as 

[fn:1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
       eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
       minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip

And the second if I typed:

[fn:1] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enimad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip

Does it make sense?

—Rasmus 

-- 
The Kids call him Billy the Saint

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ox-ascii, bug?] aligning text withing footnotes
  2015-03-07 11:26   ` Rasmus
@ 2015-03-07 20:16     ` Nicolas Goaziou
  2015-03-08  2:18       ` Rasmus
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2015-03-07 20:16 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> No.  In a normal paragraph when I do
>
> para1\\
>      para2
>
> The whitespace indentation is respected.  All I'm saying that when I do
> something equivalent in a footnote the amount of characters removed from
> the first list (typically 3: "fn:") should also be removed from subsequent
> lines.  E.g.
>
> [fn:1] http://orgmode.org/\\
>        http://www.gnu.org/software/emacs/
>
> Becomes:
>
> [1] http://orgmode.org/\\
>        http://www.gnu.org/software/emacs/
>
> But 
>
> [fn:1] http://orgmode.org/ long text here
> http://www.gnu.org/software/emacs/
>
> Becomes 
>
> [1] http://orgmode.org/ long text here
> http://www.gnu.org/software/emacs/

It is difficult to know the indentation of the first line from the parse
tree. Both

  [fn:1] http://orgmode.org/

and

  [fn:1]       http://orgmode.org

will appear as "http://orgmode.org" anyway. We could compute it by
subtracting footnote's beginning position from paragraph's. However, we
cannot trust such positions as they might be fake, or even not there
(elements inserted right into the parse tree).

You can use a verse block to align properly links, if you want to.


Regards,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ox-ascii, bug?] aligning text withing footnotes
  2015-03-07 20:16     ` Nicolas Goaziou
@ 2015-03-08  2:18       ` Rasmus
  2015-03-08 16:21         ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-03-08  2:18 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Rasmus <rasmus@gmx.us> writes:
>
>> No.  In a normal paragraph when I do
>>
>> para1\\
>>      para2
>>
>> The whitespace indentation is respected.  All I'm saying that when I do
>> something equivalent in a footnote the amount of characters removed from
>> the first list (typically 3: "fn:") should also be removed from subsequent
>> lines.  E.g.
>>
>> [fn:1] http://orgmode.org/\\
>>        http://www.gnu.org/software/emacs/
>>
>> Becomes:
>>
>> [1] http://orgmode.org/\\
>>        http://www.gnu.org/software/emacs/
>>
>> But 
>>
>> [fn:1] http://orgmode.org/ long text here
>> http://www.gnu.org/software/emacs/
>>
>> Becomes 
>>
>> [1] http://orgmode.org/ long text here
>> http://www.gnu.org/software/emacs/
>
> It is difficult to know the indentation of the first line from the parse
> tree. Both
>
>   [fn:1] http://orgmode.org/
>
> and
>
>   [fn:1]       http://orgmode.org
>
> will appear as "http://orgmode.org" anyway. We could compute it by
> subtracting footnote's beginning position from paragraph's. However, we
> cannot trust such positions as they might be fake, or even not there
> (elements inserted right into the parse tree).

What I want to do is simpler.  I want to subtract the length between [1]
and [fn:1] from every line between :begin and :end of the
footnote-definition.  Differences other than the three character
difference between [fn:1] and [1] I don't care about.

–Rasmus

-- 
When in doubt, do it!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ox-ascii, bug?] aligning text withing footnotes
  2015-03-08  2:18       ` Rasmus
@ 2015-03-08 16:21         ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2015-03-08 16:21 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Rasmus <rasmus@gmx.us> writes:

> What I want to do is simpler.  I want to subtract the length between [1]
> and [fn:1] from every line between :begin and :end of the
> footnote-definition.  Differences other than the three character
> difference between [fn:1] and [1] I don't care about.

This is not simpler. Exporting works on top of a parse tree, not the
current buffer. Global indentation is removed before "ox-ascii" even
sees it.

Regards,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-08 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 23:31 [ox-ascii, bug?] aligning text withing footnotes Rasmus
2015-03-07  1:12 ` Nicolas Goaziou
2015-03-07 11:26   ` Rasmus
2015-03-07 20:16     ` Nicolas Goaziou
2015-03-08  2:18       ` Rasmus
2015-03-08 16:21         ` Nicolas Goaziou

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).