Hi guys.
Where can I find a guide of how can I create my own environment which is based on an exciting one?
Please note, I don't want to change the old environment but I simply want to create new one which "inherit" some of the old one properties?
Thanks.
Yotam
General ⇒ how can I make my own environment
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how can I make my own environment
Just propose targeted questions. Explain which environment you mean and which of its properties you want to change.
I'm not aware of a special guide but every book about LaTeX basics should describe how to create own environments. If you want to know more about existing environments take a look at the class files or the latex.ltx kernel file. Its sources are described in source2e (web search for source2e.pdf).
Best regards
Thorsten
I'm not aware of a special guide but every book about LaTeX basics should describe how to create own environments. If you want to know more about existing environments take a look at the class files or the latex.ltx kernel file. Its sources are described in source2e (web search for source2e.pdf).
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
how can I make my own environment
I want to modify a little bit the equation environment:
- I want to shift the numbering of the equation one line down.
- I want to be able to refer to the equation with it's own counter using \cref I read some documentation about it.
- I think I need it to be a float because I want latex to move to the next page the equation if the number and the equation are separated.
Code: Select all
%Creating counter for reactions
\newcounter{reaction}[chapter]
\newenvironment{reaction}[1]{
\refstepcounter{reaction}
\begin{equation*}
\ce{#1}
\end{equation*}
\begin{flushright}
reaction (\arabic{section}.\arabic{reaction})
\end{flushright}
}
{}
Re: how can I make my own environment
bump
localghost. I know you placed a solution to this in another thread but I don't want to blindly paste parts but rather to understand our code.
Yotam
localghost. I know you placed a solution to this in another thread but I don't want to blindly paste parts but rather to understand our code.
Yotam