Skip to content

Commit

Permalink
readme: add some useful notes
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Jan 8, 2024
1 parent 55d29a2 commit 41ef5c4
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Matematyka

Przed Państwem kod źródłowy mojej strony z notatkami z matematyki.
Zapraszam do oglądania i komentowania!

## Thing about PDF customization

<details><summary>Start here later</summary>


ChatGPT
To customize the title page generated by Sphinx when creating a PDF via make latexpdf, you can modify the LaTeX template used for the title page. Sphinx allows you to override the default LaTeX templates by providing your own custom template.

Follow these steps to customize the title page:

Step 1: Locate Sphinx's LaTeX Template Files
Find the sphinx directory in your Python installation. You can usually locate it within the site-packages directory of your Python environment.

Inside the sphinx directory, navigate to texinputs.

Step 2: Copy Default Template
Locate the sphinxmanual.cls or sphinxhowto.cls file (depending on the type of document you're generating).

Copy this file to your Sphinx documentation project directory. Name the copied file something like custom_sphinxmanual.cls to avoid confusion.

Step 3: Modify the Title Page in the Copied Template
Open the copied file (custom_sphinxmanual.cls) in a text editor and find the section related to the title page. It might look something like this:

latex
Copy code
\renewcommand{\maketitle}{
% Title page contents...
}
Modify the contents within the \maketitle command to customize the title page. You can change the layout, add or remove elements, or alter formatting as needed.

Step 4: Use the Custom Template
In your conf.py file in the Sphinx project directory, add or modify the latex_elements variable to specify the use of the custom template:

python
Copy code
latex_elements = {
'papersize': 'letterpaper',
'pointsize': '10pt',
'classoptions': ',openany',
'babel': '\\usepackage[english]{babel}',
'preamble': '\\input{preamble.tex}',
'sphinxsetup': 'VerbatimBorderColor={rgb}{1,1,1}',
'maketitle': '\\input{custom_sphinxmanual.cls}', # Use the custom template
}
Replace 'custom_sphinxmanual.cls' with the name of your custom template file.

Step 5: Generate the PDF
Regenerate the documentation using make clean followed by make latexpdf. This will use the modified template to generate the PDF, including the customized title page.

Ensure to adjust the LaTeX commands in the copied file (custom_sphinxmanual.cls) as per your requirements. This method allows you to have full control over the title page layout and contents in your Sphinx-generated PDF.

</details>

0 comments on commit 41ef5c4

Please sign in to comment.