Hello,
I have this activity that I require help in, and was wondering if the community can help me in figuring out this task.
I have 2 folders. Folder one contains document 1 (in pdf and doc/docx) while Folder 2 contains document 2 (in pdf).
I need to convert document files to pdf then use latex to append the two documents to save one consolidated document in any folder (preferably a new folder). I wrote a pseudo code for now
For this task I am using Texstudio, Miktex and Stata. Essentially the code has to convert word files to pdf, open a blank tex file, write latex code, use the package pdfpages and append two documents. In the end, I invoke Texstudio to convert tex to pdf
I will really appreciate if someone can help me troubleshoot and review this code.
This for me is a time sensitive task so if you need me to assist you in providing further details, then feel free to ask.
I have this activity that I require help in, and was wondering if the community can help me in figuring out this task.
I have 2 folders. Folder one contains document 1 (in pdf and doc/docx) while Folder 2 contains document 2 (in pdf).
I need to convert document files to pdf then use latex to append the two documents to save one consolidated document in any folder (preferably a new folder). I wrote a pseudo code for now
Code:
ssc install fs, replace * This code converts all text files to pdf inside a folder in the current directory cd "C:/Users/Fahad Mirza/Desktop/Test" local folder = "./cover/" local files : dir "." files "*.doc*" foreach file of local files { docx2pdf `"`file'"' local name = substr(`"`files'"', 2, strpos(`"`files'"',".")-2) file open fh using "`name'.tex", replace write file write fh \documentclass{article} file write fh _n \usepackage{pdfpages} file write fh _n \begin{document} file write fh _n \includepdf[fitpaper=true, pages=-]{"`name'.pdf"} fs "`folder'*`name'*" file write fh _n \newpage file write fh _n \includepdf[fitpaper=true, pages=-]{"`name'.pdf"} file write fh _n \end{document} * Ending Tex File file close fh type "`name'.tex" pause cd "C:/Users/Fahad Mirza/Desktop/Test" // Texifying -- This invokes tex studio !texify -p -c -b --run-viewer "`name'.tex" pause }
I will really appreciate if someone can help me troubleshoot and review this code.
This for me is a time sensitive task so if you need me to assist you in providing further details, then feel free to ask.
Comment