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

Figure tab not displaying #206

Closed
i-a-n-m opened this issue Sep 1, 2017 · 8 comments
Closed

Figure tab not displaying #206

i-a-n-m opened this issue Sep 1, 2017 · 8 comments
Labels

Comments

@i-a-n-m
Copy link

i-a-n-m commented Sep 1, 2017

lens.zip
We are experimenting with XML for one of our journals and hope to use Lens to display it. We have two test files (attached).

I01_a1.xml displays fine. I01_a2.xml also displays, but without the Figures tab even though it has three figures. I have compared both files a number of times and cannot see anything to indicate why a2 doesn't show the figures. Interestingly, if I delete the figure files for a1 (just trying many options!), the Figure tab shows in Lens, just without any images, so, it would appear not to be related to the presence or absence of the figure files.

If anyone can help work out what's going on, I would be most grateful.

Ian

@gnott
Copy link
Member

gnott commented Sep 5, 2017

I was able to reproduce the what you described using the attached documents.

Firstly, it was confusing to understand why it is that one document would show the Figures tab and the other would not show the tab. I eventually found a difference: in your I01_a1.xml, it also has a <table-wrap>, and that element is added to the Figures tab. In your other document I01_a2.xml it has only <fig> elements, and as such the Figures tab would not appear.

Secondly, I spent a bit of time looking for why the simple <fig> tag you have was not producing the Figures tab. In the end, after some trial and error, I figured out if the <caption> tag has a <p> then it will show up in a Figures tab. I found this eventually by pasting in an eLife figure as an example and then narrowing down the differences.

If you could please take a look at the figure captions you have and whether you would be able to add paragraphs. If not, it may require some changes to the base Lens code or you may need to create some figure enhancements using the enhanceFigure() hook in your particular version of Lens.

@gnott
Copy link
Member

gnott commented Sep 5, 2017

Actually, armed with those details I did another search and I found at least one eLife example which also does not show the Figures tab,

https://lens.elifesciences.org/00639/

I would consider this a bug and not an issue with the XML itself. I will prioritise getting a code fix for this. Thanks for reporting @i-a-n-m!

@gnott gnott added the bug label Sep 5, 2017
@i-a-n-m
Copy link
Author

i-a-n-m commented Sep 6, 2017

Thanks for that.

However, adding <p></p> to the caption titles in I01_a2.xml doesn't make any difference. In fact the I01_a1.xml file doesn't have <p> tags in the captions either.

However, the figures tab does appear just by adding <table-wrap></table-wrap> to the end of the <body>! Not ideal in that you get "Table" appearing at the end of the figures, but it does solve the problem temporarily.

In case that helps the bug hunting.

Ian

@i-a-n-m
Copy link
Author

i-a-n-m commented Sep 6, 2017

Looks like tags got stripped out of my post.

I wanted to say that adding <table-wrap></table-wrap> to the caption titles in I01_a2.xml doesn't make any difference. In fact the I01_a1.xml file doesn't have <p> tags in the captions either.

@gnott
Copy link
Member

gnott commented Sep 6, 2017

Please let me describe what I found in a different way in case it was confusing.

It seems like the reason why I01_a1.xml shows a Figures table but I01_a2.xml does not is because I01_a1.xml has a <table-wrap> and I01_a2.xml does not have a <table-wrap>. That tag is causing the Figures tab to appear.

The Figures tab did appear for file I01_a2.xml after I edited the XML as a test, by adding a <p> to the caption, e.g.

fig id="fig-1">
<label>Figure 1.</label>
<caption>
<title>
Laboratory imaging setup. The sample is illuminated by two diagonal light sources, the camera can be seen in between. The soil block in its metal case and the white reference panel are moved to the right by the translation stage.
</title>
<p>test</p>
</caption>
<graphic xlink:href="/files/JSI-2-a2-g001.png"/>
</fig>

@i-a-n-m
Copy link
Author

i-a-n-m commented Sep 6, 2017

OK, thanks, I understand now. Sorry for my confusing answer; the stripping out of the tags totally messed it up!

@angusgrant
Copy link

Hi did anyone find a solution to this I'm interested in showing figures when they don't have child caption elements (ie make caption element optional) , but I'm unsure how to override the figure class to achieve this?

@gnott
Copy link
Member

gnott commented Feb 5, 2021

Fixed in PR #223 for eLife's example. Considering the age of the original issue, I'm not sure if the original poster would like to see if it fixes their issue(s) too. I'll close this issue for now as fixed.

@gnott gnott closed this as completed Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants