
Utilizando el estilo del teorema como en el ejemplo siguiente, se genera un nuevo párrafo después de la Observación. ¿Puedo evitar esto? (y usar el amsthm
paquete al mismo tiempo)?
\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{amsthm}
\usepackage{blindtext}
\newtheorem{rem}{Remark}
\begin{document}
\begin{rem}
\blindtext
\end{rem}
\blindtext % I want that the text begins aligned left, i.e. no new
% paragraph
\end{document}
Respuesta1
No estoy seguro de qué estás buscando exactamente, pero esto podría ayudarte
\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{amsthm}
\usepackage{blindtext}
\newtheoremstyle{mystyle}
{\topsep} % Space above
{0pt} % Space below
{\itshape} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{mystyle}
\newtheorem{rem}{Remark}
\begin{document}
\begin{rem}
\blindtext
\end{rem}
\noindent\blindtext
\end{document}
PD: estilo de teorema usado deaquí
Respuesta2
No es difícil hacerlo, pero deberías pensártelo dos veces. Un comentario puesto en evidencia dentro de un rem
entorno.esun párrafo (o más de ellos) por sí solo, por lo que el texto que siguedeberíaser un nuevo párrafo.
\documentclass{article}
\usepackage{amsthm}
\newtheorem{reminner}{Remark}
\makeatletter
\newenvironment{rem}
{\reminner}
{\endreminner\@endpetrue}
\makeatother
\begin{document}
\begin{rem}
A remarkable text.
\end{rem}
Some text that shouldn't start a new paragraph. But why not?
\begin{rem}
Another remarkable text.
\end{rem}
Some text that will start a new paragraph.
\end{document}
Respuesta3
El comportamiento se produce porque amsthm.sty
incluye explícitamente \@endpefalse
en su definición de \@endtheorem
: tiene \def\@endtheorem{\endtrivlist\@endpefalse }
. En un 7 de mayo de 1996correoen comp.text.tex, Mark Wooding dio una solución,
\expandafter\let\csname @endtheorem\endcsname\endtrivlist
y luego escribió: "Un método más sólido sería decir
\makeatletter
\toks@\expandafter{\@endtheorem\@endpetrue}
\edef\@endtheorem{\the\toks@}
\makeatother
en caso de que [...] alguien más cambie más la macro original". Esta solución funciona para mí (en 2023). El código debería estar entre \usepackage{amsthm}
y \newtheorem{...}{...}
, como lo señala más adelante en ese hilo Tom Scavo citando al joven U. Ryu ( quien ofreció \makeatletter\def\@endtheorem{\endtrivlist}\makeatother
como solución).