1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00
sophon/thesis/latex_index_remover.py

20 lines
749 B
Python
Raw Normal View History

2021-12-02 16:40:21 +00:00
import re
with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "r") as file:
2021-12-02 16:55:39 +00:00
print("Reading file...")
2021-12-02 16:40:21 +00:00
text = file.read()
2021-12-02 16:55:39 +00:00
print("Performing first sub...", end=" ")
text, number = re.subn(r"\\renewcommand[{]\\indexname[}][{]Indice del modulo Python[}].*?\\end[{]sphinxtheindex[}]", "", text, flags=re.DOTALL)
print(number)
print("Performing second sub...", end=" ")
text, number = re.subn(r"\\renewcommand[{]\\indexname[}][{]HTTP Routing Table[}].*?\\end[{]sphinxtheindex[}]", "", text, flags=re.DOTALL)
print(number)
2021-12-02 16:40:21 +00:00
with open("build/latex/progettazioneesviluppodisophonapplicativocloudasupportodellaricerca.tex", "w") as file:
2021-12-02 16:55:39 +00:00
print("Writing file...")
2021-12-02 16:40:21 +00:00
file.write(text)
2021-12-02 16:55:39 +00:00
print("Done!")