1

I am trying to type a margin note (in book format) on the left side with a line underneath, but "perpendicular" to the main text as shown in the attachment below:

enter image description here

\documentclass[12pt]{article}

\usepackage{tcolorbox}

\usepackage{mdframed}

\newenvironment{myenv}[1]
{\mdfsetup{
        frametitle={\colorbox{white}{\space#1\space}},
        innertopmargin=10pt,
        frametitleaboveskip=-\ht\strutbox,
        frametitlealignment=\center,
        everyline=true
    }
    \begin{mdframed}%
    }
    {\end{mdframed}}


\newtcolorbox[auto counter,number within=section]{pabox}[2][]{%
    colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,
    title=Examp.~\thetcbcounter: #2,#1}

\title{Prayerbook}
\author{}

\begin{document}

\maketitle

\begin{pabox}[colback=yellow]{Paschal Season}
    
    From Bright Monday through the Leavetaking of Pascha, after the initial “Amen”, we immediately say: 
    
\end{pabox}


\begin{tcolorbox}[colframe=red!75!black,title=Pascal Season]
    
    From Bright Monday through the Leavetaking of Pascha, after the initial “Amen”, we immediately say:
    
\end{tcolorbox}

\end{document}
1
  • In the image, the perpendicular text is only in the indentation, not in the margin. If it fits on one page, one can use a minipage or \parbox, a savebox (to measue the height) and \rotatebox (graphicx). Splitting across two pages is much more difficult. Feb 22, 2023 at 15:33

1 Answer 1

2

You can do this by defining a user-defined key in tcolorbox. A new key mytitle is defined in this code, which is subsequently used to define a new box style.

\documentclass[12pt]{article}

\usepackage{blindtext}
\usepackage[skins]{tcolorbox}

\tcbset{%
    mytitle/.style={%
        enhanced,
        overlay={
            \node [rotate=90, anchor=south, fill=tcbcolframe!25] at (frame.west) {\itshape #1};
        },
    },
}

\newtcolorbox{mybox}[2][]{%
    mytitle={#2},
    toprule=0pt,
    bottomrule=0pt,
    rightrule=0pt,
    sharp corners,
    #1
}

\title{Prayerbook}
\author{}

\begin{document}
\maketitle
\blindtext

\begin{mybox}[colframe=blue]{Paschal Season}
    From Bright Monday through the Leavetaking of Pascha, after the initial “Amen”, we immediately say:\\
    \blindtext
\end{mybox}
\end{document}

enter image description here

1
  • Thanks so much! I tried looking at the manual for tcolorbox and a couple different variations but none that worked as I needed.
    – Doc
    Feb 22, 2023 at 22:30

You must log in to answer this question.

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