TeX - LaTeX Asked by Iovita Kemény on September 21, 2020
I have defined my theorem style as:
newtheoremstyle{ejemplo} % Style name
{2ex} % Above space
{2ex} % Below space
{normalfont} % Body font
{} % Indent amount
{bfseries} % Head font
{} % Post head punctuation
{newline} % Post head space
{thmname{#1}thmnumber{ #2}:thmnote{ [#3]}} % Head spec
However when I use it in combination with lists like this:
begin{obs}
begin{enumerate}
item Bla bla bla
item Bla bla bla
end{enumerate}
end{obs}
I do not get the new line. The problem is resolved if I add something before the lists:
begin{obs}
This fixes it
begin{enumerate}
item Bla bla bla
item Bla bla bla
end{enumerate}
end{obs}
How can I fix this?
Edit: Sorry. Here’s the minimal working example:
documentclass[12pt, letterpaper]{memoir}
% Packages
usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{mathtools}
usepackage{amssymb, amsfonts, amsthm}
newtheoremstyle{ejemplo} % Style name
{2ex} % Above space
{2ex} % Below space
{normalfont} % Body font
{} % Indent amount
{bfseries} % Head font
{} % Post head punctuation
{newline} % Post head space
{thmname{#1}thmnumber{ #2}:thmnote{ [#3]}} % Head spec
theoremstyle{ejemplo}
newtheorem*{obs}{Observación}
begin{document}
begin{obs}
begin{enumerate}
item Bla bla bla
item Bla bla bla
end{enumerate}
end{obs}
begin{obs}
This fixes it
begin{enumerate}
item Bla bla bla
item Bla bla bla
end{enumerate}
end{obs}
end{document}
I propose to define a new thmenum
enumerate-like list, adapted to a theorem-like environment, with enumitem
:
documentclass[12pt, letterpaper]{memoir}
% Packages
usepackage[T1]{fontenc}
usepackage[spanish]{babel}
usepackage{mathtools}
usepackage{amssymb, amsthm}
usepackage{enumitem}
newlist{thmenum}{enumerate}{1}
setlist[thmenum]{label=arabic*., itemsep=2pt, before=leavevmode}
newtheoremstyle{ejemplo} % Style name
{2ex} % Above space
{2ex} % Below space
{normalfont} % Body font
{} % Indent amount
{bfseries} % Head font
{} % Post head punctuation
{1em} % Post head space
{thmname{#1}thmnumber{ #2}:thmnote{ [#3]}} % Head spec
theoremstyle{ejemplo}
newtheorem*{obs}{Observación}
begin{document}
begin{obs}
begin{thmenum}
item Bla bla bla
item Bla bla bla
end{thmenum}
end{obs}
begin{obs}
This fixes it
begin{enumerate}
item Bla bla bla
item Bla bla bla
end{enumerate}
end{obs}
end{document}
Answered by Bernard on September 21, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP