1

The MWE is mostly self-explanatory. I would like to make a command which produces the given output. The command should take a mandatory argument specifying the amount of space above/below the text. The text is lowercase small caps.

Output of the MWE

\documentclass[11pt]{article}
\usepackage{graphicx}

\newcommand\oblongdot{\protect\resizebox{0.75pt}{3pt}{$\cdot$}}

\makeatletter
\newcommand\cdotfill{%
    \leavevmode\cleaders\hb@[email protected]{\hss\oblongdot\hss}\hfill\kern\z@
}
\makeatother

\newcommand\cdotrule{\makebox[4in]\cdotfill}

\begin{document}

    \begin{center}
        \cdotrule \\
        \textsc{\LARGE vertically centered text} \\ 
        \cdotrule
    \end{center}

\end{document} 

Inspired by

handbook

2
  • In the last picture, the dotted lines aren't vertically centred either.
    – Bernard
    Aug 30, 2020 at 8:23
  • @Bernard I know, I'm not trying to replicate it exactly. Aug 30, 2020 at 9:16

2 Answers 2

2

The dots are not vertically centered. You can use the \vcenter box to align material. You can modify your \oblongdot macro as:

\newcommand\oblongdot{\protect$\vcenter{\resizebox{0.75pt}{3pt}{$\cdot$}}$}

enter image description here

\documentclass[11pt]{article}
\usepackage{graphicx}

\newcommand\oblongdot{\protect$\vcenter{\resizebox{0.75pt}{3pt}{$\cdot$}}$}

\makeatletter
\newcommand\cdotfill{%
    \leavevmode\cleaders\hb@[email protected]{\hss\oblongdot\hss}\hfill\kern\z@
}
\makeatother

\newcommand\cdotrule{\makebox[4in]\cdotfill}

\begin{document}

    \begin{center}
        \cdotrule \\
        \textsc{\LARGE vertically centered text} \\ 
        \cdotrule
    \end{center}

\end{document} 
1
  • +1 for partial solution Aug 30, 2020 at 17:32
1

I could not get your macro to work so with hrule -- as defined here --

https://tex.stackexchange.com/a/389279/197451

enter image description here

\documentclass[11pt]{article}
\usepackage{cellspace, tabularx, booktabs}
\usepackage[x11names]{xcolor}
\usepackage{garamondx}
\addparagraphcolumntypes{X}

\begin{document}

\begin{titlepage}
  \setlength{\cellspacetoplimit}{11pt}
  \setlength{\cellspacebottomlimit}{12pt}
  \begin{center}
    \huge \textit{Edward Lear}\vspace{10ex}
    \Huge\bfseries
    \begin{tabularx}{\linewidth}{S{>{\centering\arraybackslash}X}}
      \toprule
      \color{IndianRed3} The Pobble Who Has No Toes \\
      \bottomrule
    \end{tabularx}
  \end{center}
\end{titlepage}

\end{document} 
2
  • (+1) Congratulations for Edward Lear!
    – Bernard
    Aug 30, 2020 at 8:25
  • I've seen that already, not what I'm looking for. Aug 30, 2020 at 9:15

You must log in to answer this question.

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