- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Multi-line .. function:: directive has big vertical spacing in Latexpdf #9924
Comments
I don't immediately know how to fix it, but as far as I can see the reason for the difference is that the C++ domain outputs functions as multi-line declarations (e.g., for templates), and the Latex styles have some more spacing. .. py:function:: __dpd_addsd3 (a, b)
__bid_addsd3 (a, b)
__dpd_adddd3 (a, b)
__bid_adddd3 (a, b)
__dpd_addtd3 (a, b)
__bid_addtd3 (a, b)
something
.. cpp:function:: _Decimal32 __dpd_addsd3 (_Decimal32 a, _Decimal32 b)
_Decimal32 __bid_addsd3 (_Decimal32 a, _Decimal32 b)
_Decimal64 __dpd_adddd3 (_Decimal64 a, _Decimal64 b)
_Decimal64 __bid_adddd3 (_Decimal64 a, _Decimal64 b)
_Decimal128 __dpd_addtd3 (_Decimal128 a, _Decimal128 b)
_Decimal128 __bid_addtd3 (_Decimal128 a, _Decimal128 b)
something
.. cpp:function:: template<typename T> \
_Decimal32 __dpd_addsd3 (_Decimal32 a, _Decimal32 b)
template<typename T> \
_Decimal32 __bid_addsd3 (_Decimal32 a, _Decimal32 b)
template<typename T> \
_Decimal64 __dpd_adddd3 (_Decimal64 a, _Decimal64 b)
template<typename T> \
_Decimal64 __bid_adddd3 (_Decimal64 a, _Decimal64 b)
template<typename T> \
_Decimal128 __dpd_addtd3 (_Decimal128 a, _Decimal128 b)
template<typename T> \
_Decimal128 __bid_addtd3 (_Decimal128 a, _Decimal128 b)
something
.. option:: -mmmx
-msse
-msse2
something |
The too large vertical spacing from C++ function declarations originate in each signature generating a sphinx/sphinx/writers/latex.py Lines 734 to 752 in edd1478
@jakobandersen is this something that could be modified in C++ domain compared to Python domain? Perhaps the The too small spacing in Python domain is something else for which I will make a bugfix PR soon. |
The .. function:: sig1
Content1
.. function:: sig2
Content2 creates something like the following (lots of inner details omitted) <desc>
<desc_signature>sig1</desc_signature>
<desc_content>Content1</desc_content>
</desc>
<desc>
<desc_signature>sig2</desc_signature>
<desc_content>Content2</desc_content>
</desc> At the next level you have .. function:: sig1
sig2
Content1and2 creates something like <desc>
<desc_signature>sig1</desc_signature>
<desc_signature>sig2</desc_signature>
<desc_content>Content1and2</desc_content>
</desc> As default a The third level is optional (for backwards compatibility). If a .. cpp:function:: template<typename T> \
void f1()
template<typename T> \
void f2()
Content1and2 creates something like <desc>
<desc_signature is_multiline=True>
<desc_signature_line>"template<typename T>"</desc_signature_line>
<desc_signature_line>"void f1()"</desc_signature_line>
</desc_signature>
<desc_signature is_multiline=True>
<desc_signature_line>"template<typename T>"</desc_signature_line>
<desc_signature_line>"void f2()"</desc_signature_line>
</desc_signature>
<desc_content>Content1and2</desc_content>
</desc> So I guess the spacing should be:
|
I should have said more explicitly that the problem on latex side is that rather than a single |
@jfbu Are planning working on that, I noticed the C++ domain is still affected? Thanks. |
As described in the issue, there is a pair of `\pysigstartmultiline/\pysigstopmultiline` for each `desc_signature` element and thus there is extra spacing when multiple functions are documented. Fixes: sphinx-doc#9924.
As described in the issue, there is a pair of `\pysigstartmultiline/\pysigstopmultiline` for each `desc_signature` element and thus there is extra spacing when multiple functions are documented. Fixes: sphinx-doc#9924.
As described in the issue, there is a pair of `\pysigstartmultiline/\pysigstopmultiline` for each `desc_signature` element and thus there is extra spacing when multiple functions are documented. Fixes: sphinx-doc#9924.
This fixes sphinx-doc#9924 Removes sphinx-doc#9941 complex LaTeX macros, which incidentally had broken effect of sphinx-doc#9946 on issue sphinx-doc#9926, as they become unneeded after the refactoring of \pysigline/\pysiglinewithargs expansion context.
This fixes sphinx-doc#9924 Removes sphinx-doc#9941 complex LaTeX macros, which incidentally had broken effect of sphinx-doc#9946 on issue sphinx-doc#9926, as they become unneeded after the refactoring of \pysigline/\pysiglinewithargs expansion context.
Describe the bug
Is wrongly rendered in Latexpdf:

While it correctly works for
.. option
directive:How to Reproduce
make latexpdf
for the provided snippetExpected behavior
No response
Your project
snippet provided
Screenshots
No response
OS
Linux
Python version
3.8
Sphinx version
4.3.0
Sphinx extensions
No response
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: