1

I was following this example

\documentclass[12pt,a4paper]{report}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}% just to generate text for the example
\usepackage[T1,T2A]{fontenc}
\usepackage[cp1251]{inputenc}
\usepackage[serbianc,english]{babel}
% example style
\declaretheoremstyle[
headfont=\bfseries, 
notebraces={[}{]},
bodyfont=\normalfont\itshape,
headpunct={},
postheadspace=\newline,
postheadhook={\textcolor{red}{\rule[.6ex]{\linewidth}{0.4pt}}\\},
spacebelow=\parsep,
spaceabove=\parsep,
mdframed={
    backgroundcolor=red!20, 
        linecolor=red!30, 
        innertopmargin=6pt,
        roundcorner=5pt, 
        innerbottommargin=6pt, 
        skipabove=\parsep, 
        skipbelow=\parsep } 
]{myexamplestyle}

% example environment - thmtools
\declaretheorem[
  style=myexamplestyle,
  name=Примјер,
  numberwithin=chapter
]{example}

\begin{document}
\chapter{Test}
\begin{example}[Additional text]
\lipsum[4]
\end{example}
\end{document}

where trying to put Cyrillic name "Примјер" as a name for the 'example', but it does not work. I don't know how to allow T2A encoding within \declaretheorem. Could someone assist me?

closed as unclear what you're asking by egreg, Zarko, user13907, Maarten Dhondt, Svend Tveskæg Feb 21 '16 at 13:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to TeX.SX! Do you really need cp1251? Isn't UTF-8 better? – egreg Jan 19 '16 at 16:40
  • In my test, both with CP1251 and UTF-8, I get Примјер – egreg Jan 19 '16 at 16:45
0

Thanks to @egreg, I have now complete, working code.

\documentclass[12pt,a4paper]{report}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}% just to generate text for the example
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[serbianc,english]{babel}
% example style
\declaretheoremstyle[
    headfont=\bfseries, 
    notebraces={[}{]},
    bodyfont=\normalfont\itshape,
    headpunct={},
    postheadspace=\newline,
    postheadhook={\textcolor{red}{\rule[.6ex]{\linewidth}{0.4pt}}\\},
    spacebelow=\parsep,
    spaceabove=\parsep,
    mdframed={
        backgroundcolor=red!20, 
            linecolor=red!30, 
            innertopmargin=6pt,
            roundcorner=5pt, 
            innerbottommargin=6pt, 
            skipabove=\parsep, 
            skipbelow=\parsep } 
    ]{myexamplestyle}

    % example environment - thmtools
    \declaretheorem[
      style=myexamplestyle,
      name=Примјер,
      numberwithin=chapter
    ]{example}

    \begin{document}
    \chapter{Test}
    \begin{example}[Additional text]
    \lipsum[4]
    \end{example}
    \end{document}

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