![如何使用命令“\exersize”创建没有边距的部分,如下所示:](https://linux22.com/image/289239/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E2%80%9C%5Cexersize%E2%80%9D%E5%88%9B%E5%BB%BA%E6%B2%A1%E6%9C%89%E8%BE%B9%E8%B7%9D%E7%9A%84%E9%83%A8%E5%88%86%EF%BC%8C%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%EF%BC%9A.png)
\documentclass[12pt , a4paper]{report}
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage[top=3cm,bottom=3cm,left=2.2cm,right=6.2cm,marginparwidth=4.5cm,headsep=10pt,a4paper]{geometry}
\usepackage{titletoc}
\newcommand{\exersize}{\section*{exersize}}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\chapter{Chapter one}
\section{Section 1}
\exersize
\end{document}
答案1
具有类似定理的环境的一个例子:
\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}