When writing academic papers, I often find that journals want a single PDF file for initial submission. This PDF file includes the document, graphics and tables.
I use Microsoft Word to write papers since the software supports Zotero and is WYSIWYG. The Word files can also be easily shared with another author who also uses Windows and Word.
If I was writing just for myself, I would probably use LaTeX for the programmable features and Lyx for the frontend, but I digress.
I tend to initially structure the paper using multiple files:
- Main Document
- Anything else (i.e. Appendices)
If I make a change to a file, I then have to export each file as a PDF and concatenate them together. This is tedious to do by hand.
Over time, I've developed a script-based workflow. The sh script posted below uses a Python library and command-line utility docx2pdf to manually convert all Word documents in a directory. Then, I use the mpdf utility that I wrote myself to merge the PDF files together. The example below assumes that the mpdf utility has been added to the path.
docx2pdf ./ &&
mpdf 1.pdf 2.pdf 3.pdf 4.pdf out.pdf
The shebang is at the top of the file, the rm command removes all PDF files currently in the directory (for good measure), the docx2pdf utility converts all of the Word documents to PDFs, and the mpdf utility concatenates the files.
If the mpdf utility is not on your path, then you can add the Python script to the folder and using Python3, run:
python3 mpdf.py 1.pdf 2.pdf 3.pdf 4.pdf out.pdf
On Windows, the
python3 executable might be named
python for 32-bit installs of the Python language. Install the 64-bit version of Python on Windows and the executable will be named
python3. On Mac OS X and versions of GNU/Linux, the python executable is usually named
The shell script can be run using the excellent cmdir console emulator for Windows.