[PATCH 01/13] docs: conf.py: fix sphinx version detection for margin set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The PDF generator has a logic to detect the proper way to
setup the page margins. By default, the page has about
14.8 cm, which is too short to display some tables and literal
blocks. So, previous patches changed it to be around 17.5 cm,
but the logic only works with Sphinx version 1.x.x.

Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
---
 Documentation/conf.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index ed2b43ec7754..66e121df59cd 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -375,9 +375,10 @@ if cjk_cmd.find("Noto Sans CJK SC") >= 0:
 if major == 1 and minor > 3:
     latex_elements['preamble']  += '\\renewcommand*{\\DUrole}[2]{ #2 }\n'
 
+# Set page margins
 if major == 1 and minor <= 4:
     latex_elements['preamble']  += '\\usepackage[margin=0.5in, top=1in, bottom=1in]{geometry}'
-elif major == 1 and (minor > 5 or (minor == 5 and patch >= 3)):
+elif (major == 1 and (minor > 5 or (minor == 5 and patch >= 3))) or (major > 1):
     latex_elements['sphinxsetup'] = 'hmargin=0.5in, vmargin=1in'
     latex_elements['preamble']  += '\\fvset{fontsize=auto}\n'
 
-- 
2.29.2




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux