Generaloverleaf Lorem ipsum trouble

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
kamaltas
Posts: 2
Joined: Tue Sep 20, 2022 5:43 pm

overleaf Lorem ipsum trouble

Post by kamaltas »

Hello people, so I am writing my thesis in overleaf & what I want to do is put a summery of the whole chapter on top of the chapter right after I write the Title of the chapter. Now, I have already checked internet & found one solution using \lipsum. Here is the code:

\documentclass[a4paper,11pt]{report}
\usepackage{times,lipsum}
\usepackage[margin=1in]{geometry}
\usepackage[onehalfspacing]{setspace}

\newcommand{\chapabstract}[1]{
\begin{quote}\singlespacing\small \rule{14cm}{1pt}#1\vskip-4mm\rule{14cm}{1pt}\end{quote}
}

\begin{document}

\chapter{An Abstract at the Start of Each Chapter}
\chapabstract{\lipsum[2]}

\lipsum[2-3]

\chapter{Introduction}
\chapabstract{\lipsum[1]}

\lipsum[1]
\end{document}

Problem is I am not understanding lipsum function properly. Where do I actually put the text that I want to write in the code? Every time I run this code, it just creates a dummy text in spanish. How do I remove this spanish text & put my won text? Can someone please give me a proper example!

Thank you everyone in advance.

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

MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

overleaf Lorem ipsum trouble

Post by MjK »

lipsum is a package made to avoid typing a lot of dummy text in examples. So the only purpose of command \lipsum is do add such dummy text. See the linked manual for more information.

The abstract in the example is made by the new command \chapabstract. So changing the argument of this command would change the abstract shown. However, I would suggest to use a slightly improvement of the definition:

Code: Select all

\documentclass[a4paper,11pt]{report}
\usepackage{times}% This package is obsolete → https://ctan.org/pkg/times
\usepackage[margin=1in]{geometry}
\usepackage[onehalfspacing]{setspace}
%\usepackage{showframe}% Can be used to visualize the text area and other page elements.

\newcommand{\chapabstract}[1]{%
\begin{quote}\singlespacing\small
  \rule{14cm}{1pt}\par#1\par\vskip-\ht\strutbox\rule{14cm}{1pt}\end{quote}%
  \par% needed to make the two following lines work as expected.
  \csname @afterindentfalse\endcsname% Do not indent the first paragraph after
                                % the abstract.
  \csname @afterheading\endcsname% Handle the chapter abstract like a heading.
}

\begin{document}

\chapter{An Abstract at the Start of Each Chapter}
\chapabstract{This is my abstract text. As you can see, you do not need
  package \textsf{lipsum} to use it. You need only the definition of
  environment \texttt{chapabstract}.}

Some dummy text.

\chapter{Introduction}
\chapabstract{One more example of an abstract.}
Some more dummy text.
\end{document}
You can see: Package lipsum is not needed.

BTW: Please always mark code blocks as code (see my signature for more information).
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
kamaltas
Posts: 2
Joined: Tue Sep 20, 2022 5:43 pm

overleaf Lorem ipsum trouble

Post by kamaltas »

Thank you so much Mjk. It worked perfectly :D :D
Post Reply