Anyone can tell me how to make such a section style: enter image description here

I searched internet and kind of know I need to do it with \titlesec package. But I can not find a way to both remove the numbering in front of the section and make the text follow the section title in the same line.

  • Is \section*{} what you want? Or maybe \subsection*{}
    – Sigur
    Jun 13, 2018 at 22:58
  • Change font is another question.
    – Sigur
    Jun 13, 2018 at 22:59
  • 2
    Probably use \paragraph{}, especially if it is only such a short text segment? You may want to use titlesec to add the fullstop though. Jun 13, 2018 at 23:04

2 Answers 2

\titleformat{name=\section, numberless}[runin]{\sffamily\bfseries\Large}{}{0pt}{}

should do more or less what you want for unnumbered sections.

Edit: A full minimal example code:



\titleformat{name=\section, numberless}[runin]


\section*{Fundings.}Israeli Centers for Research Excellence (I-CORE); Israeli Ministry of Science (712845); Crown Photonic Center.

\section*{Acknowledgements.}We thank Dekel Ra’anan and Ronen Chriki for their fruitful insights and Nitzan Artzi for his help with the learning algorithms.


[![enter image description here][1]][1]


Having looked at the code in optica.cls, it appears it relies on the titlesec package, with the [explicit] option. So you may try this code in your preamble

  {#1} }%

[] [1]: https://i.stack.imgur.com/4mbKG.png

  • I think your solution should in principle work, but I tried and I still get number in front of the title, and the paragraph didn't start right after the title. I guess the problem is the document class I used (\documentclass[9pt,twocolumn,twoside]{optica}) try to overwrite the \section style somehow.
    – Zone Thin
    Jun 15, 2018 at 8:32
  • Did you use the \sectionor the \section* command?
    – Bernard
    Jun 15, 2018 at 8:39
  • I used \section, let me try the other one now.
    – Zone Thin
    Jun 15, 2018 at 8:49
  • Tested, both \section and \section* do not work.
    – Zone Thin
    Jun 15, 2018 at 8:51
  • 1
    Could you post a minimal example of the exact code you use, or a link to such an example?
    – Bernard
    Jun 15, 2018 at 8:52

Thanks for contributing, guys. In the end I give up using \section command, instead used following code to walk around the problem:

\noindent\textbf{\LARGE{Fundings.}} test1

\noindent\textbf{\LARGE{Acknowledgments.}} test2

I think it will be enough for someone who want to write a paper in latex to implement the style I pasted in the question, and don't have much time to waste on learning the 24 pages manual of titlesec package. And the truth is I spent a lot of time reading that manual, and still didn't find a way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .