This Bash script simplifies the process of converting LaTeX files with embedded PDF graphics, often created with the pdf_tex feature in tools like Inkscape or Illustrator, into standalone PDF files with custom font settings. It's particularly useful when you need to prepare figures before importing into Latex.
- Converts LaTeX files with embedded PDF graphics to standalone PDFs.
- Allows customization of the font family for the resulting PDFs.
- Removes auxiliary files generated during the conversion process.
Before using this script, ensure you have the following installed on your system:
- Bash shell
pdflatex(LaTeX compiler)- LaTeX packages:
graphicx,color, andmathptmx(Times font)
- Place your LaTeX files with embedded PDF graphics (
.pdf_tex) in the same directory as the script. - Edit the
font_familyvariable in the script to set your desired font family (e.g., "times", "helvet", "palatino"). - Run the script:
./pdf_tex_converter.sh- The script locates all
.pdf_texfiles in the current directory. - For each
.pdf_texfile found, it creates a new.texfile with the embedded PDF and custom font settings. - The script compiles the new
.texfile into a standalone PDF usingpdflatex. - The resulting PDF is renamed to match the original file and moved up one directory.
- Auxiliary files generated during the conversion process are removed.
You can easily customize the script by modifying the font_family variable to change the font family applied to the resulting PDFs.
Note: This script assumes that you have the necessary LaTeX packages installed to handle the desired font family. Make sure your LaTeX distribution includes the appropriate fonts or adjust the script to your specific font requirements.
This script is provided under the MIT License.
[Your Name]
If you find this script helpful or have suggestions for improvements, please feel free to contribute or provide feedback.
Disclaimer: Use this script responsibly and ensure that you have the appropriate permissions to convert and distribute PDF files created by others.