Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texinfo indentation bug? #3080

Closed
mantepse opened this issue Oct 23, 2016 · 9 comments
Closed

texinfo indentation bug? #3080

mantepse opened this issue Oct 23, 2016 · 9 comments

Comments

@mantepse
Copy link

when producing texinfo documentation from

    .. RUBRIC:: Differences between ``CoordFunctionSymb`` and callable
      symbolic expressions

    Callable symbolic expressions are defined directly from symbolic

I obtain

@subsubheading Differences between @code{CoordFunctionSymb} and callable
symbolic expressions


Callable symbolic expressions are defined directly from symbolic

Is this a bug in sphinx or is there too little indentation after before symbolic expressions?

@mantepse
Copy link
Author

Sorry, I should have been more precise: the expected output for texinfo is

@subsubheading Differences between @code{CoordFunctionSymb} and callable symbolic expressions


Callable symbolic expressions are defined directly from symbolic

(it must be on one line)

@mantepse
Copy link
Author

I would like to ask yet another question in the same spirit. The sphinx source is

REFERENCES:

.. [Lee11] \J.M. Lee : *Introduction to Topological Manifolds*,
   2nd ed., Springer (New York) (2011).
.. [Lee13] \J.M. Lee : *Introduction to Smooth Manifolds*,
   2nd ed., Springer (New York) (2013)
.. [KN63] \S. Kobayashi & K. Nomizu : *Foundations of Differential Geometry*,
   vol. 1, Interscience Publishers (New York) (1963).
.. [Huybrechts05] \D. Huybrechts : *Complex Geometry*,
   Springer (Berlin) (2005).

which in texinfo becomes

REFERENCES:
@anchor{sage/manifolds/manifold lee11}@anchor{1f}@w{(Lee11)} 
J.M. Lee : @emph{Introduction to Topological Manifolds},
2nd ed., Springer (New York) (2011).
@anchor{sage/manifolds/manifold lee13}@anchor{20}@w{(Lee13)} 
J.M. Lee : @emph{Introduction to Smooth Manifolds},
2nd ed., Springer (New York) (2013)
@anchor{sage/manifolds/manifold kn63}@anchor{21}@w{(KN63)} 
S. Kobayashi & K. Nomizu : @emph{Foundations of Differential Geometry},
vol. 1, Interscience Publishers (New York) (1963).
@anchor{sage/manifolds/manifold huybrechts05}@anchor{22}@w{(Huybrechts05)} 
D. Huybrechts : @emph{Complex Geometry},
Springer (Berlin) (2005).

which in turn is the following mess in the final info-manual:

REFERENCES: (Lee11) J.M. Lee : `Introduction to Topological Manifolds',
2nd ed., Springer (New York) (2011).  (Lee13) J.M. Lee : `Introduction
to Smooth Manifolds', 2nd ed., Springer (New York) (2013) (KN63) S.
Kobayashi & K. Nomizu : `Foundations of Differential Geometry', vol.  1,
Interscience Publishers (New York) (1963).  (Huybrechts05) D. Huybrechts
: `Complex Geometry', Springer (Berlin) (2005).

The same thing looks OK in html (each reference on one line, all decorated by a vertical bar on the left). So, the question is as above: is the sphinx source bad, or does the texinfo-builder need improvements.

If the answer is the latter, could you give me a hint, where to look (I suppose I should tweak writers/texinfo.py, but which method?

@jfbu
Copy link
Contributor

jfbu commented Oct 23, 2016

for info: it looks also ok in latex PDF output

@mantepse
Copy link
Author

I found out how to solve the first problem. In writers/texinfo.py, one has to use escape_newlines:

 def visit_rubric(self, node):
        self.escape_newlines += 1
        if len(node.children) == 1 and node.children[0].astext() in \
                ('Footnotes', _('Footnotes')):
            raise nodes.SkipNode
        try:
            rubric = self.rubrics[self.section_level]
        except IndexError:
            rubric = self.rubrics[-1]
        self.body.append('\n%s ' % rubric)

    def depart_rubric(self, node):
        self.body.append('\n\n')
        self.escape_newlines -= 1   

I think one should do the same also for visit_title, but I didn't encounter such a case yet.

@mantepse
Copy link
Author

Hm, not quite, because now there are to few newlines elsewhere :-(
(in the example blocks)

@mantepse
Copy link
Author

there is a patch at https://trac.sagemath.org/ticket/21734 now. However, it still needs work.

@tk0miya tk0miya added this to the 1.8.0 milestone Sep 5, 2018
@mantepse
Copy link
Author

mantepse commented Sep 6, 2018

I updated the branch on https://trac.sagemath.org/ticket/21734 so that it's easily visible, but its been too long, so I cannot tell anymore what remains to be done...

@mantepse
Copy link
Author

mantepse commented Sep 6, 2018

I just checked, the blocker to enable a texinfo build for sagemath is issue #3089 (which has been closed because too difficult to fix).

@tk0miya tk0miya modified the milestones: 1.8.0, 1.8.1 Sep 9, 2018
@tk0miya tk0miya modified the milestones: 1.8.1, 1.8.2 Sep 20, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 8, 2018
tk0miya added a commit to tk0miya/sphinx that referenced this issue Nov 8, 2018
tk0miya added a commit that referenced this issue Nov 9, 2018
Fix #3080: multiline rubrics and citations are broken in texinfo builder
@tk0miya
Copy link
Member

tk0miya commented Nov 9, 2018

Fixed by #5600.
Thank you for reporting.

@tk0miya tk0miya closed this as completed Nov 9, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants