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

LaTeX commands in fields not displayed in the list of references #1321

Closed
dbitouze opened this issue Apr 29, 2016 · 12 comments
Closed

LaTeX commands in fields not displayed in the list of references #1321

dbitouze opened this issue Apr 29, 2016 · 12 comments

Comments

@dbitouze
Copy link

JabRef version 3.3 on Linux (Mageia 5).

Steps to reproduce:

  1. Create an entry, the title field of which containing a LaTeX command.
  2. Look at the "title" column in the list of references: this LaTeX command is not displayed.

jabref-title

@oscargus
Copy link
Contributor

A (quite large) subset of LaTeX-commands are converted to Unicode, the rest is removed. One could consider returning them rather than removing them, but it is not obvious that it is a better idea in general.

@oscargus
Copy link
Contributor

It is always possible to increase the list of available commands, but that particular one is asa far as I know not available as a Unicode character.

@dbitouze
Copy link
Author

One could consider returning them rather than removing them, but it is not obvious that it is a better idea in general.

IMHO, returning them verbatim if not available as a Unicode character is not only a good idea, it is necessary.

@oscargus
Copy link
Contributor

Could you give an actual example where it is necessary? (In your current, obviously toy, example, it would be better to return LaTeX.)

@matthiasgeiger
Copy link
Member

I think @dbitouze has a point that returning the actual LaTeX command is the best idea if our conversion to Unicode for the UI fails - should not be too hard to implement 😉

@dbitouze
Copy link
Author

It is always possible to increase the list of available commands, but that particular one is asa far as I know not available as a Unicode character.

I don't know what are the available commands but I guess it is impossible to deal with all the 14032 LaTeX symbols available. Another problem is for chemical formulae (e.g. \ce{Sb2O3} from mhchem package).

@oscargus
Copy link
Contributor

No, not hard to implement (a few if-statements), but better? \textbf{}? Is \ce{Sb203} better than Sb203 (which I think the current result would be)?

@dbitouze
Copy link
Author

Could you give an actual example where it is necessary? (In your current, obviously toy, example, it would be better to return LaTeX.)

Well, when your bibliography contains books about LaTeX, that's not only a toy ;) For the other examples,see my other comments (e.g. \ce{Sb2O3} from mhchem package).

@dbitouze
Copy link
Author

Is \ce{Sb203} better than Sb203 (which I think the current result would be)

Indeed: good point!

@matthiasgeiger
Copy link
Member

matthiasgeiger commented Apr 29, 2016

(Still have not looked in the code.)

So the logic should be that unknown commands without parameter (e.g, \textbullet, \textSigma, \curlyyogh) are not replaced - command withs params are stripped so that only the params are left?

@dbitouze
Copy link
Author

So the logic should be that unknown commands without parameter (e.g, \textbullet, \textSigma, \curlyyogh) are not replaced - command withs params are stripped so that only the params are left?

Yes, except if the "parameter" is empty.

Indeed, commands without parameter gobble the following space: \LaTeX is great would be typeset as "LaTeXis great" by LaTeX. Hence such commands should protect the following space with either {} or \: \LaTeX{} is great would be typeset as "LaTeX is great" by LaTeX. With the {} (widely used), these commands may be considered as commands with parameter(s) and hence be stripped (AFAICS, that's what currently happens to \LaTeX{}).

@oscargus
Copy link
Contributor

Now, I got some time to work on this. There are basically two cases in the code (although it looks like more):

\command where currently the command is stripped unless it is recognized. Will change it to keep command.
\command{argument} where currently the command is stripped and argument is kept. Will change it to keep command if argument is empty.

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

3 participants