1

My MWE:

\documentclass[a4paper]{article}
\usepackage[most]{tcolorbox}
\usepackage{xcolor, soul}
\usepackage{amsthm}

\definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0}
\newcommand{\highlight}[1]{\colorbox{columbiablue!60}{$\displaystyle #1$}}

\newtheoremstyle{definition}
{0.8cm}
{0.8cm}
{}
{0.4cm}
{\bfseries}
{.}
{0.4cm}
{}
\theoremstyle{definition} 
\newtheorem{definition}{{%
\setlength{\fboxrule}{2pt}
\fcolorbox{columbiablue}{orange!30}{Definition}
}}[section]
   
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc}

\newtcolorbox{mycolorbarmarg}[2]{
enlarge left by=4cm,
    enhanced, blank, breakable,
    overlay = {
        \foreach \t in {0,...,#1}{
            \draw[decorate,ultra thick, #2]
                ([xshift=-3-\t mm]frame.north west)
                --
                ([xshift=-3-\t mm]frame.south west);
        },
    }
}
    
\begin{document} 
\section{Section number one}

\sethlcolor{columbiablue}  

\begin{definition}{Name of def}

\begin{mycolorbarmarg}{0}{red}
Some text text text text text text text text text text
\[\highlight{\left(f,g\right) = \int_a^b f(x)g(x)dx}\]
\end{mycolorbarmarg}

\end{definition}
\end{document}

Result enter image description here

What I would like to achieve (how to continue red line till definition 2, and continue colorbox to the numbering 1 of theorem?):

enter image description here

Thank you for any help!

2
  • 3
    It's not clear enough what you're trying to achieve here, but if it's placing the theorem titla on the left and draw a vertical bar between it and the body of the text, I strongly suggest to use tcolorbox and define a custom theorem with it.
    – SebGlav
    Jan 3, 2023 at 22:31
  • @SebGlav I edited my question, hope it became more clear Jan 4, 2023 at 10:56

2 Answers 2

2

With sidebyside and \tcboxmath

EDIT: with \newcommand and \newtcolorbox The code

\documentclass[a4paper]{article}
\usepackage{showframe}
\usepackage[most]{tcolorbox}
\definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0}
\newtcolorbox{mybox}{
    width=1\textwidth,
    enhanced,
    frame hidden,
    left=0pt,
    right=0pt,
    top=0pt,
    bottom=0pt,
    %colback=white,%<--- uncomment
    sidebyside,righthand width=0.6\textwidth,
    sidebyside align=top,
    sidebyside gap=1em,
    segmentation style={draw=columbiablue,solid,line width=4pt},
}
\newcommand{\highlight}[1]{
    \begin{equation*}
        \tcboxmath[enhanced,
            frame hidden,colback=columbiablue!60]%
        {#1}
    \end{equation*}}    
\newcommand{\mytitle}[1]{\hfill\fcolorbox{columbiablue}{orange!30}{\textbf{\textit{#1}}}}
\setlength{\fboxrule}{2pt}
\begin{document}
\begin{mybox}
    \mytitle{Theorem 12.1.}
    \tcblower
    Definition
    \highlight{\left(f,g\right) = \int\limits_a^b f(x)g(x)dx}
\end{mybox}
\end{document}

enter image description here

2
  • nice, thank You for answer I accepted it, also it would be great if you make a macro from it Mar 14, 2023 at 14:46
  • I edited my answer
    – pascal974
    Mar 15, 2023 at 6:48
0

A little bit of manual coding and result achieved (not the best, btw)

enter image description here

\documentclass[a4paper]{article}
\usepackage[russian,english,ukrainian]{babel}
\usepackage[most]{tcolorbox}
\usepackage{xcolor, soul}
\usepackage{amsthm}
\usepackage{ commath }

\definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0}
\newcommand{\highlight}[1]{\colorbox{columbiablue!60}{$\displaystyle #1$}}

\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,calc}

\newtcolorbox{mycolorbarmarg}[2]{
%enlarge left by=4cm,
    enhanced, blank, breakable,
    overlay = {
        \foreach \t in {0,...,#1}{
            \draw[decorate,ultra thick, #2]
                ([xshift=-3-\t mm]frame.north west)
                --
                ([xshift=-3-\t mm]frame.south west);
        },
    }
}

\begin{document} 
\begin{minipage}[t]{0.30\textwidth}
\setlength{\fboxrule}{2pt}
\fcolorbox{columbiablue}{orange!30}{\textbf{\textit{Означення 12.1.}}}
\end{minipage}
\hfill
\begin{minipage}[t]{0.7\textwidth}
\vspace{-0.56cm}
\begin{mycolorbarmarg}{0}{columbiablue}%!90!black}
\vspace{0.15cm}
Definitionn
\begin{equation*}
\highlight{\left(f,g\right) = \int\limits_a^b f(x)g(x)dx}
\end{equation*}
\end{mycolorbarmarg}
\end{minipage}
\end{document}

You must log in to answer this question.

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