1

I'd like the following code:

\documentclass{article}

\usepackage{lipsum}

% macro definitions...

\begin{document}

\begin{signenv}{A}
\lipsum[1]
\end{signenv}

\end{document}

To produce this:

A top bottom frame with a sign

In words: the signenv environment's paragraph is flanked from the top and from the bottom by two lines the length of the paragraph. In the middle of the top line there's a diamond with a letter inside it. The letter is determined by the mandatory parameter passed to the signenv environment. There's some space between the diamond and the top line.

signenv must not embed the paragraph inside a TeX box/a tcolorbox etc.

2
  • Realgarding your last paragraph: what's the reason for not wanting to use tcolorbox?
    – leandriis
    Commented Jul 16, 2021 at 9:14
  • @leandriis: I've tried using tcolorboxs before, but found them to be very problematic when used in combination with programmable margin notes, a feature that I require.
    – Evan Aad
    Commented Jul 16, 2021 at 9:37

1 Answer 1

3

enter image description here

\documentclass{article}

\usepackage{lipsum}

\newenvironment{signenv}[1]{%
\par
\smallskip
\noindent\hrulefill\ %
\begin{picture}(20,20)(0,0)
\put(10,0){\makebox(0,0){#1}}
\put(0,0){\line(1,1){10}}
\put(0,0){\line(1,-1){10}}
\put(20,0){\line(-1,1){10}}
\put(20,0){\line(-1,-1){10}}
\end{picture}\ %
\hrulefill
\par
\bigskip}
{\par\medskip\noindent\hrulefill\par\smallskip}

\begin{document}

\begin{signenv}{A}
\lipsum[1]
\end{signenv}

\end{document}
9
  • Thank you. This is great. Could you please create the lettered diamond in its own macro sign{A}/sign{B}/etc. so that I can use it inline in order to explain what each of the lettered diamonds mean? E.g. "The symbol \sign{C} means that the enclosed paragraph is a caveat, whereas the symbol \sign{A} means that it's an anecdote."
    – Evan Aad
    Commented Jul 16, 2021 at 9:42
  • @EvanAad you can do that, just cut the bit from begin picture to end picture and stick it in \newcommand\mydiamond[1]{..... Commented Jul 16, 2021 at 9:44
  • But then the diamond drops below the line of text.
    – Evan Aad
    Commented Jul 16, 2021 at 9:50
  • 1
    I see. And keeping the lines on the same page as the content? Can this be arranged?
    – Evan Aad
    Commented Jul 16, 2021 at 10:15
  • 1
    @EvanAad add \nopagebreak before any skip Commented Jul 16, 2021 at 10:22

You must log in to answer this question.

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