1

I have defined an mdframed environment as in the MWE below. I would like "Box" in the frametitle to be in small caps. How do I achieve that?

\documentclass[a4paper,11pt,oneside,openany,showtrims,strict,extrafontsizes]{memoir}
\newcounter{infobox}[chapter]
\renewcommand{\theinfobox}{\thechapter.\arabic{infobox}}
\usepackage[skipabove=25pt,skipbelow=25pt,leftmargin=10pt,rightmargin=10pt,framemethod=TikZ]{mdframed}
\usepackage{lipsum}

\newenvironment{infobox}[1][]{%
\refstepcounter{infobox}%
\begin{mdframed}[%
frametitle={Box \theinfobox\ #1},
skipabove=\baselineskip plus 2pt minus 1pt,
skipbelow=\baselineskip plus 2pt minus 1pt,
linewidth=0.5pt,
frametitlerule=true,
repeatframetitle=true,
font=\small,
]%
\addcontentsline{lob}{section}{\numberline{\theinfobox}#1}%
}{%
\end{mdframed}
}
\makeatletter
\newcommand\listboxname{Boxes}
\newcommand\listofboxes{
\chapter*{\listboxname}
\@starttoc{lob}
}
\makeatother

\begin{document}

\tableofcontents
\newpage
\listoffigures
\listofboxes

\chapter{Chapter one starts here}
\section{Heading}

\lipsum[4]
\begin{infobox}[Title of the first test box]
\label{orgspecialblock1}
\lipsum[4]
\end{infobox}
\begin{infobox}[Title of the second test box]
\label{orgspecialblock2}
\lipsum[4]
\end{infobox}

\begin{figure}
\caption{\label{orgspecialblock3}ksfkhjsdkjhfs}
\includegraphics[width=0.9\linewidth]{pou.png}
\end{figure}

\chapter{Chapter two starts here}
\section{Heading}

\lipsum[4]
\begin{infobox}[Title of the third test box]
\label{orgspecialblock1}
\lipsum[4]
\end{infobox}
\begin{infobox}[Title of the fourth test box]
\label{orgspecialblock2}
\lipsum[4]
\end{infobox}


\end{document}
2

The default OT1 encoded font doesn't have a small caps version. Your log file should show the following warning:

LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefined
(Font)              using `OT1/cmr/bx/n' instead

Add:

\usepackage[T1]{fontenc}

and then just use \textsc{Box} in your box title.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.