0

How to get (without titlesec) title number centring and symbol after it?

section

\documentclass[british]{article}
\usepackage{fontspec}
\usepackage{graphicx}
\newcommand{\S}{\reflectbox{\rotatebox[origin=c]{90}{\huge\fontspec{Symbola}𐄺}}}
\renewcommand{\thesection}{\quad\Roman{section}} % quad is kinda ugly and adding centre here didn't work. 

\makeatletter
\let\thetitle\@title
\renewcommand\section{\@startsection {section}{1}{\z@}%
                {-3.5ex \@plus -1ex \@minus -.2ex}%
                {2.3ex \@plus.2ex}%
                {\normalfont\Large\bfseries\centering}%\@endsection {\T} % adding symbol here didn't work.
                }
\makeatother

\begin{document}

\addtocounter{section}{2}
\section{Cycle} % bonus points if just this work
%\section[Cycle]{\\Cycle\\\T} % is there a better way to get than this? 
%\section[Fire]{\\Fire\\\T}
\end{document}
4
  • What is the symbol you're trying to get? I'm not sure the copy-paste worked properly.
    – Vincent
    May 20, 2021 at 15:40
  • ^^^^1013A 𐄺, but the placement of the symbol is the relevant part.
    – Oni
    May 20, 2021 at 15:50
  • Why don't you want to use titlesec?
    – Vincent
    May 20, 2021 at 15:53
  • @Vincent: Maybe the O.P. prefers to reinvent the wheel.
    – Bernard
    May 20, 2021 at 22:11

1 Answer 1

1

The titlesec package is really useful to format section titles.

I could not insert the specific symbol in your example, so I replaced it with the standard section symbol.

\documentclass[british]{article}
\usepackage{fontspec}
\usepackage{titlesec}
\newcommand*{\T}{\S}
\titleformat{\section}[display]{\centering\bfseries\Large}{\Roman{section}}{\parskip}{}[\T]
\begin{document}
\addtocounter{section}{2}
\section{Cycle}
\section{Fire}
\end{document}

Just change the definition of \T to output the symbol you want.

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.