创建一个允许我们返回到行首的命令

创建一个允许我们返回到行首的命令

使用以下代码

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme}
\usepackage[tikz]{bclogo}
\usepackage{tikz,tkz-tab,moreverb} % tableau de signe moreverb not needed
\usetikzlibrary{arrows}
\usepackage[french]{babel}
\usepackage{pifont} %bouni
\usepackage{fancybox} %pour faire l'encadrement
\usepackage[usestackEOL]{stackengine}
\usepackage{verbatim}
\usepackage{color}
\usepackage[final]{pdfpages} %pour inserer une page pdf
%---- Dimensions des marges ---
\usepackage{geometry}
\geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm}
%----New Structure Exercice -----
\newtheoremstyle{sboxexc}% name of the style to be used
  {\topsep}% measure of space to leave above the theorem. E.g.: 3pt
  {\topsep}% measure of space to leave below the theorem. E.g.: 3pt
  {\itshape}% name of font to use in the body of the theorem
  {0pt}%  of space to indent
  {\bfseries}% name of head font
  {}% punctuation between head and body
  { }% space after theorem head; " " = normal interword space
  {\thmname{#1}}% Manually specify head
\newcounter{counter}
\setcounter{counter}{1}
\theoremstyle{sboxexc}
\newcommand{\optionaltext}{}
\newtheorem*{Exc}{\shadowbox{ Exercice \arabic{counter}\optionaltext}\\}
\newcommand{\exo}[2][]{\renewcommand{\optionaltext}{#2}\begin{Exc}\normalfont}
\newcommand{\finexo}{\renewcommand{\optionaltext}{}\end{Exc}\addtocounter{counter}{1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{definition}
\newtheorem{definition}{Définition}
%%%%%%%%%%%
\begin{document}
\begin{definition}
cccccc
\end{definition}
Now,...
\begin{definition}
\begin{itemize}
\item [(1)] cccccc
\end{itemize}
\end{definition}
Now,...
%%%%%%%%%%%%%%%%debut exercice%%%%%%%%%%%%%%%%%%%
\exo{}
aaaaaa
\finexo
%%%%%%%%%%%%%%%% fin exercice%%%%%%%%%%%%%%%%%%%
Now,...
%%%%%%%%%%%%%%%%debut exercice%%%%%%%%%%%%%%%%%%%
\exo{}
\begin{itemize}
\item [(1)] aaaaaa
\end{itemize}
\finexo
%%%%%%%%%%%%%%%% fin exercice%%%%%%%%%%%%%%%%%%%
\end{document}

我明白了

在此处输入图片描述

我想创建一个名为 的命令,例如,\sauteligne当我想返回到新行时,它允许我这样做。当我想返回到新行时,我只需输入\begin{definition}\sauteligne \begin{itemize} \item [(1)] cccccc \end{itemize} \end{definition}\exo{}\sauteligne \begin{itemize} \item [(1)] aaaaaa \end{itemize} \finexo。然后我将得到

在此处输入图片描述

答案1

在此处输入图片描述

手动操作总是可以\mbox{}在列表之前完成,这会自动将其放入

\documentclass[12pt,a4paper]{article}
% code copied from stackexchage is never latin-1 \usepackage[latin1]{inputenc} % not needed in new latex versions
\usepackage[T1]{fontenc}
\usepackage{amsfonts,amsmath,amssymb,graphicx,amsthm,mathtools,systeme}
\usepackage[tikz]{bclogo}
\usepackage{tikz,tkz-tab,moreverb} % tableau de signe moreverb not needed
\usetikzlibrary{arrows}
\usepackage[french]{babel}
\usepackage{pifont} %bouni
\usepackage{fancybox} %pour faire l'encadrement
\usepackage[usestackEOL]{stackengine}
\usepackage{verbatim}
\usepackage{color}
\usepackage[final]{pdfpages} %pour inserer une page pdf
%---- Dimensions des marges ---
\usepackage{geometry}
\geometry{left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm}
%----New Structure Exercice -----
\newtheoremstyle{sboxexc}% name of the style to be used
  {\topsep}% measure of space to leave above the theorem. E.g.: 3pt
  {\topsep}% measure of space to leave below the theorem. E.g.: 3pt
  {\itshape}% name of font to use in the body of the theorem
  {0pt}%  of space to indent
  {\bfseries}% name of head font
  { }% punctuation between head and body
  { }% space after theorem head; " " = normal interword space
  {\thmname{#1}\par}% Manually specify head
\newcounter{counter}
\setcounter{counter}{1}
\theoremstyle{sboxexc}
\newcommand{\optionaltext}{}
\newtheorem*{Exc}{\shadowbox{ Exercice \arabic{counter}\optionaltext}}
\newcommand{\exo}[2][]{\renewcommand{\optionaltext}{#2}\begin{Exc}\normalfont\mbox{}\par}
\newcommand{\finexo}{\renewcommand{\optionaltext}{}\end{Exc}\addtocounter{counter}{1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\theoremstyle{definition}
\newtheorem{definitionz}{Définition}
\newenvironment{definition}[1][]{\definitionz[]\mbox{}\par}{\enddefinitionz}
%%%%%%%%%%%
\begin{document}
\begin{definition}
cccccc
\end{definition}
Now,...
\begin{definition}
\begin{itemize}
\item [(1)] cccccc
\end{itemize}
\end{definition}
Now,...
%%%%%%%%%%%%%%%%debut exercice%%%%%%%%%%%%%%%%%%%
\exo{}
aaaaaa
\finexo
%%%%%%%%%%%%%%%% fin exercice%%%%%%%%%%%%%%%%%%%
Now,...
%%%%%%%%%%%%%%%%debut exercice%%%%%%%%%%%%%%%%%%%
\exo{}
\begin{itemize}
\item [(1)] aaaaaa
\end{itemize}
\finexo
%%%%%%%%%%%%%%%% fin exercice%%%%%%%%%%%%%%%%%%%
\end{document}

相关内容