Text FormattingIndent in new float

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Scorpio X
Posts: 1
Joined: Fri Nov 27, 2009 11:43 am

Indent in new float

Post by Scorpio X »

Hi!

I've been ripping my hair of trying to solve my problem, so I really hope that someone has any idea of how to solve it:

I've defined a new float and want to do a indentation (or similar) within it.

\usepackage{float}
\newfloat{algfloat}{h}{ext}[chapter]
\begin{document}
\begin{algfloat}
Not Indented text.\\
\indent Indented text.\\
\hspace{1 pt} Indented text.\\
\end{algfloat}
\end{document}

The problem is that there is no indentation anywhere in the pdf!
(The "\\" are needed for creating a new line)

Does any one have an idea of a solution? I've been googeling it for hours! And I haven't found any alternative way of doing something similar.


EDIT: Finally solved! :D
Problem was that parindent is, for some reason, set to "0" only within my custom float. So the solution is:
\setlength{\parindent}{10pt}, togheter with \noindent for avoiding a indent on the first row.

Hope this will help someone else!

I must say I regret choosing Latex instead of Word for writing my Master Thesis. It has taken me about 8 hours to solve this problem. I Word I've would have done it in less than 5min.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Indent in new float

Post by gmedina »

Scorpio X wrote:...I must say I regret choosing Latex instead of Word for writing my Master Thesis. It has taken me about 8 hours to solve this problem. I Word I've would have done it in less than 5min.
Eventhough the LaTeX has a steep learning curve, the final results justify the initial efforts.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Indent in new float

Post by localghost »

LaTeX demands a change of thinking. Finally it's a typesetting system and not a simple word processor. And it will always yield better results than any word processor could ever manage.
Scorpio X wrote:[…] I must say I regret choosing Latex instead of Word for writing my Master Thesis. It has taken me about 8 hours to solve this problem. I Word I've would have done it in less than 5min.
If you think that you could manage a larger document without any major problems, stay with Word. I know from problems with this program that are not correctable and make it unusable.


Best regards and welcome to the board
Thorsten¹
Post Reply