Created
February 18, 2023 14:56
-
-
Save ram1123/452cf3b68e60c4698f1636feb9b15483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Specify the directory containing the PDF files | |
pdf_dir = '/afs/cern.ch/user/r/rasharma/work/LearnCombine/CMSSW_11_3_4/src/2l2Q_limitSettingTool/ImpactPlotCollection/' | |
# Get a list of the PDF files in the directory | |
pdf_files = [f for f in os.listdir(pdf_dir) if f.endswith('.pdf')] | |
# Create a LaTeX file for the presentation | |
with open('presentation.tex', 'w') as f: | |
f.write('\\documentclass{beamer}\n') | |
f.write('\\usepackage{graphicx}\n') | |
f.write('\\begin{document}\n') | |
# Loop over the PDF files and create a slide for each one | |
for pdf_file in pdf_files: | |
# Add a slide to the presentation with the PDF file and slide title | |
slide_title = pdf_file.replace('.pdf', '').replace('_', ' ') | |
f.write('\\begin{frame}\n') | |
f.write('\\frametitle{%s}\n' % slide_title) | |
f.write('\\includegraphics[width=\\textwidth]{%s}\n' % os.path.join(pdf_dir, pdf_file)) | |
f.write('\\end{frame}\n') | |
f.write('\\end{document}\n') | |
# Compile the LaTeX file to create the PDF presentation | |
os.system('pdflatex presentation.tex') | |
os.system('rm -f *.tex *.out *.snm *.aux *.nav *.toc *.log') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link this with : https://github.com/ram1123/PPT_script/tree/develop