We are currently planning to migrate to a different platform for the forum. We will announce this fact both here and on Twitter, once we have settled on a solution.

Internal links after export

edited August 2 in Features

Hello there, im new to Zettlr and im loving it. I tried out a few different solutions now but considering that this is open source and working quite good already I think im going to stick with it. Im pretty much thinking of using it for myself but I will also require the possibility to export ..probably to show what I did so far to my prof.

What kind of rubbed me however is the fact that while making links to internal notes is quite easy... I have kind of a trouble to warp my head around making surfable links to parts of the notes.

For example if i am planning to export to html and i need a link to a spefic location i probably would add somthing like

<\a id="lession1"></a>

as reference

and use html

<\a href="#lession1">Lession.1</a>

or MD as [\Lession 1](#lession1)
to link to it. Luckily headlines are alread referenced by an id automatically, so in those cases i dont need an additional reference tag with id.

This is very similar to when you want to export to PDF as headlines are automatically compiled with a \label{lession1} for example or i could use it inside the text directly writing \lable{}. What i found out however is that this would not work with the MD syntax i used before anymore , because [\Lession 1](#lession1) will be translated as link to a file but not a lable. So what I came up with to add my own command for latex in the beginning.

\newcommand{\Link}[1]{{\hyperref[#1]{ \underline{\nameref{#1}}}}}
[can be use as \Link{Something} inside Zettlr]

This has however the downside that this isn't a markdown command anymore... even though it does in principle the same.

.. for me this begs the question why it has to be that complicated. As a noob I wonder why

1) [[ * ]] is only made in such a way to only work with Notes but not # Headlines e.g.
2) Why can I not reference to #tags too in a similar fashion as with html and latex. or at least put in a uniqe lable myself.
3) Why is there not an export polling on the compilation of the MD snytax [[ ]].

For example

# Something -> is a headline and has the label by that name
#Something -> could be a tag that that is also used as label (at the moment this syntax is a tag that isnt labled due to being not unique)
[[Something]] -> should be understood as surfable internal link, linking labels

depending on my target export [[Something]] could be compiled in either of those ways described above. That way i wouldn't have the need to search for hours how to do this and also it would not require to change what I have written in case i need the html export instead, it would mirror the principle of referencing in at least those two export formats ...and especially would i actually make use of MD that way. Of course this will require some sort of uniqe labeling system that doesnt seem to exist yet or isnt part of MD? A uniqe tag/lable could maybe be written like this !#tagname .

So I also wondered if there is a way for me to tell the MD "compiler" on how to change this, but unfortunately [[ ]] seems to be only thought of as Zettlers way of linking notes only and is probably hard coded, what is kind of a let down but certainly understandable when it is wanted to fracture your knowlage into single files only to keep the search speed usable. But this still doesnt change the fact that it makes it a ussless comand in my opinion if it just results in me adding extra syntax on top to make the linking in my end target possible. So if anyone reads this... i kind of hope you will rethink a possible rework in that direction... or at least add something to your turorial at some point to address this problem.

Sign In or Register to comment.