LaTeX forum ⇒ Text FormattingAlign text of theorems Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
bstex
Posts: 39
Joined: Mon Oct 23, 2017 10:22 am

Align text of theorems

Postby bstex » Sat Jan 06, 2018 11:32 am

Happy new year, everybody!

The picture above says it all:
Screen Shot 2018-01-06 at 11.24.18.png
Screen Shot 2018-01-06 at 11.24.18.png (298.62 KiB) Viewed 233 times


The code for the "I have this", is:
  1. \documentclass[a4paper]{book}
  2. \usepackage{enumitem}
  3. \newtheorem{exercise}{}[chapter]
  4.  
  5. \begin{document}
  6.  
  7. \setcounter{exercise}{8}
  8. \begin{exercise}
  9. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  10. \end{exercise}
  11.  
  12. \begin{exercise}
  13. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.\end{exercise}
  14.  
  15. \setcounter{exercise}{127}
  16. \begin{exercise}
  17. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  18. \begin{enumerate}[label=\alph*.]
  19. \item This is the first item of the list.
  20.  
  21. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  22. \end{enumerate}
  23. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  24. \end{exercise}
  25.  
  26. \end{document}

bstex
Posts: 39
Joined: Mon Oct 23, 2017 10:22 am

Postby bstex » Wed Jan 10, 2018 11:04 am

OK. I've found something and I'm so close to my final result.
Here is my new mwe:

  1. \documentclass[a4paper]{book}
  2. \usepackage{enumitem}
  3.  
  4. \usepackage[standard]{ntheorem}
  5. \theoremstyle{margin}
  6. \theorembodyfont{\normalfont}
  7. \newtheorem{exercise}{}[chapter]
  8.  
  9. \begin{document}
  10.  
  11. \setcounter{exercise}{8}
  12. \begin{exercise}
  13. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  14. \end{exercise}
  15.  
  16. \begin{exercise}
  17. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.\end{exercise}
  18.  
  19. \setcounter{exercise}{127}
  20. \begin{exercise}
  21. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  22. \begin{enumerate}[label=\alph*.]
  23. \item This is the first item of the list.
  24.  
  25. \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  26. \end{enumerate}
  27. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
  28. \end{exercise}
  29.  
  30. \end{document}


Now, the only problem is that the first letter of the theorem text (the word "Lorem" in mwe) is not left-aligned with the rest of the paragraph.
Any help, please?

bstex
Posts: 39
Joined: Mon Oct 23, 2017 10:22 am

Postby bstex » Wed Jan 10, 2018 12:06 pm



Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests