-1

I've tried to write own rst-classes and apply it to H1, H2 (headers like ====== or ~~~~~~~) and it works good when I make html. But in PDF it looks like headers, it is unexpected.

Please help me to solve this problem. I need to provide my report with good title page for my university but I don't know how to do it in ReST.

P.s. Sorry for my english, I'm russian =)

enter image description here

In the PDF here https://docdro.id/NRaWdDf each part is on its own page, like this

enter image description here

and the Contents.rst is at https://github.com/greenstm137/RWOfStudents/blob/4c8153969ed4d7e8de937d0ae33ccbaa7af03cdd/source/contents.rst

mzjn
  • 48,958
  • 13
  • 128
  • 248
  • If you want fine control over LaTeX formatting, you should write LaTeX directly, not in reStructuredText or ReST that wraps over and hides all the details. There isn't much to discuss as the only feasible way to heavily customize the conversion is to dive into the source code of sphinx, which goes far beyond a normal question here. – Lex Li Dec 18 '21 at 06:27
  • @john-hen where can I find any info how to use these "raw" LaTeX commands in sphinx? – greenstm Dec 18 '21 at 10:55
  • @john-hen okay, thank you, I'll try if noone helps me – greenstm Dec 18 '21 at 11:17
  • @john-hen Do you know can I solve this problem using "styles"? My scientific supervisor said me to try this way, but I didn't find any suitable info how to do it. – greenstm Dec 18 '21 at 13:25

1 Answers1

0

You might want to add raw latex code to center it. Try this:


|lstartcenter| My Text is Centered! Cool! |lendcenter|

.. |lstartcenter| raw:: latex
     \begin{center}

.. |lendcenter| raw:: latex
      \end{center}
    

This code sets a start and an end tag with "raw:: latex" which inserts raw latex code if you compile it to latex.

"|lstartcenter|" starts making it centered, while "|lendcenter|" ends centering it.

Max Lange
  • 15
  • 6