pcooksey/bibtex-js

<span class="if BIBTEXTYPE==article">Artikel</span>

Abakaba opened this issue · 6 comments

Can I use the if statement also for BIBTEXTYPE?

There is no == for the if statements. They only check if a class exists for that bibtex entry.

Currently if you use the bibtextype it will take the values found in this link. What you want is to customize the output for each bibtex type?

Please checkout the develop branch (2e6098d) and let me know if it handles your case. I added == to the if statements. So in your case it should work like so:

<span class="if BIBTEXTYPEKEY==@ARTICLE">Artikel</span>

Notice that I've used BIBTEXTYPEKEY and not BIBTEXTYPE which is set internally to defined values. The wiki was missing BIBTEXTYPEKEY updated wiki link. Also, @ARTICLE needs to be capitalized and have an @ symbol in the beginning.

Cool! This works nicely! Many thanks.
This allows me now to have a lable on the publication type per bibtex entry.
As soon as my page is ready, I will share it with you.

I am just wondering if you plan to merge this feature in the master branch?
Furthermore, it seems like the develop branch (2e6098d) an d all latest branches do not display special characters. e.g. {~n} or {'o}.

I would really appreciate if you can generate one version which contains the functionality
Artikel and displays special characters.

Many thanks in advance.

Of course! Just got a little busy. I've merged the == into master (2e6098d).

As for the displaying special characters,

  1. Special characters are entered as {\"a} or {\"{a}} not \"{a}.

So you should escape the special character. This was found in Chapter 2 Helpful Tips
So, it works for me when doing {\~n}

That said, I do believe there are some lingering issues with the special character display. So I'll create a new issue #38 for generating a test for all the special characters that are supported by bibtex. However, this may take some time as I am in the middle of other work.

I'm closing this issue. Please refer to issue #38 if you are still having issues with displaying special characters.