0

I am trying align the text "Chapter" before the section title.

I've tried

\documentclass[chapterprefix=false]{scrreprt}
\makeatletter
\renewcommand*{\chapterformat}{%
\mbox{\chapapp~\thechapter\autodot:\enskip}%
}

And much more got from another answers but it's not working for my issue.

\documentclass[12pt,a4paper]{article}
\usepackage[latin2]{inputenc}
\usepackage{graphicx}
\usepackage{ulem}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {figures/} }
\usepackage{array}

This is what I want Text "Chapter before section title name" I am very new to latex. Please help me to solve this problem. Thank you in advance.

1 Answers1

0

You can load titlesec and use this code in your preamble:

\usepackage{titlesec}

\titleformat{\chapter}[block]{\LARGE\bfseries\filright}{\chaptertitlename~\thechapter:}{0.5em}{}

Some explanations:

  • The first mandatory argument of \titleformat} is the section level.
  • The (first) optional argument is the shape used for this level (there are 9 shapes, the default is hang).
  • The second mandatory argument is the format to be applied to the whole title.
  • The third argument defines the label.
  • the fourth argument defines the spacing between label and title.
  • The fifth argument is code the title body.The very last command can take an argument, which is the title text.
  • A second optional argument (not used here), which can be used with some shapes, is for code following the title body.
Bernard
  • 271,350
  • Thakn you so much buddy. I got the same solution just before a minute in https://tex.stackexchange.com/questions/82235/adding-text-to-the-section-numbering. This solution is working in very efficient way than others i was trying. +1 for your support. Thank you so much – Vaibhav Mandlik Apr 15 '18 at 11:06