Replies: 1 comment
-
|
Hi there ... the only thing that you can reference with internal links are other pages like <!--
@ref: <lia-keep>
<a href="javascript:void(0)"
onclick="
location.hash = '@2';
setTimeout(() => {
const img = document.querySelector('#@1');
if (!img) return;
img.scrollIntoView({ behavior: 'smooth' });
const previousTransition = img.style.transition;
img.style.transition = 'outline 0.3s ease';
img.style.outline = '4px solid #FFD54F';
img.style.outlineOffset = '4px';
setTimeout(() => {
img.style.outline = '';
img.style.outlineOffset = '';
img.style.transition = previousTransition;
}, 1200);
}, 500);
">
@0
</a>
</lia-keep>
@Fig: @[ref(Fig. @0,fig-@0)](@1)
-->
# References
Some internal formula $ f(a,b,c) = (a^2+b^2+c^2)^3 $<!-- id="formula-123" --> with a uniqe id.
@[ref(title,formula-123)](#refernces)
## some pages
<!-- id="fig-12" -->
!?[Not a figure](https://www.youtube.com/watch?v=lhSjYT7pWkw)
## in between
Here is the reference again @[ref(Formula 123,formula-123)](#refernces)...
And you can also create custom versions of this macro
@Fig(12,#some-pages) or @[Fig(12)](#some-pages)
both work the same, but the second kind of writing would still preserve the link for other Markdown-interpreters...I will create a template for this ;-) ... but the basic idea is, that with using HTML-comments, you can add styling, classes, etc. but also id to an element. A comment before a markdown-block will add all settings to the block, while appending a comment will only affect that little element. You can of course also use HTML directly ... However, in the example I had added some ids to different elements on different sites, this has to be done manually. A ref macro in this case takes 3 parameters, a title, the id of the element you are referring to, and the title of the slide. When you click on the new link, the javascript code will be executed, it will jump to the slide and after 500 ms scroll the element with the defined id into view and highlight it shortly ... The @ before the link is just another type of calling a macro, that will handle the URL parameter specifically and translate relative URLs if required. However, this will preserve the link to the slide for other Markdown-interpreters ... If you have a specific convention of naming images and formulas, you can define your own macro, which will reuse the ref macro but predefine some parameters, like for This approach requires you to add the title of the slide/section, since LiaScript interprets the Markdown and cannot perform an entire analysis of the document. We apply an incremental parsing approach that, on a first run, identifies the sections and titles only and then only parses the page that is displayed ... Therefor, it cannot know that a figure or formula is displayed on a certain slide ... To answer your second question. You could try this template https://github.com/LiaTemplates/citations ... it should allow you to add an entire bibliography and add references within your document ... I hope, I could answer your questions? Kind regards, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to transfer a textbook style manuscript from pandoc to LiaScript. The manuscript relies on automatic consecutive numbering of equations, figures, and bibliography.
Is there a way to cross reference figures, equations and tables like in Latex or pandoc crossref ?
Two examples:
{#fig:label}@Fig:label[@bib-key]:::{#refs}The closest thing from the basic documentation would be using hard coded slide numbers in LiaScript. But that would result in a large effort when inserting some new information (as can be seen with the wrong number for the next slide in the docs ;-) )
The bibliography could probably be replaced with footnotes without too much hassle. But loosing the automatic numbering and referencing of equations and figures would be a major problem to transfer my manuscript.
Is there an easy or already implemented way with macros or did I miss something in the docs?
Beta Was this translation helpful? Give feedback.
All reactions