0

I have seen many answers to this question, but all of them seem very complicated and I don't understand how they work at all (copy and pasting them into my code doesn't seem to work either).

I should also add that I'm completely new to this.

All I want is a simple code that takes the default section title in LaTeX

enter image description here

and fills it in to become something like

enter image description here

This is what I currently have:

\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}

\begin{document}

\section{Introduction}

\end{document}

Any help will be much appreciated!

2

Here is a very simple solution with titlesec:

\documentclass[11pt, oneside]{article}
\usepackage{fourier}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage[, x11names]{xcolor}

\usepackage{titlesec}

\titleformat{\section}{\LARGE}{\rlap{\color{Aquamarine1!92!Chartreuse1}\rule[-0.4cm]{\linewidth}{1.2cm}} \thesection}{1em}{}

\begin{document}

\section{Introduction}

\end{document}

enter image description here

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.