我有一个自定义函数,它使用图标来格式化 URL。我希望标签和图标之间的空格不间断。为此,我会使用字符~
,但这在代码中不起作用。
例如
== Unsuccessful attempt
#let mylink(label, dest) = {
link(dest)[#emph(underline(label + "~" + box("URL!")))]
}
#mylink("hello", "https://wikipedia.org") // FAILS as ~ is used as a character
== Without code
hello~#box("URL!") // works
#link("https://wikipedia.org")[hello~URL!] // works
#link("https://wikipedia.org")[#underline("hello~URL!")] // FAILS as ~ is used as a character