0

In my last question, I needed assistance with tcolorbox in order to create a "title" for my box in the left margin (and rotated 90 degrees). The solution was great, but in some cases, as in my MWE below, the "titles" run together.

\documentclass[12pt]{article}

\usepackage{framed}
\usepackage{color}

\usepackage[skins,breakable]{tcolorbox} % changed <<<<<<<<<<<<

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

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

%opening
\title{}
\author{}



\begin{document}

\maketitle


Gladsome Light of the Holy Glory of the Immortal Father, Heavenly, Holy, Blessed: O Jesus Christ. Now that we have come to the setting of the sun, and behold the light of evening, we praise God: Father, Son, and Holy Spirit, for meet it is at all times to worship Thee with voices of praise, O Son of God and Giver of life: therefore, all the world doth glorify Thee.\\

We now sing the appointed Prokimenon according to the day of the week:

\section*{Evening Prokimenon}

\begin{mybox}[colframe=blue]{Saturday Evening}
    
    
    The Lord is King: / He is robed in majesty.\\
    
    The Lord is robed, He is girded with strength.\\
    
    For He has established the world, so that it shall never be
    moved.\\
    
    Holiness befits Thy house, O Lord, forevermore!\\
    
\end{mybox}

\begin{mybox}[colframe=blue]{Sunday Evening}

    
    Behold now, bless the Lord, / all you servants of the Lord.\\
    
    
\end{mybox}

\begin{mybox}[colframe=blue]{Monday Evening}

    
    The Lord will hear me / when I call upon Him.\\
    
    When I called, the God of my righteousness heard me.\\
\end{mybox}


\end{document}

Result

I know pretty much nothing about tcolorbox, and am only somewhat acquainted with new environments and new commands in LaTeX, so I did attempt a few things my adding:

\small

and a few other font sizes to the following:

{\small{\itshape #1}}

But since I do not know where to change the font size for the boxes, I am uncertain how to proceed.

1 Answer 1

1

I made some changes to mytitle style. The title now spans the entire text height of the box. In case you know before hand that the box height would be small, you can manually set it to a sufficiently large value for the title to be rendered properly (see 2nd and 3rd boxes in this example).

\documentclass[12pt]{article}

\usepackage{framed}
\usepackage{color}

\usepackage[skins,breakable]{tcolorbox} % changed <<<<<<<<<<<<

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

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

%opening
\title{}
\author{}



\begin{document}
    
    \maketitle
    
    
    Gladsome Light of the Holy Glory of the Immortal Father, Heavenly, Holy, Blessed: O Jesus Christ. Now that we have come to the setting of the sun, and behold the light of evening, we praise God: Father, Son, and Holy Spirit, for meet it is at all times to worship Thee with voices of praise, O Son of God and Giver of life: therefore, all the world doth glorify Thee.\\
    
    We now sing the appointed Prokimenon according to the day of the week:
    
    \section*{Evening Prokimenon}
    
    \begin{mybox}[colframe=blue]{Saturday Evening}
        The Lord is King: / He is robed in majesty.\\
        
        The Lord is robed, He is girded with strength.\\
        
        For He has established the world, so that it shall never be
        moved.\\
        
        Holiness befits Thy house, O Lord, forevermore!
    \end{mybox}
    
    \begin{mybox}[colframe=blue,height=5em]{Sunday Evening}
        Behold now, bless the Lord, / all you servants of the Lord.
    \end{mybox}
    
    \begin{mybox}[colframe=blue,height=5em]{Monday Evening}
        The Lord will hear me / when I call upon Him.\\
        
        When I called, the God of my righteousness heard me.
    \end{mybox}
    
    
\end{document}

enter image description here

4
  • Ok that helps so much. I will probably play around with a few different measurements for the em part you typed. Thanks!
    – Doc
    Commented Mar 11, 2023 at 1:00
  • In the document that my MWE was typed from, several times I have needed to add the newpage command because titles in several places of my document, when I typeset more of my document and re compile, section headers keep occasionally being on the bottom of the page with the body text below the section header is on the next page. Is there a method to automate that so I don't constantly add the newpage command?
    – Doc
    Commented Mar 12, 2023 at 3:16
  • @Doc, maybe this question is of help to you: tex.stackexchange.com/questions/69667/…. If not, you can search for similar questions or ask a new question
    – Zxcvasdf
    Commented Mar 13, 2023 at 8:18
  • thanks, that topic did help. I apologize, I thought I already sent this comment. Thanks again!
    – Doc
    Commented Mar 20, 2023 at 22:15

You must log in to answer this question.

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