At the end of this script, I would like to add a few lines which would :
- compile myfile.tex, in order to update the modifications made by the previous script ;
- (produce and) eventually display myfile.pdf, which is the pdf generated by myfile.tex.
Note that I don't want TexMaker to open the LaTeX file during compilation. I had this issue when I tried a short solution using the os module and that I found on a forum ; that's why I'm searching a substitute. Moreover, I don't know how to use commands (outside of the python shell) like in this solution.
The main goal remains simplicity since the entire script (not only the few lines to add) should be readable and understandable by beginners-intermediate students, including me ;) I hope there is such a solution. If you have any idea, feel free to volunter your answer so I can test it !
EDIT : The document does not contain any reference, picture, graphs... or other complex elements. I tried to use the command pdflatex <name>.tex as suggested in the commentaries, but the PDF wasn't produced nor updated.
.texfile that you want to compile? Have you tried just calling the compiler from your script withpdflatex <name of your file>.texfor example? Or usedlatexmkif the compilation scheme is a bit more complex? I don't understand your remark about command directories. Indeed, if you want to compile a file without an editor as TeXMaker to boot, you will have to call the compiler in command line. – KersouMan Oct 19 '20 at 15:49os.system('pdflatex <relative path to your file>/<name of your file>.tex')and run this command two times if you want to correctly update potential references to labels that you might have in your document. Or switch directly toos.system('latexmk -pdf <relative path to your file>/<name of your file>.tex')if your document is more complex. – KersouMan Oct 19 '20 at 15:55