From fdc45b1c20ce34ed3481e43882244ded133d6ce1 Mon Sep 17 00:00:00 2001 From: Lars Frost <larsf@fsmpi.rwth-aachen.de> Date: Mon, 23 Dec 2024 12:55:27 +0100 Subject: [PATCH] Improve underline on links with code content --- template.typ | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/template.typ b/template.typ index 18f6a37..89b8eb9 100644 --- a/template.typ +++ b/template.typ @@ -15,7 +15,7 @@ show heading.where(level: 2): set block(above: 2.0em, below: 0.5em) show link: it => { set text(fill: blue) - underline(it) + underline(it, offset: 1.2pt) } set heading(numbering: "1.1") @@ -26,14 +26,10 @@ codly() show table.header: strong show raw.where(block: false): r => { - let e = 0.25em + let w = 0.25em + let h = 0.4em let f = "DejaVu Sans Mono" // I think this is the default mono font. See https://github.com/typst/typst/issues/2870 - // highlight(fill: gray, radius: 3pt, extent: e, { - // h(e) - // text(font: f, r) - // h(e) - // }) - box(inset: (x: e, y: e), fill: highlightBgColor, radius: 3pt, baseline: e, text(font: f, r)) + box(inset: (top: 0.2em, x: w, bottom: h), fill: highlightBgColor, radius: 3pt, baseline: h, text(font: f, r)) } show figure.caption: it => block({ -- GitLab