From 44bd05b415c62911d02d2e1bbf65e5190c12aff3 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Mon, 10 Jul 2023 18:57:49 -0400 Subject: [PATCH] main.typ: add pdfref option to lref --- main.typ | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.typ b/main.typ index d5eba9b..2c07ebf 100644 --- a/main.typ +++ b/main.typ @@ -16,10 +16,18 @@ // use paths like "/problems/problem.pdf" // which will translate to "/home/user/docs/problems/problem.pdf" #let lref( + // whether or not to prepend 'pdfref://' to the link. as long as the handler + // is installed, it allows specifying the page number linked to + // see https://github.com/dogeystamp/pyinstantref for details + pdfref: false, url, text ) = { - return link(settings.prefix + url, text) + let realUrl = settings.prefix + url; + if (pdfref) { + realUrl = "pdfref://" + realUrl + } + return link(realUrl, text) } #let gen_title(