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

Export to MODS format fails (wrong dash in pages field) #7239

Closed
1 task
alfureu opened this issue Dec 25, 2020 · 7 comments · Fixed by #7243
Closed
1 task

Export to MODS format fails (wrong dash in pages field) #7239

alfureu opened this issue Dec 25, 2020 · 7 comments · Fixed by #7243

Comments

@alfureu
Copy link

alfureu commented Dec 25, 2020

JabRef 5.2--2020-12-24--6a2a512
Windows 10 10.0 amd64
Java 14.0.2

This error happens on the v5.2 stable.

Steps to reproduce the behavior:

  1. Export to MODS xml
  2. error (see below)
Log File
java.lang.NumberFormatException: For input string: "R404–R405"
  at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
  at java.base/java.lang.Integer.parseInt(Unknown Source)
  at java.base/java.math.BigInteger.<init>(Unknown Source)
  at java.base/java.math.BigInteger.<init>(Unknown Source)
  at org.jabref@5.2.60000/org.jabref.logic.exporter.ModsExporter.addPages(Unknown Source)
  at org.jabref@5.2.60000/org.jabref.logic.exporter.ModsExporter.export(Unknown Source)
  at org.jabref@5.2.60000/org.jabref.gui.exporter.ExportCommand.lambda$export$2(Unknown Source)
  at org.jabref@5.2.60000/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source)
  at org.jabref@5.2.60000/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source)
  at org.jabref.merged.module@5.2.60000/javafx.concurrent.Task$TaskCallable.call(Unknown Source)
  at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
  at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.base/java.lang.Thread.run(Unknown Source)

@Siedlerchr
Copy link
Member

Can you please paste the bibtex entry?
it seems like you have a non number in the page field

@alfureu
Copy link
Author

alfureu commented Dec 25, 2020

Hm, that might be difficult, it is my whole bibtex library (1000+ records).

That being said, why JabRef requires numbers in the page field? It is often the case that some introduction chapters are using roman numbering (distinguishable from the rest of the manuscript)...

@Siedlerchr
Copy link
Member

Good question. Need to look which field exactly is producing the error.
Maybe you can paste the entry with the field pages containing the value
R404–R405?

@alfureu
Copy link
Author

alfureu commented Dec 25, 2020

This was helpful, the article is this: https://www.sciencedirect.com/science/article/pii/S0960982216303189. The PDF is accessible, and indeed it is pages R404–R405.

My biblatex source looks (as a result of parsing from Scopus) as follows:

@Article{hodgson_best_2016,
  author       = {Hodgson, J.C. and Koh, L.P.},
  date         = {2016},
  journaltitle = {Current Biology},
  title        = {Best Practice for Minimising Unmanned Aerial Vehicle Disturbance to Wildlife in Biological Field Research},
  doi          = {10.1016/j.cub.2016.04.001},
  number       = {10},
  pages        = {R404–R405},
  url          = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-84969917083\&partnerID=40\&md5=abcc0a0b0b1dabb6993e963deb1e5073},
  volume       = {26},
  abstract     = {The use of unmanned aerial vehicles (UAVs), colloquially referred to as 'drones', for biological field research is increasing [1-3]. Small, civilian UAVs are providing a viable, economical tool for ecology researchers and environmental managers. UAVs are particularly useful for wildlife observation and monitoring as they can produce systematic data of high spatial and temporal resolution [4]. However, this new technology could also have undesirable and unforeseen impacts on wildlife, the risks of which we currently have little understanding [5-7]. There is a need for a code of best practice in the use of UAVs to mitigate or alleviate these risks, which we begin to develop here. © 2016 Elsevier Ltd.},
  file         = {:article/hodgson_best_2016.pdf:PDF},
  groups       = {Drones},
  keywords     = {Scopus,dbsearch},
  timestamp    = {2018-11-02},
}

@mlep
Copy link
Contributor

mlep commented Dec 25, 2020

Note: the field pages contains an utf8 en-dash (–) and not a LaTeX en-dash (--).

@Siedlerchr
Copy link
Member

Thanks for the hint @mlep.
@DOFfactory
It works fine if you replace the dash by either a minus - or a double minus --.
Normally, the Normalize page numbers (Quality, Cleanup) should take care of the replacement, but I discovered that there is a bug. The replaced value never got returned.

@Siedlerchr Siedlerchr changed the title Export to MODS format fails Export to MODS format fails (wrong dash in pages field) Dec 25, 2020
@alfureu
Copy link
Author

alfureu commented Dec 26, 2020

Cool, thanks!

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

Successfully merging a pull request may close this issue.

3 participants