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

Cannot resolve '\textendash', etc. when displaying article title #3307

Closed
psychelzh opened this issue Oct 15, 2017 · 20 comments
Closed

Cannot resolve '\textendash', etc. when displaying article title #3307

psychelzh opened this issue Oct 15, 2017 · 20 comments

Comments

@psychelzh
Copy link
Contributor

psychelzh commented Oct 15, 2017

JabRef version 4.0 on Windows 10

See the following screenshot. \textendash cannot be resolved to the corresponding character.

image

image

@psychelzh
Copy link
Contributor Author

Maybe other LaTex Text commands (encoding) are not resolved, either.

@lenhard
Copy link
Member

lenhard commented Oct 15, 2017

For the record, this is not a problem in latex2unicode which translates the \textendash correctly. I guess this s a part of the html translation for the preview.

@psychelzh
Copy link
Contributor Author

Yeah, you are right.
image

@lenhard
Copy link
Member

lenhard commented Oct 15, 2017

I added the command to the conversion table. Could you please check out the version here: http://builds.jabref.org/textendash/ and let me know if the problem is resolved at your end?

@psychelzh
Copy link
Contributor Author

Thank you, and I will test it tomorrow, because it is too late here in China.

@psychelzh
Copy link
Contributor Author

psychelzh commented Oct 16, 2017

Great, it works! Here is a screenshot. BTW, will all the encoding symbols be supported now?
image

@lenhard
Copy link
Member

lenhard commented Oct 16, 2017

It's a bit difficult to say what all means here, since we don't really know what is missing.

Could you perhaps provide a list of encoding symbols that you want, but which do not work at the moment? With such a list, it should be no big hassle to complete the implementation.

@psychelzh
Copy link
Contributor Author

psychelzh commented Oct 16, 2017

No more wrongly encoding ones encountered, only some supported ones, say \textquotedblleft and \textquotedblright. I guess there could be a complete list in the LaTex documentation, e.g. one that I had found and posted above, but would it be a huge work?

@lenhard
Copy link
Member

lenhard commented Oct 16, 2017

We're trying to minimize developer time consumption :) Hence, it would be cool if someone just checks which of the things listed on the page you you linked are missing.

But overall there are not too many symbols, so this should be doable.

@psychelzh
Copy link
Contributor Author

It would be so kind of you if they are all supported! 👍

@tobiasdiez
Copy link
Member

@psychelzh If you find symbols that are not working, then you can help us and provide a list in the form
{"unicode character", "html macro", "$\\latex command$"},
similar to https://github.com/JabRef/jabref/pull/3308/files#diff-6b1e5b042a6b79fceea700ac0592dbd0R297. Thanks!

@psychelzh
Copy link
Contributor Author

No problem, I am very glad to do this! 😄

@psychelzh
Copy link
Contributor Author

psychelzh commented Dec 7, 2017

I have tested the {\textquotesingle} conversion newly generated developing version

JabRef 4.1-dev--snapshot--2017-12-07--master--0ee2090ad
Windows 10 10.0 amd64 
Java 1.8.0_151

I checked that this version should have included #3487, but, unfortunately, {\textquotesingle} cannot be converted to ' in the html preview. I wonder whether the lines that I have added really works or not. If not, what should be done? @lenhard @tobiasdiez

default

@lenhard
Copy link
Member

lenhard commented Dec 7, 2017

@psychelzh I had a look at this and actually the mapping in your PR has not been correct, we should have tested this more. When adding the mapping at this stage, we no longer need brackets or backslashes.

I have fixed the mapping in #3496 and added a test for it as well. With that setting the conversion works for me. Let's wait until this is reviewed and then it should be in master soon.

@psychelzh
Copy link
Contributor Author

Okay. I think I know what happened now. And thank you for your quick response! @lenhard

@psychelzh
Copy link
Contributor Author

psychelzh commented Dec 9, 2017

@lenhard I have tested the conversion on the snapshot version of

JabRef 4.1-dev--snapshot--2017-12-08--master--6f39151a7
Windows 10 10.0 amd64 
Java 1.8.0_151

But to my surprise, the html preview cannot convert ' to ', either. This is my screenshot.

image

@psychelzh
Copy link
Contributor Author

@lenhard Sorry to disturb you again. Any suggestions about the failure of conversion from ' to '?

@lenhard
Copy link
Member

lenhard commented Dec 12, 2017

@psychelzh Oh my, it seems that our preview component does not handle ' correctly...

From https://www.w3.org/TR/xhtml1/#C_16

The named character reference ' (the apostrophe, U+0027) was introduced in XML 1.0 but does not appear in HTML. Authors should therefore use ' instead of ' to work as expected in HTML 4 user agents.

I've done this replacement in the current dev version and now the apostrophe is displayed correctly in the preview. One day, we'll have a preview panel with better HTML capabilities.

@tobiasdiez
Copy link
Member

@lenhard Maybe the better rendering comes already with #3504.

@lenhard
Copy link
Member

lenhard commented Dec 12, 2017

@tobiasdiez Yes indeed. I just tested the PR and there apos; works as desired. We can change the mapping back in that PR, or keep it as it is.

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

No branches or pull requests

3 participants