Skip to content

Commit b62efd2

Browse files
committed
refactor(preprocess.py): use general variable name
1 parent 825cdf3 commit b62efd2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

vrdu/preprocess.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,19 @@ def replace_pdf_figures_with_png(original_tex: str) -> None:
135135

136136
# Replace PDF paths with PNG paths
137137
for match in matches:
138-
pdf_image_name = match[1]
139-
pdf_image = os.path.join(
140-
main_directory, os.path.join(graphic_path, pdf_image_name)
138+
image_name = match[1]
139+
image_file = os.path.join(
140+
main_directory, os.path.join(graphic_path, image_name)
141141
)
142-
if not os.path.exists(pdf_image):
143-
raise FileNotFoundError(f"File not found: {pdf_image}")
142+
if not os.path.exists(image_file):
143+
raise FileNotFoundError(f"File not found: {image_file}")
144144

145-
png_image_name = os.path.splitext(pdf_image_name)[0] + ".png"
145+
png_image_name = os.path.splitext(image_name)[0] + ".png"
146146
png_image = os.path.join(
147147
main_directory, os.path.join(graphic_path, png_image_name)
148148
)
149149

150-
utils.convert_pdf_figure_to_png_image(pdf_image, png_image)
150+
utils.convert_pdf_figure_to_png_image(image_file, png_image)
151151

152152
# replace the reference in tex file
153153
content = content.replace(match[1], png_image_name)

0 commit comments

Comments
 (0)