#Need help with a nested list in Latex

1 messages · Page 1 of 1 (latest)

verbal veldt
#

This is the Latex code and its compiled pdf version that I have rn, but my Latex doesn't seem to be doing what I want it to do.
I want to create a list with main bullet points and subpoints, the first main point being "P(x) : "..."", and the second and third being "bullet point 2" and "bullet point 3"
I also want to have a nested list under the first one, but for some reasons when I try putting it, Latex thinks that its just an indented version of the main list, rather than a sub list
Does anyone know how fix this?

soft crater
#

I feel like enumerate is inappropriate for this. Why not give dedicated environments a try? https://www.overleaf.com/learn/latex/Theorems_and_proofs
Numbering is done automatically, and you need not enter math mode every time

#

After all, your intention is not to enumerate list of things, it concerns mathematical expressions.

verbal veldt
#

@soft crater I more just want to understand why the nested list isn't nesting properly, could you tell me what is going wrong and how to fix this?

soft crater
#

Could you most the source code rather than posting a screenshot of it?

#

Increases the likelihood of getting proper help by 50% (!)

#

🫰😄

verbal veldt
#

Sure

soft crater
#

Thank you, I noticed that the code is not functional at all so it will take some time to fix it myself.

#

First line of consideration I'd make is to examine the enumitem package to create a new kind of enumerate environment that accomodate for your use case.

#

Again, if you have to enter mathmode every time you start an item then it probably means you shouldn't assert this way of typesetting a list of mathematical expressions

verbal veldt
#

Oh wait I sendt you the wrong one

soft crater
#

Could you post the source code rather than attaching the file?

soft crater
#

I don't need the whole thing, just need minimal example to work with

verbal veldt
#

How do I post the source code? Do you want me to just copy paste it here?

soft crater
# verbal veldt

You seem to have it done it here. Perhaps change the extension of your file to tex from tex_2?

#

.tex_2 is not a valid extension for Discord to detect

verbal veldt
soft crater
soft crater
#

I have a question

verbal veldt
soft crater
#

Say if you have a list within a list

List A
  sublist 1
  sublist 2
  sublist 3
List B
  sublist ...

You want the counter of the sublist to be unrelated to the List?

#

I'm not sure what you mean by

Latex thinks that its just an indented version of the main list, rather than a sub list
verbal veldt
#

I want it to be the following:

#

Point A

#
  • sub point
soft crater
#

I have this so far

verbal veldt
#

yeah thats good but I want it indented

soft crater
verbal veldt
#
  1. P(x)
#
  • sub pount 1
soft crater
#

I can quite literally do -

verbal veldt
#

yeah thats what I want

#

how did you do that

soft crater
#

Code and explanation coming up, just cleaning up the code now

#

I've created an environment called myprop to deal with numbering of your propositions and to separate out propositions (which is easier to work with)

#

and using enumitem package I created an enumerate clone called myenum to be used within myprop (you don't have to)
where the first level is numbered in arabic (1. 2. 3. ...) and second level is just an em dash ()

#

As I found in the amsthm documentation, you must use \leavevmode command before starting myenum in myprop due to spacing issues, but it works quite well

#

Especially because you can nest myenum environment

#

and this isn't hard-coded or anything, if you don't want an em dash for level 2 you can always change it to something

#

Let me know how you go

verbal veldt
#

Um so I fixed my issue without revamping my whole code like you did, I just put $ around the first list item

soft crater
#

In any case I will consider the post answered in full.