I have difficulty writing a compact command that allows me to insert a text between two lines.
I read some links such as this and this, but each one treats the left and right line separately
\documentclass{article}
\usepackage{amsmath} %<<===
\usepackage[normalem]{ulem}
\usepackage{xcolor}
\newcommand\gsout{\bgroup\markoverwith{\textcolor{gray}{\rule[0.5ex]{2pt}{2.5pt}}}\ULon}
\newcommand*{\sxrule}[1][3em]{\textcolor{gray}{\rule[0.5ex]{#1}{2.5pt}}\;}
\begin{document}
\sxrule Osservazioni \gsout{\hfill}
\end{document}
Have any suggestions? thanks
Best Answer
Perhaps something like this:
Here's the code:
The
\sxrule
macro has an optional argument that controls the length of the "left hand" line. As in the OP, this defaults to3em
.Judging from the comments, perhaps the definition
is better as now
\sxrule{Osservazioni}
puts "Osservazioni" in bold: