# Adding an environment to LyX for dividing a proof into steps

My question is basically a combination of the questions Is it possible to use the enumerate/itemize environment within the proof/remark environment in a nice way? and Create new paragraph style in LyX.

When I write a mathematical document in LyX, I frequently want to divide my proofs into steps. Up to now, I have often simply used the enumerate environment to do this.

This has the advantage that the numbering of the steps is handled automatically by LyX and that I can reference the individual steps later on using the usual Labels and References.

One of the disadvantages is that I am not really satisfied how the output looks afterwards, i.e. my "steps" are somewhat flushed to the right.

In the first question linked above, the user egreg proposed to simply use

\newenvironment{steps}{\setcounter{step}{0}}{}
\newcounter{step}
\newcommand{\proofstep}{\par\refstepcounter{step}Step~\thestep.\space\ignorespa‌​ces}


as a solution in LaTeX.

It would be really nice if I could integrate this in LyX, i.e. I would like to have environments

1. Steps
2. step

(or something like that), which result in the above LaTeX environments/commands to be used by LyX. I would also like to be able to reference the individual steps using labels and references.

The second question linked above describes how to add a new environment (the quotation environment) to LyX.

I tried to adapt this to the case of enumerate/itemize environments, but the format of these seems to be more complicated. Also, I guess I somehow have to tell LyX to use \proofstep instead of \item and I am not sure how to do this.

Any help will be appreciated.

• You can create your own layout (the thing that controls how LyX does something and which command it does to do it). It is just a simple text file, no C++ programming required. However, it would take some time. See Help > Customization. Also look at the examples in the lib/layouts folder. – scottkosty Jan 26 '15 at 17:17
• @scottkosty: Thank you, I will try that. If I manage it, I will post my solution as an answer. – PhoemueX Jan 27 '15 at 10:01
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.97222900390625, "perplexity": 641.3802171952576}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027317113.27/warc/CC-MAIN-20190822110215-20190822132215-00209.warc.gz"}