Newline spacing left by 'theorem' environment

  • Context: MHB 
  • Thread starter Thread starter mathbalarka
  • Start date Start date
  • Tags Tags
    Theorem
Click For Summary
SUMMARY

The forum discussion focuses on addressing newline spacing issues caused by the 'theorem' environment in LaTeX when using the amsthm package. Users defined the theorem environment with \newtheorem{theorem}{Theorem} and encountered unwanted spacing after the theorem output. To eliminate indentation from all paragraphs, the solution is to include \setlength{\parindent}{0pt} in the preamble. For abstracts, the command \noindent text effectively removes indentation. Additionally, the tcolorbox package is recommended for designing theorems with enhanced options.

PREREQUISITES
  • Familiarity with LaTeX typesetting
  • Understanding of the amsthm package
  • Knowledge of paragraph formatting commands in LaTeX
  • Basic experience with the tcolorbox package
NEXT STEPS
  • Research the amsthm package documentation for advanced theorem customization
  • Explore the tcolorbox package and its newtcbtheorem option for theorem design
  • Learn about paragraph formatting commands in LaTeX, including \noindent
  • Investigate best practices for formatting abstracts in LaTeX documents
USEFUL FOR

LaTeX users, academic writers, and anyone involved in document preparation who seeks to optimize theorem formatting and paragraph indentation in their manuscripts.

mathbalarka
Messages
452
Reaction score
0
I am using amsthm package in LaTeX, and defined the theorem environment as

Code:
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

in the usual way. Now if I compile the code

Code:
\begin{theorem}
Some text
\end{theorem}
More text

The output is

View attachment 1705

Note the spacing appeared in line #2. Is there anyway to remove this?
 

Attachments

  • LaTeX.PNG
    LaTeX.PNG
    4.3 KB · Views: 154
Physics news on Phys.org
Do you want to remove indentation from all paragraphs ?
 
ZaidAlyafey said:
Do you want to remove indentation from all paragraphs?

Yes.
 
Write the following code preamble.

Code:
\setlength{\parindent}{0pt}
 
No kidding, that works great!

Thanks, Zaid.

PS : I see it doesn't work for the Abstract. Have any ideas on that?
 
mathbalarka said:
No kidding, that works great!

Thanks, Zaid.

PS : I see it doesn't work for the Abstract. Have any ideas on that?

Honestly, I was just trying to do the same for abstract but it didn't work. After a search it seems that

Code:
\noindent text
works fine .
 
Okay, that works well, thanks.
 
When designing theorems, you should check out the package tcolorbox. It has the option newtcbtheorem.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
6K