I am trying to add dotted line from left-edge to right-edge of tabular after rows. There are 3-problems with my best attempt (code & screenshot below): 1) The length of the dotted line equals width of minipage instead of table, 2) The dots don't exactly start at left edge of the table (there is a slight gap), 3) Reducing dot size also changes the start point of the dotted line, further mismatching the start points of lines with different dot sizes (I would like to have lines with different dot sizes, but all starting & ending at same edge). The left edge of the leftmost dot should touch the left edge of table (just like \hrule
used on the first line), and right edge of the rightmost dot should touch the right edge of the table. I am using lualatex
.
NOTE: I have come across hacks on stack exchange that use dashes instead of dots, I am looking for dots so please don't post any dash answers. Also, I cannot move to another environment for now, so it has to be a solution for tabular
environment. Also, please don't post tikz
or other slow drawing tricks. If it isn't clear from the description: I don't intend to manually specify length of the table length like n pt/cm/in
, the solution would be able to figure out length of table just like the \hrule
I use for the first line. Lastly: Given the emphasis on PDF tagging & accessibility in TUG 2020, the solution ideally won't make pdf-accessibility text-to-speech utility to start speaking 'dot dot dot dot dot...' a gazillion times.
Code:
% >> lualatex table.tex
\documentclass[notitlepage,letterpaper]{article}
\usepackage{array}
\begin{document}
\begin{minipage}[t][1in][t]{3in}
Hello world!\\
\begin{tabular}[t]{@{}rll@{}}
\noalign{\hrule height 0.5pt}
a & some & text \\
\noalign{\dotfill}
b & some & other text \\
\noalign{\dotfill}
b & some more & text \\
\noalign{\dotfill}
\end{tabular}%
\end{minipage}
\end{document}
Screenshot: (I intend to start smaller sized dotted line from left edge of red box, and end it at its right edge (ideally the dots touching the edge))
tikz
-based solution... Moreover, the reason I ask that the solution should work with different dot size is not that I cannot change size, it has more to do with the fact that different dot sizes start at different points (if you zoom in). One can change dot size with something like\noalign{{\fontsize{4pt}{\baselineskip}\selectfont\dotfill}}
, but as you would see the first dot's starting point again varies by size. So one cannot just add a hack that deducts some constant side-bearing size, it has to be dependent on the dot size.