2

My university requires an indent for sections and subsections headings like on the picture. example

How can I do it?

  • 2
    This does really look awful. – user31729 Jun 7 '17 at 10:27
  • @ChristianHupfer Sure, but it is a university's requirement. – Amir Jun 7 '17 at 10:29
1

You have all my sympathy: university requirements are so silly, sometimes!

If your sections and subsections are always numbered, you can do

\documentclass{article}
\usepackage{indentfirst}

\makeatletter
\renewcommand\@seccntformat[1]{\hspace*{\parindent}\csname the#1\endcsname\quad}
\makeatother

\begin{document}

Some text to show the indentation in the first line
Some text to show the indentation in the first line
Some text to show the indentation in the first line

\section{Test}

\subsection{Test}

Some text to show the indentation in the first line
Some text to show the indentation in the first line
Some text to show the indentation in the first line

\end{document}

enter image description here

|improve this answer|||||
  • Thanks a lot, you've helped so much! I've spent several hours in Google trying to find the solution. – Amir Jun 7 '17 at 10:37
3

Please try with the below code:

 \newcommand\section{\@startsection {section}{1}{12\p@}%
                                   {-12\p@}%
                                   {6\p@}
{\normalsize\raggedright}}
|improve this answer|||||
  • Where is this mysterious code coming from? – Johannes_B Jun 7 '17 at 10:52
  • @Johannes_B If you think of the \startsection macro you may have a look at this link: tex.stackexchange.com/questions/31780/… – Jürgen Jun 7 '17 at 10:56
  • 3
    @jürgen i am wondering about asecdimen. – Johannes_B Jun 7 '17 at 11:25
  • Oops..its my own tag, it should be as in value, ie., 6\p@ etc. thanks for point out this... – MadyYuvi Jun 7 '17 at 11:36
  • 2
    @MadyYuvi I would propose to edit your answer accordingly to your own comment. – Jürgen Jun 7 '17 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.