Closed ftilmann closed 7 years ago
Sorry, I have absolutely no idea why this fails. latexdiffcite simply calls latexdiff [tempfile1] [tempfile2]
(see run_latexdiff()), so I don't see why the result would be any different than calling latexdiff manually on the temp files.
The only thing I can think of is if you have specified some latexdiff_args
in latexdiffcite's config.
OK, I found what the problem is. At the moment latexdiff is run, the temporary files are still open, and the last part of the write is still in the buffer rather than in the filesystem. There is probably some OS dependence in the way the buffer operates, which would explain why you did not see this. The fix is easy. in latexdiffcite.py
in routine write_tex_to_temp
force the buffer to flush:
61> diff latexdiffcite.py.orig latexdiffcite.py
802c802,804
< getattr(Files, 'tex_' + oldnew + '_tmp_hndl').write(getattr(FileContents, 'tex_' + oldnew).encode('utf-8'))
---
> fh=getattr(Files, 'tex_' + oldnew + '_tmp_hndl')
> fh.write(getattr(FileContents, 'tex_' + oldnew).encode('utf-8'))
> fh.flush()
(sorry for not submitting this as a proper pull request, but I just installed latexdiffcite via pip, and have not cloned or forked the git repository - I hope that you can add to master in spite of not developing latexdiffcite any further)
New version released, try now :)
Thanks for the fast response, yes this works now.
When trying to run latexdiffcite I get the following error:
I tried creating a log file but there did not seem to be anything amiss, so I won't post. Bizarrely, if I run interactively
latexdiff /tmp/tmp_old_yrB3JS.tex /tmp/tmp_new_IhZx8l.tex
, it works! (for this test I had temporally changed latexdiffcite so that it would not delete the temporary files). I did some more debugging and somehow this problem appears to be related to the file size; for really short files it worked, but when adding material, it breaks; I verified by experimentation that it is not any particular line that causes the problem, but it seems more of a threshold value in file size. The file size of the file, where it fails, is 3938 characters, but my experimentation did not go as far as to get an exact value for the threshold, or check whether it is indeed the number of characters that matters or maybe lines or some other measure of size. (python --version
returns2.7.6
). I realise this all might not be enough for you to reproduce the error, so please let me know what info you need.