emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* visual-line-mode don't play well with org-latex-preview
@ 2023-02-27 17:14 chris
  2023-03-02 19:00 ` Bruno Barbier
  0 siblings, 1 reply; 5+ messages in thread
From: chris @ 2023-02-27 17:14 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

```
hello hello hello hello hello hello hello hello hello hello hello hello hello 
hello hello      \(\text {hello hello hello hello hello hello hello hello}\)
```

If you put the above text in a org file, and activate `visual-line-mode` and 
`org-latex-preview`, depending on the length of the initial part of the text, 
the generated png/svg image from latex expression can be displayed in full, 
partially hidden or totally hidden.

That certainly hinder readability.

I've search the web to see if someone else did stumbled on that but haven't 
found anything yet.

Sure enough there isn't an obvious fix that would deal with every cases, like 
when the image is longer that the width of the window of the max column of 
`visual-column-mode`. At least there are different cases to consider.

Best,
Chris




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

* Re: visual-line-mode don't play well with org-latex-preview
  2023-02-27 17:14 visual-line-mode don't play well with org-latex-preview chris
@ 2023-03-02 19:00 ` Bruno Barbier
  2023-03-06 17:02   ` chris
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Barbier @ 2023-03-02 19:00 UTC (permalink / raw)
  To: chris, emacs-orgmode


Hi Chris,

chris <inkbottle007@gmail.com> writes:

> Hi all,
>
> ```
> hello hello hello hello hello hello hello hello hello hello hello hello hello 
> hello hello      \(\text {hello hello hello hello hello hello hello hello}\)
> ```
>
> If you put the above text in a org file, and activate `visual-line-mode` and 
> `org-latex-preview`, depending on the length of the initial part of the text, 
> the generated png/svg image from latex expression can be displayed in full, 
> partially hidden or totally hidden.
>

I'm observing the same behavior.

The preview is not always fully visible.  But, after adding some text
(at least one space after the preview), Emacs wraps as needed, so that
the preview remains visible.  Emacs is just not wrapping correctly in
that edge case, where there is nothing at all after the latex preview.

The behavior looks the same using only text-mode (without using org).
You should probably report this as an Emacs bug (see M-x
report-emacs-bug).

Bruno


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

* Re: visual-line-mode don't play well with org-latex-preview
  2023-03-02 19:00 ` Bruno Barbier
@ 2023-03-06 17:02   ` chris
  2023-03-08 19:14     ` Bruno Barbier
  0 siblings, 1 reply; 5+ messages in thread
From: chris @ 2023-03-06 17:02 UTC (permalink / raw)
  To: emacs-orgmode

On Thursday, 2 March 2023 20:00:14 CET Bruno Barbier wrote:
> 
> Hi Chris,
> 
> chris <inkbottle007@gmail.com> writes:
> 
> > Hi all,
> >
> > ```
> > hello hello hello hello hello hello hello hello hello hello hello hello hello 
> > hello hello      \(\text {hello hello hello hello hello hello hello hello}\)
> > ```
> >
> > If you put the above text in a org file, and activate `visual-line-mode` and 
> > `org-latex-preview`, depending on the length of the initial part of the text, 
> > the generated png/svg image from latex expression can be displayed in full, 
> > partially hidden or totally hidden.
> >
> 
> I'm observing the same behavior.
> 
> The preview is not always fully visible.  But, after adding some text
> (at least one space after the preview), Emacs wraps as needed, so that
> the preview remains visible. 

That is a very nice workaround.

> Emacs is just not wrapping correctly in
> that edge case, where there is nothing at all after the latex preview.
> 
> The behavior looks the same using only text-mode (without using org).
> You should probably report this as an Emacs bug (see M-x
> report-emacs-bug).

What command for latex preview in text mode? (I'll probably figure that out.)

Yes, I should definitely report that bug.

Thanks a lot,
Chris

> 
> Bruno
> 






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

* Re: visual-line-mode don't play well with org-latex-preview
  2023-03-06 17:02   ` chris
@ 2023-03-08 19:14     ` Bruno Barbier
  2023-03-09  0:24       ` chris
  0 siblings, 1 reply; 5+ messages in thread
From: Bruno Barbier @ 2023-03-08 19:14 UTC (permalink / raw)
  To: chris, emacs-orgmode


Hi Chris,

chris <inkbottle007@gmail.com> writes:

> On Thursday, 2 March 2023 20:00:14 CET Bruno Barbier wrote: 
>> The behavior looks the same using only text-mode (without using org).
>> You should probably report this as an Emacs bug (see M-x
>> report-emacs-bug).
>
> What command for latex preview in text mode? (I'll probably figure that out.)
>

org-latex-preview. Why ? :-)


> Yes, I should definitely report that bug.

In case it helps you to report the bug, here is the minimal way I found
to reproduce it (no latex, no org):

     #+begin_src elisp
       (let ((b (generate-new-buffer "=bug")))
         (with-current-buffer b
           (dotimes (_ 110) (insert "Hello "))
           (insert-image (svg-image (let ((s (svg-create 250 9)))
                                   (svg-line s 0 0 250 9 :stroke-color "green")
                                   s)))
           (org-mode)
           (visual-line-mode 1)
           (pop-to-buffer b)))
     #+end_src

Bruno


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

* Re: visual-line-mode don't play well with org-latex-preview
  2023-03-08 19:14     ` Bruno Barbier
@ 2023-03-09  0:24       ` chris
  0 siblings, 0 replies; 5+ messages in thread
From: chris @ 2023-03-09  0:24 UTC (permalink / raw)
  To: emacs-orgmode

On Wednesday, 8 March 2023 20:14:53 CET Bruno Barbier wrote:
> 
> Hi Chris,
> 
> chris <inkbottle007@gmail.com> writes:
> 
> > On Thursday, 2 March 2023 20:00:14 CET Bruno Barbier wrote: 
> >> The behavior looks the same using only text-mode (without using org).
> >> You should probably report this as an Emacs bug (see M-x
> >> report-emacs-bug).
> >
> > What command for latex preview in text mode? (I'll probably figure that out.)
> >
> 
> org-latex-preview. Why ? :-)
> 
> 
> > Yes, I should definitely report that bug.
> 
> In case it helps you to report the bug, here is the minimal way I found
> to reproduce it (no latex, no org):
> 
>      #+begin_src elisp
>        (let ((b (generate-new-buffer "=bug")))
>          (with-current-buffer b
>            (dotimes (_ 110) (insert "Hello "))
>            (insert-image (svg-image (let ((s (svg-create 250 9)))
>                                    (svg-line s 0 0 250 9 :stroke-color "green")
>                                    s)))
>            (org-mode)
>            (visual-line-mode 1)
>            (pop-to-buffer b)))
>      #+end_src

Amazing,
Chris

> 
> Bruno
> 






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

end of thread, other threads:[~2023-03-09  0:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 17:14 visual-line-mode don't play well with org-latex-preview chris
2023-03-02 19:00 ` Bruno Barbier
2023-03-06 17:02   ` chris
2023-03-08 19:14     ` Bruno Barbier
2023-03-09  0:24       ` chris

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