Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command not found? #2

Closed
Gabriel-p opened this issue Aug 11, 2016 · 11 comments
Closed

Command not found? #2

Gabriel-p opened this issue Aug 11, 2016 · 11 comments

Comments

@Gabriel-p
Copy link

Gabriel-p commented Aug 11, 2016

elementary OS Freya (0.3)

$ python
Python 3.5.1 |Anaconda 4.1.0 (64-bit)| (default, Jun 15 2016, 15:32:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

I just installed this package with pip install latexdiffcite --user. the process ended successfully:

Downloading/unpacking latexdiffcite
  Downloading latexdiffcite-1.0.4-py2.py3-none-any.whl
Installing collected packages: latexdiffcite
Successfully installed latexdiffcite
Cleaning up...

but if I try to invoke the app in terminal I get:

$ latexdiffcite
latexdiffcite: command not found

Did I miss a step? Could this be related to Anaconda?

@cmeeren
Copy link
Collaborator

cmeeren commented Aug 11, 2016

Maybe the --user option places the binary somewhere outside your PATH. I don't know where it's supposed to end up (and I'm not on Linux right now so I can't check), but I think it should be in some Scripts subdirectory in the Anaconda directory. Try finding the binary by searching system-wide for latexdiffcite (locate latexdiffcite might work, but if not, search more thoroughly using another tool). Also try invoking it using python -m latexdiffcite.

@Gabriel-p
Copy link
Author

Thanks, the command python -m latexdiffcite worked.

Sadly, the package could not process my files due to:

processing old revision
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/gabriel/.local/lib/python2.7/site-packages/latexdiffcite/__main__.py", line 13, in <module>
    sys.exit(main())
  File "/home/gabriel/.local/lib/python2.7/site-packages/latexdiffcite/latexdiffcite.py", line 163, in main
    run(parsed_args)
  File "/home/gabriel/.local/lib/python2.7/site-packages/latexdiffcite/latexdiffcite.py", line 296, in run
    process_revision('old')
  File "/home/gabriel/.local/lib/python2.7/site-packages/latexdiffcite/latexdiffcite.py", line 364, in process_revision
    make_author_year_tokens_from_bib(oldnew)
  File "/home/gabriel/.local/lib/python2.7/site-packages/latexdiffcite/latexdiffcite.py", line 597, in make_author_year_tokens_from_bib
    raise ValueError('Reference \'' + ref + '\' not found in any bibtex file')
ValueError: Reference '\odot' not found in any bibtex file

@cmeeren
Copy link
Collaborator

cmeeren commented Aug 11, 2016

Where does \odot occur? Inside some cite command?

@Gabriel-p
Copy link
Author

I doubt it, but how can I tell from that ValueError message?

@cmeeren
Copy link
Collaborator

cmeeren commented Aug 12, 2016

Enable debug logging or terminal output, see the usage instructions.

@slayoo
Copy link

slayoo commented Feb 20, 2017

In relation to ftilmann/latexdiff#17, I'm posting here the stack trace and relevant debug messages that might be relevant:

\citep[text text $\dot{T}$][text text]{label}.
...
[latexdiffcite.py: 388             get_all_ref_keys() ]    DEBUG  references found: [u'T']
[latexdiffcite.py: 390             get_all_ref_keys() ]    DEBUG  new references: [u'T']
...
[latexdiffcite.py: 547 make_author_year_tokens_from_bib() ]    DEBUG  formatting T
[latexdiffcite.py: 133            destroy_tempfiles() ]    DEBUG  deleting temp file /tmp/tmp_old_wr0Uqv.tex
[latexdiffcite.py: 136            destroy_tempfiles() ]    DEBUG  deleting temp file /tmp/tmp_new_Z43Btx.tex
Traceback (most recent call last):
  File "/usr/local/bin/latexdiffcite", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 163, in main
    run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 296, in run
    process_revision('old')
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 364, in process_revision
    make_author_year_tokens_from_bib(oldnew)
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 551, in make_author_year_tokens_from_bib
    entry = re.findall(p, bib_contents)[0]
IndexError: list index out of range

@cmeeren
Copy link
Collaborator

cmeeren commented Feb 21, 2017

That traceback is different from ftilmann/latexdiff#17 (comment). Could you explain why?

@slayoo
Copy link

slayoo commented Feb 21, 2017

There, I've used the -bbl option

@cmeeren
Copy link
Collaborator

cmeeren commented Feb 21, 2017

I've released a new version now, see if it's fixed.

@slayoo
Copy link

slayoo commented Feb 21, 2017

Thanks!

It seems to have fixed this issue:

[latexdiffcite.py: 664          replace_refs_in_tex() ]    DEBUG  replacing \citep[e.g. in the cooling rate $\dot{T}$, see][discussion
  of Fig.~10-11 and other studies referenced therein]{Hammer_2015}
[latexdiffcite.py: 793                  format_refs() ]    DEBUG  result: [\ldiffentity{\textit{Hammer et~al.}, \ldiffentity{2015}}, e.g. in the cooling rate $\dot{T}$, see]

but execution still fails:

[latexdiffcite.py: 691          replace_refs_in_tex() ]    DEBUG  adding declaration of citation protection command before \begin{document}: \newcommand{\ldiffentity}[1]{#1}
[latexdiffcite.py: 371             process_revision() ]    DEBUG  writing new changes to temp file
[latexdiffcite.py: 801            write_tex_to_temp() ]    DEBUG  writing to file /tmp/tmp_new_iFNmCh.tex
[latexdiffcite.py: 811                run_latexdiff() ]     INFO  running latexdiff /tmp/tmp_old_zJZUTf.tex /tmp/tmp_new_iFNmCh.tex
[latexdiffcite.py: 812                run_latexdiff() ]    DEBUG  sending result to diff.tex
[latexdiffcite.py: 133            destroy_tempfiles() ]    DEBUG  deleting temp file /tmp/tmp_old_zJZUTf.tex
[latexdiffcite.py: 136            destroy_tempfiles() ]    DEBUG  deleting temp file /tmp/tmp_new_iFNmCh.tex
Traceback (most recent call last):
  File "/usr/local/bin/latexdiffcite", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 163, in main
    run(parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 298, in run
    run_latexdiff(Files.tex_old_tmp_path, Files.tex_new_tmp_path)
  File "/usr/local/lib/python2.7/dist-packages/latexdiffcite/latexdiffcite.py", line 818, in run_latexdiff
    raise ValueError('latexdiff returned with code {}. Error from latexdiff:\n\n'.format(ret_code) + stderr)
ValueError: latexdiff returned with code 255. Error from latexdiff:

Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\includeonly{ <-- HERE (.*?)}/ at /usr/bin/latexdiff line 1572.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(^(?:[^%\n]|\\%)*)\\bibliography{ <-- HERE (.*?)}/ at /usr/bin/latexdiff line 1607.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(^(?:[^%\n]|\\%)*)\\subfile{ <-- HERE (.*?)}/ at /usr/bin/latexdiff line 1622.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?<!\\)\\{ <-- HERE / at /usr/bin/latexdiff line 2351.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\begin{ <-- HERE MATHMODE}((?:(.(?!(?<!\\)\&|\\\\))*)?)\\end{MATHMODE}/ at /usr/bin/latexdiff line 2676.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\begin{MATHMODE}((?:(.(?!(?<!\\)\&|\\\\))*)?)\\end{ <-- HERE MATHMODE}/ at /usr/bin/latexdiff line 2676.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\begin{ <-- HERE MATHMODE}(.*?)\\end{MATHMODE}/ at /usr/bin/latexdiff line 2678.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\begin{MATHMODE}(.*?)\\end{ <-- HERE MATHMODE}/ at /usr/bin/latexdiff line 2678.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\end{ <-- HERE SQUAREBRACKET}/ at /usr/bin/latexdiff line 2759.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\begin{ <-- HERE SQUAREBRACKET}/ at /usr/bin/latexdiff line 2760.
\\begin\{document\} and \\end\{document\} not in the correct order or not present as a pair. at /usr/bin/latexdiff line 1706.

Any hints?

@cmeeren
Copy link
Collaborator

cmeeren commented Feb 22, 2017

The second code block is ftilmann/latexdiff#61, so try upgrading latexdiff (not latexdiffcite).

From the first code block, there seems to be a problem with the placement of pre-notes and post-notes. It seems the pre-notes are placed after the references, and the post-note is hidden. If this is still a problem after you have upgraded latexdiff and got it working, please submit a new issue, and please also post your configuration file, if any.

twilsonco added a commit that referenced this issue Sep 3, 2024
)

* add tests for commands inside pre- and postnotes

* fix #2

* fix doc links

* fix docs

* update some testenvs to python3.5

* Bump version: 1.0.4 → 1.0.5

* use 2.7 instead of 3.5 for general test envs

* remove coverage tests on travis to avoid fails

* Update changelog

* Fix #3

* Update CHANGELOG.rst

* Bump version: 1.0.5 ? 1.0.6

* Update README.rst

* Switched broken pypip.in badges to shields.io (#8)

* Fix crash when no authors present

Updated `make_author_year_tokens_from_bib()` so that bib items that don't have authors (e.g. books with editor lists) are still handled correctly. Also moved some re.compile() calls outside the loop for efficiency.

* print useful errors for missing author/year data in bib item

* scan for \addbibresource & allow mutliple files

* fix run_latexdiff command arguments and error capturing

* fix invalid escape sequence (deprecated in Python 3.12) and other minor style fixes

---------

Co-authored-by: Christer van der Meeren <[email protected]>
Co-authored-by: Christer van der Meeren <[email protected]>
Co-authored-by: Michael Overmeyer <[email protected]>
Co-authored-by: Tim Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants