You give an example of how you think it should work in your original post. Does this work at all? Have you actually tried it? Does it do something unexpected?
The code in your original post is not formatted, this makes it much less pleasant and slower to read. You can use format it like this:
```typ
//your code here
```
General recommendations from the FAQ:
Unfortunately for your actual question I don’t know much about citations or using a bibliography file and don’t have any such files around to test with.
#show cite: it => {
if "sandby" in str(it.key) {
underline(it, offset: 0.2em)
} else {
it
}
}
The following citation should be underline @sandby_cost-efficient_2021 and the other one @niu_underwater_2022 not!
#bibliography("test.bib", style: "american-psychological-association")
You can do some hacky editing with show rules but it’s not great, especially where the entry is styled in parts:
#let bib = ```
@article{niu_underwater_2022,
title={Underwater wireless charging system of unmanned surface vehicles with high power, large misalignment tolerance and light weight: Analysis, design and optimization},
author={Niu, Songyan and Zhao, Qingyu and Chen, Haibiao and Yu, Hang and Niu, Shuangxia and Jian, Linni},
journal={Energies},
volume={15},
number={24},
pages={9529},
year={2022},
publisher={MDPI}
}
@article{sandby_cost-efficient_2021,
title={A cost-efficient low-weight autonomous profiler for measurements in polar coastal waters and other regions with strong density gradients},
author={Sandby, Lucas M and Mejdahl, Jens EB and Bjerregaard, Simon H and Melvad, Claus and Rysgaard, S{\o}ren},
journal={HardwareX},
volume={10},
pages={e00207},
year={2021},
publisher={Elsevier}
}
```.text
The bibliography entry for @sandby_cost-efficient_2021 should be underlined and the other one @niu_underwater_2022 not!
#show regex("L. M. Sandby.*gradients,”"): underline
#bibliography(bytes(bib))
Here the regex cannot match the italic part so I stop it before the whitespace before HardwareX.
I would like to underline papers written by me. The PR looks promising, thank you for referring to it, but it will not work now and it is not clear whether it will definitely be merged?
Since you earlier asked why this post wasn’t getting much traction I though I would point this out, it could help you get more responses (on this post and future ones):
This is ends in a question mark but is not a question:
Is there something specific you want to know? Or are you simply looking for confirmation that there is no fixed release date?
Hi @Mark_Dean, I have formatted the code in your post. you can press the pencil icon at the top to see the changes (select “Raw” to see what I actually wrote in the post’s text field). Making your post more readable using the tips @gezepi provided (code formatting, clearly state questions, following the guidelines) usually helps with engagement. Apart from that I want to mention that stating what errors your code produces also helps.
You’d have to check, but maybe my package Alexandria can help here: it lets you get a list of references before rendering it, maybe you can use that to underline some entries (although I’m honestly not sure about it).
Finally, if you feel the response you got has sufficiently answered your question, be sure to give it a checkmark . This will help others find the solution in the future. Thanks!