LyXenumerate environment inside theorem environment!

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
abbadi
Posts: 5
Joined: Sat Dec 06, 2014 9:57 pm

enumerate environment inside theorem environment!

Post by abbadi »

I tried to create enumerate environment inside theorem environment in LyX but it did not work. does anyone know how to do that.

thank you.
Last edited by Stefan Kottwitz on Sat Dec 06, 2014 11:59 pm, edited 1 time in total.
Reason: multiple exclamation marks reduced

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

enumerate environment inside theorem environment!

Post by Johannes_B »

Hi and welcome,

enumerate environments work in theorem environments. But this is plain LaTeX.

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\newtheorem{theorem}{Theorem}
\begin{document}
\blindtext
\begin{theorem}
	\blindtext
	\begin{enumerate}
	\item test?
	\item another test
\end{enumerate}
\end{theorem}
\end{document}
I don't have experience with LyX and cannot say what might have gone wrong. LyX is clikcing buttons, did you click them in the right order?

Can try to reduce your document to a minimum and export this to LaTeX? This might give us a clue on what went wrong.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
abbadi
Posts: 5
Joined: Sat Dec 06, 2014 9:57 pm

Re: enumerate environment inside theorem environment!

Post by abbadi »

Thank you Johannes_B.

"LyX is clikcing buttons, did you click them in the right order?" this explained it to me :)

It seems to be related to LyX nesting rules.

I did it in the following order and it worked :D

1- create a list with the theorem statement in the line no 1 and the first of the numbered line in line no 2, the second numbered line in line no. 3 and so on.

2- change the level of numbering of lines starting from no. 2 to the last numbered lines to the next numbering level.

3- after that change the first line to Theorem (corollary or lemma) and you will get it.

thank you Johannes_B.

*************************************

another way { tricky and I don't like it :? }

by putting "\begin{theorem}" and "\end{theorem}" as TeX code in the LyX document. after this write the theorem statement and the enumerated (or itemized lines) between them. It will work. ;)
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: enumerate environment inside theorem environment!

Post by Johannes_B »

To be honest, i prefer a simple line (a few simple lines) of LaTeX. If you would point a gun to my head, i couldn't reproduce the clicking maneuver you just described.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: enumerate environment inside theorem environment!

Post by Stefan Kottwitz »

Hi Abbadi,

welcome to the forum!

LyX is a good start and a good tool for experienced users too, just sometimes one needs to deal a bit with the LaTeX under the hood. :-)

Often we LaTeX users can help our LyX friends, when we see the .lyx file or the exported LaTeX file.

See you,

Stefan
LaTeX.org admin
abbadi
Posts: 5
Joined: Sat Dec 06, 2014 9:57 pm

Re: enumerate environment inside theorem environment!

Post by abbadi »

Hi Stefan,

I am originally a LaTeX user. I only started using LyX recently. You can view the LaTeX code in the source pane option in view menu. This helps you to find out where you are in the LaTeX world.

I think LyX is a handy tool and it could be useful in preparing documents, reports, papers, theses and books. It can take the place of ms word and its likes because these wysiwyg gadgets are only made to be easy-to-use but they don't give users full control of their documents as LaTeX does.

Thank you.
Adumas
Posts: 3
Joined: Tue Dec 09, 2014 6:35 pm

enumerate environment inside theorem environment!

Post by Adumas »

Hey

check this out with ctrl + l you get into the latex mode. By the way also work with enumerate

Image
anyhow is there a way to implement a shortcut in lyx so I do not have to write it out all the time. thanks
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

enumerate environment inside theorem environment!

Post by Johannes_B »

This question has also been asked on TeX.SX.



What exactely do you mean with shortcut? You can define a new environment based on enumerate using package enumitem. You can use this by inserting LaTeX-Code in ERT boxes.

If you want to have a clickable button, you need to ask LyX guys.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Adumas
Posts: 3
Joined: Tue Dec 09, 2014 6:35 pm

Re: enumerate environment inside theorem environment!

Post by Adumas »

What I mean is: to press a certain key combination for example ctrl+i and the text form above is generated. it takes just to much time to type all of this all the time.

by the way thats me.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: enumerate environment inside theorem environment!

Post by Johannes_B »

One of the LyX developers is here once in a while. I suggest to adress them directly.
It would be nice to share the solution here as well once you got it. :-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply