Text FormattingAligning Abstract Title to Center

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
dasatti
Posts: 12
Joined: Sun Sep 09, 2012 5:14 pm

Aligning Abstract Title to Center

Post by dasatti »

How can I align the title of the Abstract i.e. "Abstract" to center. I am using article class. I know only basic LaTeX so I am in trouble to get some non-standard formats which are required in my document. Other things I need to do are:
  1. Placing the dot after each section and subsection number bullet.
  2. Placing an indentation at the beginning of each paragraph and few other things which I will mention later.

Thanks

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Aligning Abstract Title to Center

Post by localghost »

It could be helpful to know at least the used document class. A small, self-contained and minimal example would be best.

In the standard classes »article« and »report« the behaviour that you want for the abstract heading is default. So it is necessary to clarify by a minimal example what is going wrong.

For custom formatting of the {abstract} environment, the abstract package might be a good start. But this is only a random shot.
dasatti wrote:[…] Other things I need to do are:
  1. Placing the dot after each section and subsection number bullet.
  2. Placing an indentation at the beginning of each paragraph and few other things which I will mention later.
Since these questions cover different areas (1. headings, 2. general text formatting), please open new topics for each of them in the respective sub-forum.


Best regards and welcome to the board
Thorsten
dasatti
Posts: 12
Joined: Sun Sep 09, 2012 5:14 pm

Aligning Abstract Title to Center

Post by dasatti »

Thank you very much for your response. I use following document class

\documentclass[a4paper,10pt,twocolumn]{article}

This produces the heading of the abstract left aligned. Hope this will be helpful.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Aligning Abstract Title to Center

Post by localghost »

In a two-columned document the abstract is typeset as a usual (unnumbered) section. As already assumed, the abstract package helps to format it accordingly.

Code: Select all

\documentclass[10pt,a4paper,twocolumn]{article}
\usepackage[T1]{fontenc}
\usepackage{abstract}
\usepackage{lipsum}   % only for dummy text, to be dropped in actual document

%% Adjustments
\renewcommand{\abstractnamefont}{\normalfont\normalsize\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\small}
\setlength{\absleftindent}{0pt}
\setlength{\absrightindent}{0pt}

\begin{document}the
  \begin{abstract}
    \lipsum[1]
  \end{abstract}

  \section{Foo}
    \lipsum[2]
\end{document}
For a deeper understanding of the adjustments please refer to the package manual.
dasatti
Posts: 12
Joined: Sun Sep 09, 2012 5:14 pm

Re: Aligning Abstract Title to Center

Post by dasatti »

Thats really great info. Thank you very much for your help. I hope this will solve my problem.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Aligning Abstract Title to Center

Post by localghost »

dasatti wrote:[…] I hope this will solve my problem.
If so, please close the topic by accepting the answer that led you to the solution. Otherwise fell free to ask further targeted questions concerning this problem.
dasatti
Posts: 12
Joined: Sun Sep 09, 2012 5:14 pm

Re: Aligning Abstract Title to Center

Post by dasatti »

This was great. I am almost done. Thanks for your help. It took some time to know how to install new package but after using the code you provided my problem is almost solved. I have just few more questions. I want the abstract title to be 12 points Times and abstract text to be 10 points. I am sure it will be very easy but I am too newbie to solve it out my self :( . My second question is why did you use fontenc package? What is this package for.

Thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Aligning Abstract Title to Center

Post by localghost »

dasatti wrote:[…] I want the abstract title to be 12 points Times and abstract text to be 10 points. […]
Edit the two lines which define the name font and the text font for the abstract. Finally they should read like this.

Code: Select all

\renewcommand{\abstractnamefont}{\normalfont\large\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\normalsize}
dasatti wrote:[…] My second question is why did you use fontenc package? What is this package for. […]
The fontenc package here enables the T1 font encoding (Cork Encoding) for extended sets of characters (mostly used for language others than English) and activates the EC fonts. It also prepares a document to use postscript Type 1 fonts, which yield better quality due to full scalability. For details please refer to the package manual. I got used to always including it, even in my "minimal" examples. It doesn't do any harm to documents in English.

This font encoding can become important if you want to write in Times New Roman font. Font packages like txfonts or newtx require T1 encoding. Note that these packages under PDFTeX provide access to a font called Nimbus Roman No9 L which is almost identical to Times New Roman. Laymen will hardly see the differences.
Post Reply