From 2cbfca2b70caba224648d4b3d5950387b2d20dec Mon Sep 17 00:00:00 2001 From: Carsten Wulff Date: Thu, 28 Dec 2023 12:35:20 +0100 Subject: [PATCH] Fixed latex. pandoc on some systems uses includesvg, but I don't support that --- pdf/fix_svg.py | 25 ++----------------------- pdf/version.tex | 4 ++-- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/pdf/fix_svg.py b/pdf/fix_svg.py index 6c1f9f1..5d7b56c 100644 --- a/pdf/fix_svg.py +++ b/pdf/fix_svg.py @@ -19,24 +19,11 @@ def toPng(ftype,path): def toPdf(ftype,path): return imgConvert(ftype,".pdf",path) -#def toPdf(ftype,path): -# fopath = "media/"+ os.path.basename(path).replace(ftype,".pdf") -# if(not os.path.exists(fopath)): -# os.system(f"svg2pdf -o {fopath} {path}") -# return fopath - def getPath(line): m = re.findall("{([^}]+)}",line) path = m[0] return path -#tmplta = r""" -#\begin{figure}[h] -#\centering -#\includegraphics[width=\myfigwidth]{#path#} -#\end{figure} -#""" - tmplt = r""" { \centering @@ -51,16 +38,8 @@ def getPath(line): with open(foname,"w") as fo: with open(foname_png,"w") as fo_png: for line in fi: -# if(re.search("includegraphics.*\.svg}",line)): -# path = getPath(line) -# fopath = "media/"+ os.path.basename(path).replace(".svg",".pdf") -# if(not os.path.exists(fopath)): -# os.system(f"svg2pdf -o {fopath} {path}") -# line = line.replace(path,fopath) -# elif(re.search("includegraphics.*\.gif",line)): -# path = getPath(line) -# fopath = "media/"+ os.path.basename(path).replace(".gif",".png") -# line = toPng(path,fopath,line) + #- Pandoc sometimes uses includesvg instead of includegraphics + line = line.replace("includesvg","includegraphics") if(re.search("includegraphics{",line)): path = getPath(line) fopath = path diff --git a/pdf/version.tex b/pdf/version.tex index 1207a3f..a7deefe 100644 --- a/pdf/version.tex +++ b/pdf/version.tex @@ -1,2 +1,2 @@ -{\noindent Built on Thu Dec 28 11:34:47 CET 2023} \\ - {\noindent from bb8c1e150c8c017cf4cf1801be7f35ec6c2a3c4b} +{\noindent Built on Thu Dec 28 12:33:26 CET 2023} \\ + {\noindent from 9afb7966f1f868d2fb19d34b4cd663b8ef8e1be5}