2

How can I make a ruled dinkus in LaTeX? Meaning three asterisks *** with a short line (or extending to the paragraph width) on either side of ***.

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Bhanat
  • 1
  • 4
  • 2
    Take a look at this question for some inspiration: https://tex.stackexchange.com/questions/160336/asterism-and-similar-breaking-non-breaking-options – Ingmar Aug 12 '23 at 06:38
  • The difficulty is that I want a line at each end. – Bhanat Aug 12 '23 at 07:12
  • 1
    Use \rule{<width>}{<thickness>} and put the whole thing in a \centerline{} – tsj Aug 12 '23 at 17:37

1 Answers1

2

This is what I came up with. A command with one optional parameter, the width of the whole dinkus as a proporition of \linewidth, where the default is 1 (full width of the line).

dinkus

\documentclass{article}
\usepackage{xhfill}

% https://tex.stackexchange.com/a/233857 \UndeclareTextCommand{\textasteriskcentered}{TS1} \DeclareTextSymbolDefault{\textasteriskcentered}{OT1} \DeclareTextCommand{\textasteriskcentered}{OT1}{\raisebox{-.7ex}[1ex][0pt]{*}}

\newcommand{\dinkus}[1][1]{% \par\vskip0.5\baselineskip% \noindent% \hbox to \dimexpr 0.5\linewidth - #1\linewidth / 2\relax{}% \xrfill[0.5ex]{0.4pt}% ;\textasteriskcentered,\textasteriskcentered,\textasteriskcentered;% \xrfill[0.5ex]{0.4pt}% \hbox to \dimexpr 0.5\linewidth - #1\linewidth / 2\relax{}% \vskip0.5\baselineskip\par}

\usepackage{lipsum} \begin{document} \lipsum[3] \dinkus[0.2] \lipsum[4] \end{document}

Despite my earlier comment, using \centerline in LaTeX is a bad idea according to various TeX.SE answers.

I used the xhfill package for the rules (otherwise difficult to get a raised \hrulefill), and this answer to get an asterisk that should be centered vertically on the line for different fonts. You may have to play with the height of the rule (hard-coded to 0.5ex) to get it perfectly aligned with the asterisks for some fonts. MinionPro didn't look perfect, but everything else I tried did. I don't know if you can make it totally foolproof.

tsj
  • 481