bugGNU Octave - Bugs: bug #66459, missing space in "doc"s...

 
 

bug #66459: missing space in "doc"s inline equations

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Tue 19 Nov 2024 05:56:50 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 9.2.0 Operating System:  * Any
Fixed Release:  9.3.0 Planned Release:  9.3.0
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Jump to the original submission

Sat 23 Nov 2024 09:30:17 PM UTC, comment #10: 

Sadly, it seems that the @w macro doesn't work for more than just inline equations.  Any instance, such as


install.texi:844:automatically set the Makefile variable @w{@env{F77_INTEGER_8_FLAG}} to


fails to include a space.  And instances of the macro are not just in the m-files, but also in C++ files, .txi files in doc/interpreter, and even in helper scripts such as genpropdoc.m.

I think I found most of them and corrected them in this changeset on the stable branch: https://hg.savann ... /rev/9bcdc88803c1

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Thu 21 Nov 2024 07:54:11 PM UTC, comment #9: 

@Markus: Thanks for pushing. Indeed I worked on the default branch.

@koerhen: Since Texinfo's html output is made of very basic html syntax, the Octave developers have chosen to rely on a QTextBrowser which supports a reasonable subset of html (see https://doc.qt.io ... -html-subset.html) and has been satisfactory, up to now. In this particular case, the QTextBrowser doesn't display the white space after the comment (maybe because of the interaction between the comment and the previous code tag or ... I don't know). Using a full featured QWebView would probably fix that (and allow for the display of more complex html pages, e.g. our doxygen documentation) but that would probably be much work which nobody did...

Pantxo Diribarne <pantxo>
Group Member
Thu 21 Nov 2024 05:41:46 PM UTC, comment #8: 

Thanks.
Pushed to the stable branch:
https://hg.savann ... /rev/75c6b90775c6

I guess you created the patch against the default branch. There were some conflicts when I applied it on the stable branch. And then again when merging to the default branch.
I hope I resolved those correctly.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 21 Nov 2024 04:43:20 PM UTC, comment #7: 

Just my penny of thoughts and feel free to ignore:
Using a `@ ` (force white space) seems to be a workaround solution as in the normal browser it works well and as the pdf is correct.

The html itself also seems ok (I am not a html expert though):

<p>This function and <code class="code"><var class="var">A</var>&nbsp;\&nbsp;<var class="var">B</var></code><!-- /@w --> are equivalent.
</p>

A normal (leading) space exist after the comment tag "<!..-->" and before " are equivalent", so the comment tag could be the culprit that the Octave gui html viewer ignores the leading space for "are equivalent".

Finding the root cause in the Octave Gui viewer may be a better solution (I have no clue how the octave gui works and how complex it is to find, though - I only have some insights of the octave core - so feel free to ignore my penny of thoughts).

Hendrik K <koerhen>
Wed 20 Nov 2024 07:07:38 PM UTC, comment #6: 

I attached the patch.

(file #56635)

Pantxo Diribarne <pantxo>
Group Member
Wed 20 Nov 2024 12:30:57 PM UTC, comment #5: 

Ok I found much more occurences in scripts:


$ grep -rl "@w{@.*code{.*}} " scripts/
scripts/help/bessel.m
scripts/help/__unimplemented__.m
scripts/image/imagesc.m
scripts/image/image.m
scripts/signal/movslice.m
scripts/signal/movfun.m
scripts/special-matrix/hadamard.m
scripts/plot/draw/fplot.m
scripts/general/trapz.m
scripts/general/interp2.m
scripts/general/cumtrapz.m
scripts/general/rescale.m
scripts/sparse/speye.m
scripts/sparse/pcg.m
scripts/sparse/bicg.m
scripts/ode/ode23.m
scripts/ode/ode45.m
scripts/ode/ode15s.m
scripts/ode/ode23s.m
scripts/ode/ode15i.m


I am preparing a cset adding a `@ ` at the end of those patterns.

Pantxo Diribarne <pantxo>
Group Member
Tue 19 Nov 2024 10:02:06 PM UTC, comment #4: 

I noticed that the space after B is only absent on the html doc as displayed by our doc viewer. In the text version (after "help ldivide"), the pdf version, and the html displayed with an external web browser, the space character is present. This may be due to the limited html support of the QTextWidget we use for the doc browser.

Adding a `@ ` (force white space) command seems to fix the doc browser display without affecting the others.

I searched for other places where this missing white space could occur but didn't find any (searched for "@w{@code{...}} something.")

Pantxo Diribarne <pantxo>
Group Member
Tue 19 Nov 2024 03:24:10 PM UTC, comment #3: 

whether or not that is the best approach, there are others outlined here:
https://tex.stack ... er-latex-commands

Nicholas Jankowski <nrjank>
Group Member
Tue 19 Nov 2024 02:58:40 PM UTC, comment #2: 

yes, it looks like all of the commands on that page with a similar example produce "Bare"

when working on the graphics property pages, we had to add @: after a number of @command{} to keep it from eating the trailing whitespace.  that may also work here.

Nicholas Jankowski <nrjank>
Group Member
Tue 19 Nov 2024 09:43:04 AM UTC, comment #1: 

Confirmed. The original unformatted help string (in data.cc) does contain a space character:


This function and @w{@tcode{@var{A} .@backslashchar{} @var{B}}} are equivalent.


Pantxo Diribarne <pantxo>
Group Member
Tue 19 Nov 2024 05:56:50 AM UTC, original submission:  

E.g. doing "doc ldivide" (and the following functions) I see:

This function and A .\ Bare equivalent

(No space between "B" and "are")
(see attached screenshot).
I suspect there are more places like that.
Not sure if this is an issue with the recent texinfo or w/ octave's source.
I see it on Fedora 41 and MacOS and on octave 8.4, 9.2, and 10.0.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

Attached Files

Attached Files
file #56635:  bug66459.patch added by pantxo (46KiB - text/x-patch)

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by koerhen (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    History

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-23 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 9.3.0
    2024-11-21 mmuetzel StatusPatch Submitted Ready For Test
        Releaseother 9.2.0
        Planned ReleaseNone 9.3.0
    2024-11-20 pantxo Attached File- Added bug66459.patch, #56635
        StatusConfirmed Patch Submitted
    2024-11-19 pantxo StatusNone Confirmed
    2024-11-19 dasergatskov Attached File- Added Screenshot@2024-11-19@at@00.45.56.png, #56626

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code