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

Keep % sign during LaTeX to unicode conversion in abstracts in biblatex mode #3148

Closed
crystalfp opened this issue Aug 23, 2017 · 10 comments
Closed

Comments

@crystalfp
Copy link

crystalfp commented Aug 23, 2017

JabRef 4.0-beta3
Windows 7 6.1 amd64
Java 1.8.0_144

Load the following database:

% Encoding: UTF-8

@Article{Caspi2016,
  author       = {Avshalom Caspi and Renate M. Houts and Daniel W. Belsky and Honalee Harrington and Sean Hogan and Sandhya Ramrakha and Richie Poulton and Terrie E. Moffitt},
  title        = {Childhood forecasting of a small segment of the population with large economic burden},
  journaltitle = {Nature Human Behaviour},
  date         = {2016},
  volume       = {1},
  number       = {1},
  pages        = {0005},
  doi          = {10.1038/s41562-016-0005},
  abstract     = {A segment comprising 22\% of the cohort accounted for 36\% of the cohort’s injury insurance claims; 40\% of excess obese kilograms; 54\% of cigarettes smoked; 57\% of hospital nights; 66\% of welfare benefits; 77\% of fatherless child-rearing; 78\% of prescription fills; and 81\% of criminal convictions.},
}

@Comment{jabref-meta: databaseType:biblatex;}

I had to quote all percent signs in the abstract, otherwise I receive errors from latex compilation (even if I don't use or display the abstract).

Now, in the preview window the % is rendered as %

If I run "Cleanup entries..." with active "Run field formatter" it changes every \% into %. This forces me to manually edit the entry reinstating the quote. The only positive effect is that without the quote in the preview window the % sign is rendered correctly.

Note. Maybe the problem is shared with biblatex that should ignore the abstract content if not needed.

@lenhard
Copy link
Member

lenhard commented Aug 23, 2017

Well that depends on what field formatters you run. I just tried the default (normalize date, normalize page, normalize month), then it doesn't change the percentage sign.

If you use a "Latex to something" formatter, like for example Latex to unicode, then that formatter will replace all Latex commands. For \% that's %, so the expect result would be what you describe. To sum up, please check which field formatters you are running.

@lenhard lenhard added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Aug 23, 2017
@crystalfp
Copy link
Author

Same problem with "Latex to Unicode" and the other cleanup entries settings:
bug-percent

I need to have the database ready for biblatex, maybe this makes a difference?

Let me notice that I also reported a problem that appears before I use the cleanup function: the % in the preview window.

@crystalfp
Copy link
Author

Yes, it is true that, if I push reset and thus have the same configuration as your, the entry is not changed. But it is still previewed as %
As I stated before, I need to cleanup entries for biblatex. For this I pushed the "Recommended for biblatex" button.
Thanks for all your work!
mario

@lenhard
Copy link
Member

lenhard commented Aug 23, 2017

Ok, let me clarify:

  1. The cleanup formatters: Any formatter that translates from LaTeX to something else will do this removal. This is intentional and not a bug. It happens to you because the LaTeX to Unicode formatter is configured for the abstract. This one is in the recommendations for biblatex, because biblatex can deal with UTF-8 (something which BibTeX can't). So you usually don't need to LaTeX-encode things in biblatex, it can deal with all the special symbols. Maybe you've discovered a case where this does not work (and then we should remove the formatter from the recommendations), I am not sure since I do not use biblatex myself. Anyway, you can easily solve your problem by removing the abstract: LaTeX to Unicode from the formatters in your setting.

  2. Regarding the entry preview: The &percent is also desired. In Options -> Preferences -> Entry Preview you can configure how the preview panel looks like. By default it apples "HTMLChars" to the abstract field, meaning that it will replace certain chars by their HTML representation. For % that's &percent.

TL&DR: We need to check if we should remove abstract: LaTeX to Unicode from the recommendations for biblatex.

@Siedlerchr
Copy link
Member

I think you need to run LatexCleanup, I remember a similar issue we had #2451

@lenhard lenhard added status: devcall and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Aug 25, 2017
@koppor
Copy link
Member

koppor commented Aug 31, 2017

I think, we should keep \% in the conversion as it is an escaped symbol and should be treated like that. Compromise: Do like that in biblatex mode, but in bibtex mode, replace it by %.

Reasoning: bibtex has no issues with % , but biblatex/biber has.

@crystalfp
Copy link
Author

I agree koppor!

@lenhard lenhard changed the title Wrong treatment of % sign in abstracts Keep % sign during LaTeX to unicode conversion in abstracts in biblatex mode Feb 16, 2018
@genodeftest
Copy link

@lenhard wrote

TL&DR: We need to check if we should remove abstract: LaTeX to Unicode from the recommendations for biblatex.

This issue affects any field. I'm seeing the same issue with a subtitle containing a percent sign.

@ilippert
Copy link
Contributor

ilippert commented Dec 14, 2020

same issue, I think, under
JabRef 5.2--2020-12-13--931c4cb
Linux 5.9.13-200.fc33.x86_64 amd64
Java 15.0.1
with % sign in field annote: biblatex cannot compile well with that sign within an abstract.

@github-actions
Copy link
Contributor

This issue has been inactive for half a year. Since JabRef is constantly evolving this issue may not be relevant any longer and it will be closed in two weeks if no further activity occurs.

As part of an effort to ensure that the JabRef team is focusing on important and valid issues, we would like to ask if you could update the issue if it still persists. This could be in the following form:

  • If there has been a longer discussion, add a short summary of the most important points as a new comment (if not yet existing).
  • Provide further steps or information on how to reproduce this issue.
  • Upvote the initial post if you like to see it implemented soon. Votes are not the only metric that we use to determine the requests that are implemented, however, they do factor into our decision-making process.
  • If all information is provided and still up-to-date, then just add a short comment that the issue is still relevant.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants