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

Preserve % sign inside BibTeX fields via cleanup #2375

Merged
merged 4 commits into from
Dec 15, 2016
Merged

Conversation

stefan-kolb
Copy link
Member

@stefan-kolb stefan-kolb commented Dec 13, 2016

Resolves #2011
You can now use LateXCleanup inside quality->cleanups to escape % to \%

@stefan-kolb stefan-kolb added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 13, 2016
@lenhard
Copy link
Member

lenhard commented Dec 13, 2016

How about a Changelog entry and we are ready to go :)

@@ -25,6 +25,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Replaces manual thread management with cached thread pool
- Files can now be moved to subfolders named by a custom format pattern, e.g., based on `entrytype`.
The pattern can be specified in the settings like the filename pattern. [#1092](https://github.com/JabRef/jabref/issues/1092)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there two additional newlines here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid merge conflicts with other PRs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fine. I would merge this right now, but maybe we should give @bernhard-kleine at least time until the release tomorrow, before we merge and delete the branch.

We should not forget to merge it before the release, though.

@stefan-kolb stefan-kolb added this to the v3.8 milestone Dec 13, 2016
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just nitpicking - can be merged afterwards.

@@ -25,6 +25,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Replaces manual thread management with cached thread pool
- Files can now be moved to subfolders named by a custom format pattern, e.g., based on `entrytype`.
The pattern can be specified in the settings like the filename pattern. [#1092](https://github.com/JabRef/jabref/issues/1092)


- [#2375](https://github.com/JabRef/jabref/issues/2375) LaTeXCleanup action does now preserve % signs inside BibTeX fields
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change "preserve" to "escape", and, moreover, "LaTeXCleanup" is not an English word 😄

@tobiasdiez tobiasdiez removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 15, 2016
@Siedlerchr
Copy link
Member

Siedlerchr commented Dec 15, 2016 via email

@koppor koppor merged commit 832417f into master Dec 15, 2016
@koppor koppor deleted the preserve-percent-sign branch December 15, 2016 14:37
@bernhard-kleine
Copy link

bernhard-kleine commented Dec 18, 2016

When importing via the firefox plugin the percent sign are excaped. Importing via the medline websearch they are not. I do not find any mentioning in the cleanup dialogue of percent sign changed to % signs.

JabRef 3.8
windows 7 6.1 amd64
Java 1.8.0_66

@Siedlerchr
Copy link
Member

Siedlerchr commented Dec 18, 2016

@bernhard-kleine The cleanup is not done automatically.
You should use Cleanup->and then select the field you want to cleanup, e.g. abstract together with LaTeX Cleanup

@bernhard-kleine
Copy link

I updated to JabRef 3.8 today, i choose the 64bit version.
I took a new database.
I imported via the medline web search PMID 27697972.
The abstract has unescaped percent signs. Therefore, I went to quality->cleanup and as the abstract field is already selected I checked all the entries in the field to the right but can not find percent sign. Latex cleanup did not find anything to cleanup. What do I miss?

@bernhard-kleine
Copy link

I had to add it first and then run the cleanup. Sorry for the noise!

@j0hannes
Copy link

I added LaTeX cleanup for the abstract field. Still, percent sign are saved as they are which leads to errors when running biber. In case the percent sign is escaped, jabref removes the backslash when saving.

@Siedlerchr
Copy link
Member

@j0hannes This has been fixed with #2521
Thank you for reporting this issue. We think, that is already fixed in our development version and consequently the change will be included in the next release.

We would like to ask you to use a development build from https://builds.jabref.org/master and report back if it works for you.

@j0hannes
Copy link

@Siedlerchr I tried version 4.0 and it seems to be quite unstable; I had to force quit the application each time as it was hanging. Before crashing it destroyed some of the keys, so I'm going back to 3.8.2 now. Is there any other way to address the percent problem?

@Siedlerchr
Copy link
Member

@j0hannes Could you please open a new issue for the problems you encounter with the 4.0.0 version in detail?
E.g. Operation system, any errors in/from the log?

You could manually escape the %-signs by adding a Backslash \ before it. That works.
You could simply search for the %-sign to see all problematic entries and then escape them manually

@bernhard-kleine
Copy link

bernhard-kleine commented Mar 20, 2017 via email

@j0hannes
Copy link

After changing my bib file manually, version 4.0 is not crashing anymore. Still, it modifies all my citation keys and I don't find any way to stop it.

@Siedlerchr
Copy link
Member

@j0hannes Did you run a cleanup operation or a save action? Did you check the keypattern settings?
I would suggest opening a new issue, if this problem still exists

@j0hannes
Copy link

@Siedlerchr No, it happens right when typing, loading or after inspecting manual changes to the bib file. When typing keys are changed when the focus moves to a different field.

@j0hannes
Copy link

j0hannes commented Apr 5, 2017

I can confirm that the problem still persists with "abstract: LaTeX cleanup" enabled in version 4.0.0-dev. Every time I enter %, it is immediately changed to % and % ends up as % in the bib file which causes LaTeX to fail.

@Siedlerchr
Copy link
Member

I can not reproduce this. % sign is correctly escaped (and only once) to \%
Using Latex Cleanup for abstract.

@j0hannes
Copy link

j0hannes commented Apr 6, 2017

It certainly was caused by the LaTeX to Unicode filter.

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 this pull request may close these issues.

7 participants