LaTeX forum ⇒ Generaloverleaf Lorem ipsum trouble Topic is solved

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

overleaf Lorem ipsum trouble

Postby kamaltas » Tue Sep 20, 2022 6:59 pm

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 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
User avatar
MjK
Posts: 48
Joined: Fri Jan 28, 2022 6:09 pm

overleaf Lorem ipsum trouble  Topic is solved

Postby MjK » Wed Sep 21, 2022 11:17 am

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:
\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

Postby kamaltas » Wed Sep 21, 2022 7:26 pm

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


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests