I am working on a longer document with different reliabilities of the sources. At first, I wanted to change the font color to indicate the different levels (red - low, yellow - medium, green - high confidence). Not surprisingly, this made the text colorful and less readable. A second idea was to change the background of the text, offering a bit more readability, but it is still more hindering than useful.

Now, I would like to add a fingerprint-like visualization/marking next to the text. The confidence of the text is given rather on a paragraph than a sentence level, hence, little inaccuracies are not an issue.

Please consider this very professional sketch of how I would imagine it: enter image description here

Since my LaTeX experience with anything other than "standard texts" is quite low, I am not even sure how to begin with trying something like this. Especially when I need to somehow "sync" between both parts. My first idea here was to use minipages, but then I had no idea how to indicate up to which height the "red part" should go. Right now, the document has 50 pages and I expect it to double its number of pages until I am finished and about 90% of them will need such a marking. Therefore, a method that does not require any kind of pixel values or much manual correction would be great.

I am very open to other useful ideas of how to indicate "levels" of the text passages visually, without hindering readability. Just now, I had the idea that it may be easier to color the first (few pixels?) part of each line with the "current" color, which may be easier.

Thanks a lot for your ideas and help,


PS: If useful/needed: I am mainly working with overleaf

Update: After using the great solution by Sandy G., I have an issue with footnotes. They appear on the end of the enclosed text block, but no longer on the footer of the page. I use the (standard) \footnote{} enter image description here


2 Answers 2


Here is a possibility using tcolorbox.

enter image description here



\tcbuselibrary{skins, breakable}

blankest, breakable,
before upper={\parindent15pt},
beforeafter skip balanced=0.2\baselineskip plus 2pt,
borderline west={8mm}{-20mm}{#1}







  • Thank you! That's exactly how I imagined it :)
    – Raubwurst
    Dec 13, 2023 at 13:55
  • Update: It seems like this approach has issues with footnotes, which are no longer on the footer of the page, but after the enclosed text block. I updated my initial post with a screenshot, where the footnotes are followed by two lines of text from another colored fprint
    – Raubwurst
    Dec 13, 2023 at 14:32
  • @Raubwurst \usepackage{footnote} \BeforeBeginEnvironment{fprint}{\savenotes} \AfterEndEnvironment{fprint}{\spewnotes} Dec 13, 2023 at 14:40
  • @samcarter_is_at_topanswers.xyz thank you :3 All of you are awesome!
    – Raubwurst
    Dec 14, 2023 at 8:29
  • @Raubwurst You're welcome! Have fun with @ SandyG's great answers! Dec 14, 2023 at 8:47

Here's a simple example using \marginpar:

enter image description here


 For some embedding \dots \marginpar{\leafNE\leafNE\leafNE}\lipsum[4]
  • 2
    Thank you for the suggestion!
    – Raubwurst
    Dec 13, 2023 at 13:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .