-
-
Notifications
You must be signed in to change notification settings - Fork 339
Bibtex stripping extra extensions #4789
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
base: master
Are you sure you want to change the base?
Bibtex stripping extra extensions #4789
Conversation
This test (should) generate two identical LaTeX input files: main.tex and main.extra.tex. The should compile to the same content, but SCons strips accidentally strips the '.extra' from the second preventing it from finding the bibliography file. The test needs to be checked on a non-Windows system because Miktek does not support the ~ in the shortened path name to the temp directory.
The second argument to the action should be the aux file not the bibliography file. Also, we have to add the bib extension to the target because it will be stripped by the command string via TARGET.filebase.
The normalized text in the PDF should be the same. That ensures we have the proper output from the stripping.
Testing on non-Windows finds pdflatex on the PATH so pulling in the os.envrion is not necessary.
|
And this works if the file is named (I updated your test to use our new standard test header (you can see it in template/test.py) |
|
It does. The underscore isn't stripped by the (I saw the change. I was just lazy and copied one of the other TEX tests and made the logic fit. Now I know to look at the template for next time) |
…xtra-extensions Also resolved ordering of additions to CHANGES.txt
|
|
||
| test.write(["SConstruct"], f"""\ | ||
| import os | ||
| env = Environment(tools=['pdftex', 'tex']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though it has nothing to do with correctness, we often sneak in a line before the initial env creation like
DefaultEnvironment(tools=[])This is purely a hack for performance running the testsuite, and isn't something people should actually have to do. No downvote if not changed.
|
This is not really a latex/bibtex issue at it's root, it's really about how (this is the root of my delay in merging this PR BTW. I wanted to think a bit about this, and if perhaps we could resolve this by improving the |
|
No worries. It's your project and I'm just a visitor! From what I can tell, The alternate explanation here was the wrong target and source were being passed to the Action. That situation would need to be point resolve no matter what. |
|
Don't see how improving splitext helps the problem of being called twice, each time one chunk is hacked off? |
It does a little less work is all to be just slightly faster... mainly, it doesn't account for bytes vs strings or for pathlib objects - the scons one just assumes always a plain string. |
The BibTeX and Biber actions when processing LaTeX files were stripping multiple extensions before passing the file to either
bibtexorbiber. This would result in the bibliography tool not finding the correct .aux file and running LaTeX multiple times for no gain.Example
Given a main LaTeX file named
main.extra.tex.Old behavior:
latex main.extraproduces the filemain.extra.auxbibtex maincall issued by LaTeX BuilderNo file main.extra.auxExpected behavior:
latex main.extraproduces the filemain.extra.auxbibtex main.extracall issued by LaTeX BuilderGist demonstrating the behavior
Contributor Checklist:
CHANGES.txtandRELEASE.txt(and read theREADME.rst).