Replies: 3 comments 7 replies
-
You can already do that using show and set rules on your references and links |
Beta Was this translation helpful? Give feedback.
-
I think you want the hyperref behaviour: have some color around the link when the pdf file is opened in a viewer, and have no color around the link if it is printed on a paper (the same with text color that disappears when printed).
Not sure what you mean exactly. I never had problems with it. If you mean the misplaced rectangles in the first picture, I never had those, it looks like a bug in your source code. |
Beta Was this translation helpful? Give feedback.
-
Here's an example of a show rule with a few options: (edit: if you're ok with this style also appearing when printed) // Show links with a box around them or filled with a color
#show link: this => {
let show-type = "box" // "box" or "filled", see below
let label-color = green
let default-color = rgb("#ff66ff")
if show-type == "box" {
if type(this.dest) == label {
// Make the box bound the entire text:
set text(bottom-edge: "bounds", top-edge: "bounds")
box(this, stroke: label-color + 1pt)
} else {
set text(bottom-edge: "bounds", top-edge: "bounds")
box(this, stroke: default-color + 1pt)
}
} else if show-type == "filled" {
if type(this.dest) == label {
text(this, fill: label-color)
} else {
text(this, fill: default-color)
}
} else {
this
}
}
== Heading <some_heading>
https://example.com \
#link(<some_heading>)[Link to heading] \
#link("https://example.com") \
#link("https://example.com")[See example.com] |
Beta Was this translation helpful? Give feedback.
-
It would be great to be able to control the colors of the references/citations as you can control them in hyperref. This is very useful for creating documentation or educational content, for example:
The way hyperref handles the layout is terrible but it is useful in the cases mentioned
Beta Was this translation helpful? Give feedback.
All reactions