4

enter image description here

\documentclass[12pt‎ , ‎a4paper]{report}‎
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{xcolor}‎
\usepackage{titlesec}‎‎
\usepackage[top=3cm,bottom=3cm,left=2.2cm,right=6.2‎cm,marginparwidth=4.5‎cm‎,headsep=10pt,a4paper]{geometry}‎
\usepackage{titletoc}
‎\newcommand{\exersize}{‎‎\section*‎{exersize}‎‎‎}‎
%%%%%%%%%%%%%%%%%%%%%%%
‎\begin{document}‎‎‎‎

‎\chapter{Chapter one}‎

‎‎\section{Section 1}‎‎‎‎
\exersize
‎
‎\end{document}‎
2
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – user31729
    Commented Apr 27, 2014 at 6:31
  • Please have a look on various possibilities, such as amsthm or tcolorbox etc.
    – user31729
    Commented Apr 27, 2014 at 6:34

1 Answer 1

2

An example with a theorem like environment:

\documentclass[12pt,a4paper]{report}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{xcolor}
\usepackage[top=3cm,bottom=3cm,left=2.2cm,right=6.2cm,marginparwidth=4.5cm,headsep=10pt,a4paper]{geometry}
\usepackage{blindtext}

\newmdtheoremenv[%
  outerlinewidth=2,roundcorner=2pt,leftmargin=0,rightmargin=0,
  outerlinecolor=blue,innertopmargin=\topskip,splittopskip=\topskip,
]{exercise}{Exercise}%[section]

\begin{document}
\chapter{Chapter one}
\section{Section 1}

\begin{exercise}[optional argument]
foo bar baz
\end{exercise}

\begin{exercise}
\blindtext
\end{exercise}

\blindtext
\end{document}

enter image description here

7
  • thanks very much. I whant no marginpar like style's marginpar chapter and box just around "Exersize"
    – iman
    Commented Apr 27, 2014 at 7:10
  • that is easy: \fcolorbox{blue}{white}{Exercise}
    – user2478
    Commented Apr 27, 2014 at 7:13
  • I whant no Margin
    – iman
    Commented Apr 27, 2014 at 7:25
  • @iman: Which margin do you mean? Between the box frame and "Exercise"? Reduce \fboxseprule then when using \fcolorbox.
    – user31729
    Commented Apr 27, 2014 at 7:31
  • Tanks. I whant no border the page and no fancy for section Exercise.
    – iman
    Commented Apr 27, 2014 at 7:32

You must log in to answer this question.

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