emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Account for latex snippet width in fill paragraph
@ 2021-02-09  6:43 Matt Huszagh
  2021-02-09  9:46 ` Eric S Fraga
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Huszagh @ 2021-02-09  6:43 UTC (permalink / raw)
  Cc: emacs-orgmode

Hello,

I make extensive use of inline latex image snippets in my Org
buffers. One thing that has annoyed me for a while is that
`org-fill-paragraph' (unsurprisingly) uses the width of the underlying
text when determining the characters which make up each line. Because
the characters which make up the source of an image are typically wider
than the image itself, this creates short lines when many snippets are
used. For example, the following text

```
This gives some degree of temperature-stability because although
\(V_{\mathrm{BE}}\) changes somewhat with temperature, the change is
small. If the quiescent output voltage is designed for say
\(10V_{\mathrm{BE}}\), and \(V_{\mathrm{BE}}\) varies \(\SI{0.1}{V}\)
over temperature changes, then the quiescent point will vary
\(\SI{1}{V}\) over temperature changes. This isn't great, but may
sometimes be good enough.
```

appears something like

```
This gives some degree of temperature-stability because although
VBE changes somewhat with temperature, the change is
small. If the quiescent output voltage is designed for say
10VBE, and VBE varies 0.1V
over temperature changes, then the quiescent point will vary
1V over temperature changes. This isn't great, but may
sometimes be good enough.
```

Before I take a crack at this, has anyone else attempted to remedy this?
I wasn't able to find anything on the mailing list. Would anyone else be
interested in this functionality? I figure a proper solution would
appear to the user as a configurable variable that could enable filling
based on image width (this behavior might be undesirable in some
cases). My currently uninformed view is that it should be possible to
query the overlay image width and perform a fill based on that. Any
thoughts, concerns, etc. are appreciated.

Matt


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

* Re: Account for latex snippet width in fill paragraph
  2021-02-09  6:43 Account for latex snippet width in fill paragraph Matt Huszagh
@ 2021-02-09  9:46 ` Eric S Fraga
  2021-02-09  9:58   ` Diego Zamboni
  2021-02-09 15:53   ` Matt Huszagh
  0 siblings, 2 replies; 4+ messages in thread
From: Eric S Fraga @ 2021-02-09  9:46 UTC (permalink / raw)
  To: Matt Huszagh; +Cc: emacs-orgmode

On Monday,  8 Feb 2021 at 22:43, Matt Huszagh wrote:
> Before I take a crack at this, has anyone else attempted to remedy this?

I don't have this issue because I use visual-line-mode (together with
org-indent-mode) and text reflows automatically.  Every paragraph is a
single "line" in the org file but is (soft) wrapped automatically at the
window edge.  But this may not suit you, of course.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-213-g49364f


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

* Re: Account for latex snippet width in fill paragraph
  2021-02-09  9:46 ` Eric S Fraga
@ 2021-02-09  9:58   ` Diego Zamboni
  2021-02-09 15:53   ` Matt Huszagh
  1 sibling, 0 replies; 4+ messages in thread
From: Diego Zamboni @ 2021-02-09  9:58 UTC (permalink / raw)
  To: Matt Huszagh, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

I can only agree with Eric - I think visual-line-mode is the best way to
deal with variable-length content in paragraphs.

--Diego

On Tue, Feb 9, 2021 at 10:47 AM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> On Monday,  8 Feb 2021 at 22:43, Matt Huszagh wrote:
> > Before I take a crack at this, has anyone else attempted to remedy this?
>
> I don't have this issue because I use visual-line-mode (together with
> org-indent-mode) and text reflows automatically.  Every paragraph is a
> single "line" in the org file but is (soft) wrapped automatically at the
> window edge.  But this may not suit you, of course.
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-213-g49364f
>
>

[-- Attachment #2: Type: text/html, Size: 1046 bytes --]

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

* Re: Account for latex snippet width in fill paragraph
  2021-02-09  9:46 ` Eric S Fraga
  2021-02-09  9:58   ` Diego Zamboni
@ 2021-02-09 15:53   ` Matt Huszagh
  1 sibling, 0 replies; 4+ messages in thread
From: Matt Huszagh @ 2021-02-09 15:53 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: , emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I don't have this issue because I use visual-line-mode (together with
> org-indent-mode) and text reflows automatically.  Every paragraph is a
> single "line" in the org file but is (soft) wrapped automatically at the
> window edge.  But this may not suit you, of course.

This works very well. Thanks for the suggestion!

Matt


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

end of thread, other threads:[~2021-02-09 15:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  6:43 Account for latex snippet width in fill paragraph Matt Huszagh
2021-02-09  9:46 ` Eric S Fraga
2021-02-09  9:58   ` Diego Zamboni
2021-02-09 15:53   ` Matt Huszagh

Code repositories for project(s) associated with this 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).