domenica 27 settembre 2015

Costumized Environments for the Beginning of Section

I want to have some kind of "direction" at the beginning of a section or a chapter, where I state what I want to describe.
I decided to have two different things, one as the "title" of the "direction" and the other one a list of concepts to be covered each one in a different paragraph.
Let's divide the problem in two parts, the "title".

First I tried to write a simple newcommand
\newcommand{\dira}[1]{\textcolor{OrangeRed}{#1}\\}
 The breaking line at the end \\ is necessary as I want to remark it is a "title".
Also, I chose OrangeRed as color, and to be able to use it I loaded the package xcolor with the options usenames and dvipsnames.
 Then I thought, why don't I center it, since it is a title:
\newcommand{\dira}[1]{\begin{center}\textcolor{OrangeRed}{#1}\end{center}}
Note there is no \\ anymore. I am not sure I will leave this way or the left aligned version.

The second problem, is also not so complicated. I want to define a new environment:
\newenvironment{dirb}%
{\color{Aquamarine}\begin{itemize}}%
{\end{itemize}%
\color{black}}
This makes a listing environment all colored in Aquamarine.

The final problem would be to put them together, so to call only once the "dir" command/environment, instead of \dira and \begin{dirb}...\end{dirb} as it is now.
Quick trials are not successful, I will have to think harder to find a solution.

Nessun commento:

Posta un commento

Il tuo commento sarà pubblicato appena il moderatore avrà accertato il suo contenuto

Grazie mille :)