TransWikia.com

How to make custom section title placement and size

TeX - LaTeX Asked by maltebsa on February 24, 2021

I’m looking to make a custom section title similar to this but I can’t figure out how to change the section number placement as well as aligning the horizontal line with the bottom of the section number. I’m using titlesec but can’t seem to wrap my head around it.

One Answer

Probably something like this

enter image description here

documentclass{article}
usepackage[compact]{titlesec}% http://ctan.org/pkg/titlesec
titleformat{section}
{normalfontLargebfseries}{thesection}{0pt}{hfill}[{titlerule[0.8pt]}]
titlespacing*{section}
{0em} %left
{0em} %before
{1em} %after/below
begin{document}

    section{Introduction}
    This is some regular text.
end{document}

edit to conform better to OP requirement

adapted from --

How to get custom section style using titlesec?

enter image description here

documentclass{article}
usepackage[explicit]{titlesec}
usepackage{lmodern}
usepackage{lipsum}
usepackage{multirow}

usepackage[table]{xcolor}

usepackage{tabularx}
usepackage{ctable}
newcolumntype{C}{>{raggedleftarraybackslash}X}

titleformat{section}[block]{Largebfseriessffamily}%
{}%
{0pt}%
{%
    begin{tabularx}{textwidth}{lC}
       multirow{-2.5}{*}{fontsize{70}{30}selectfontnormalfontthesection} & #1\arrayrulecolor{red!50!black}cmidrule[4pt]{2-2}
    end{tabularx}
    %
}
begin{document}
    section {Introduction}
    lipsum[4]
end{document}

Correct answer by js bibra on February 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP