gerw / mathbin Goto Github PK
View Code? Open in Web Editor NEWBinaries for mathematicians
License: GNU General Public License v3.0
Binaries for mathematicians
License: GNU General Public License v3.0
On my machine when running doi2pdf 10.1137/0803026
I get
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
Traceback (most recent call last):
File "/Users/ronnber/Repositories/numapde/numapde-bibliography/mathbin/doi2pdfname.py", line 7, in <module>
tree = etree.parse(sys.argv[1])
File "src/lxml/etree.pyx", line 3521, in lxml.etree.parse
File "src/lxml/parser.pxi", line 1859, in lxml.etree._parseDocument
File "src/lxml/parser.pxi", line 1885, in lxml.etree._parseDocumentFromURL
File "src/lxml/parser.pxi", line 1789, in lxml.etree._parseDocFromFile
File "src/lxml/parser.pxi", line 1177, in lxml.etree._BaseParser._parseDocFromFile
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "/tmp/368219713", line 32
lxml.etree.XMLSyntaxError: Entity 'nbsp' not defined, line 32, column 60
which for me looks like an
(nonbreaking space in html) is not properly handled/escaped when trying to generate the name?
The arxive2bib tool provides a bib entry with the arxive number as key. We can use bibtool to extract the author names and year automatically. The tool is available as packages on the major distributions Debian, Ubuntu, Fedora and Suse.
The code
#if we have bibtool (https://ctan.org/pkg/bibtool) we can use it to format the key
if [ -x "$(command -v bibtool)" ] ; then
wget -O - $URL -q | xmllint --xpath '//div[@id="biblatex"]/textarea/text()' - | bibtool -f "%n(author):%4d(year)" -- "new.entry.type {online}"
else
wget -O - $URL -q | xmllint --xpath '//div[@id="biblatex"]/textarea/text()' -
fi
also checks if the tool is available and then formats the bibfile accordingly. Please note the new entry type at the very end. The arxive-api provides the entry type "online", which is not known to bibtool.
I get an error when using doi2pdf
on Mac OS Big Sur (Python 3.9.2, lxml installed via pip3,
File "mathbin/doi2pdfname.py", line 9, in <module>
tree = etree.parse(sys.argv[1], parser=parser)
File "src/lxml/etree.pyx", line 3521, in lxml.etree.parse
File "src/lxml/parser.pxi", line 1859, in lxml.etree._parseDocument
File "src/lxml/parser.pxi", line 1885, in lxml.etree._parseDocumentFromURL
File "src/lxml/parser.pxi", line 1789, in lxml.etree._parseDocFromFile
File "src/lxml/parser.pxi", line 1177, in lxml.etree._BaseParser._parseDocFromFile
File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
File "/tmp/81657250", line 47
lxml.etree.XMLSyntaxError: Entity 'nbsp' not defined, line 47, column 93
Also I get a print of the usage for grep (installed grep via homebrew) - is that intended?
My example call is doi2pdf 10.1016/j.cam.2016.07.018
.
doi2bibtex 10.1007/s00186-019-00692-8
The result contains a Tab
instead of a \t
.
I am having trouble using doi2pdf
on Mac OS. With the python version
> python --version
Python 3.6.6 :: Anaconda, Inc.
I had to change line 50 of doi2pdfnames.py
to
print(filename.encode("utf8"))
to make it work with python3, but then I get
Traceback (most recent call last):
File "~/Work/Software/mathbin/doi2pdfname.py", line 3, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
even before it fetches the pdf; still it stops after storing the temporary file without renaming.
I am not yet sure what causes this, copying the template file and renaming it worked and brought me the pdf. I have to check what might be different here after I have found the place where the coping takes place.
The colon (:) should be also replaced in doi2pdfname.py (and probably other files?)
to be compatible with Mac OS Classic.
For Windows also these characters should be replaced:
< (less than) > (greater than) : (colon - sometimes works, but is actually NTFS Alternate Data Streams) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.