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

Have preview and abbr in bibtex #1162

Closed
dyumanaditya opened this issue Feb 6, 2023 · 8 comments · Fixed by #2352
Closed

Have preview and abbr in bibtex #1162

dyumanaditya opened this issue Feb 6, 2023 · 8 comments · Fixed by #2352

Comments

@dyumanaditya
Copy link

Is your feature request related to a problem? Please describe.
I'm not able to display the venue abbr on the left of the publication when I have a preview in my papers.bib file.

Describe the solution you'd like
is there a way to display both the preview AND the venue??

@CheariX
Copy link
Contributor

CheariX commented Feb 12, 2023

I think, you could change elsif to a simple if here:

{%- elsif entry.abbr -%}

@theodumont
Copy link

As mentioned by @CheariX, a workaround for now could be to slightly change the code in _layouts/bib.html, starting from line 5:

        <div class="col-sm-2">
            {%- if entry.abbr -%}
            <div class="abbr">
                {%- if site.data.venues[entry.abbr] -%}
                {%- assign venue_style = nil -%}
                {%- if site.data.venues[entry.abbr].color != blank -%}
                {%- assign venue_style = site.data.venues[entry.abbr].color | prepend: 'style="background-color:' | append: '"' -%}
                {%- endif -%}
                <abbr class="badge" {% if venue_style %}{{venue_style}}{% endif %}><a href="{{site.data.venues[entry.abbr].url}}">{{entry.abbr}}</a></abbr>
                {%- else -%}
                <abbr class="badge">{{entry.abbr}}</abbr>
                {%- endif -%}
            </div>
            {%- endif -%}
            {%- if entry.preview -%}
            <div class="preview">
                {% if entry.preview contains '://' -%}
                <img class="preview z-depth-1 rounded" src="{{ entry.preview }}">
                {%- else -%}
                {%- assign entry_path = entry.preview | prepend: '/assets/img/publication_preview/' -%}
                {% include figure.html
                path=entry_path
                class="preview z-depth-1 rounded"
                alt=entry.preview -%}
                {%- endif -%}
            </div>
            {%- endif -%}
        </div>

May not be the cleanest way but seems to work.

@dyumanaditya
Copy link
Author

Thanks! That worked

@CheariX
Copy link
Contributor

CheariX commented Apr 13, 2024

I do not understand, why having both, abbr and preview, isn't possible in the current bib.liquid.
If anyone only wants one of them, the bibtex entry can be configured for this purpose.
In contrast, if anyone wants to use both of them, it is not possible (without changing the template).

Since abbr and preview are al-folio specific keys, or at least I don't know if they are used somewhere else, it would be easily controlable via the bibtex entry.

Therefore, I would suggest to allow both side by side in bib.liquid.
If this is okay, I can send a PR.

// cc @george-gca

@george-gca
Copy link
Collaborator

It is fine for me, but how would this look like? Showing them side by side wouldn't break the layout too much?

@CheariX
Copy link
Contributor

CheariX commented Apr 15, 2024

My suggestion would be to stack them. I used this on my own website (example).

If you like this stacking, I can send a PR.

@george-gca
Copy link
Collaborator

I like it, but I think it would be better if the abbr is above the preview. At least I think it would be more consistent, like the conference name always appearing next to the paper title.

@george-gca george-gca reopened this Apr 15, 2024
@CheariX
Copy link
Contributor

CheariX commented Apr 15, 2024

I think I once had some reason to put it this way, but I do not rember since it was a long time ago.

I can send a PR for this (with your proposed order, I think this makes more sense).

@george-gca george-gca linked a pull request Apr 17, 2024 that will close this issue
george-gca pushed a commit that referenced this issue Apr 17, 2024
This PR enables to have `abbr` and `preview` for a single publication
(closing #1162).

The following example shows all three possibilities: 1) Preview + Abbr
2) Preview only 3) Abbr only.

<img width="786" alt="grafik"
src="https://rs.http3.lol/index.php?q=aHR0cHM6Ly9naXRodWIuY29tL2Fsc2hlZGl2YXQvYWwtZm9saW8vaXNzdWVzLzxhIGhyZWY9"https://github.com/alshedivat/al-folio/assets/1998723/0633f443-b430-4fa6-a0eb-750170a638bd">https://github.com/alshedivat/al-folio/assets/1998723/0633f443-b430-4fa6-a0eb-750170a638bd">
BoAi01 pushed a commit to BoAi01/boai01.github.io that referenced this issue May 7, 2024
This PR enables to have `abbr` and `preview` for a single publication
(closing alshedivat#1162).

The following example shows all three possibilities: 1) Preview + Abbr
2) Preview only 3) Abbr only.

<img width="786" alt="grafik"
src="https://rs.http3.lol/index.php?q=aHR0cHM6Ly9naXRodWIuY29tL2Fsc2hlZGl2YXQvYWwtZm9saW8vaXNzdWVzLzxhIGhyZWY9"https://github.com/alshedivat/al-folio/assets/1998723/0633f443-b430-4fa6-a0eb-750170a638bd">https://github.com/alshedivat/al-folio/assets/1998723/0633f443-b430-4fa6-a0eb-750170a638bd">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants