I've (mis)used LaTeX on and off for the past 10 years and am now trying out ConTeXt, mostly because it allows alignment to a baseline grid. I'd like to produce a rule (line) below some text such that the rule:
- is some distance (1pt, let's say) below the baseline of the text (assume the text fits on one line),
- is as wide as the text area (\textwidth), and
- terminates on the right end with a small black square vertically centered on the rule.
In LaTeX, I can do something like this:
\documentclass{article}
\usepackage{calc}
\begin{document}
\makebox[0pt][l]{%
\rule[-1pt]{\textwidth-4pt}{.4pt}%
\rule[-2.6pt]{4pt}{4pt}
}%
This text sits on the fancy rule.
\end{document}
Which gives me this:
How can I do something similar in ConTeXt? I've tried overlays and \blackrule
, but I don't know how to move a \blackrule
vertically. I'm open to any solution whether it involves overlays and \blackrule
s or something else, but I would like the text to align to the baseline grid if possible.
Best Answer
There are many other ways to do this in ConTeXt, but a literal translation of your method will be the following:
which gives