diff --git a/unifytex b/unifytex index e3eff72..8d83cc3 100755 --- a/unifytex +++ b/unifytex @@ -23,7 +23,11 @@ def dynamic_includes(folder_path): f.write("% Autogenerated by unifytex (git.confest.im/boyan_k/Coding_Tools/)\n") for file in sorted(files): if file.endswith(".tex"): - relative_path = os.path.relpath(os.path.join(root, file), folder_path) + relative_path = os.path.relpath( + os.path.join(root, file), + os.path.dirname(os.path.abspath(folder_path)) + ) + f.write(f"\\input{{{relative_path}}}\n") print(f"Generated {output_file}")