答案1
改编自这里:
\documentclass{article}
\usepackage{titlesec}
\titleformat{\section}[runin]
{\normalfont\Large\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}[runin]
{\normalfont\large\bfseries}{\thesubsection}{1em}{}
\begin{document}
\section{my section}
Section context.
\section{my other section}
More section content
\end{document}