Hi,
I redefined the style of subsection with titlesec package and giving \titleformat and \titlespacing commands. Is there a way I can use original style of subsection in a few particular instances? I tried to read the titlesec documentation but did not see how to do this... thank you.
Text Formatting ⇒ temporarily get normal subsection after redefining?
NEW: TikZ book now 40% off at Amazon.com for a short time.

temporarily get normal subsection after redefining?
Hi,
you could define two commands; one for the modifications to the subsections format and another for the settings of a standard subsection. The following example illustrates this approach:
you could define two commands; one for the modifications to the subsections format and another for the settings of a standard subsection. The following example illustrates this approach:
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{titlesec}% This command activates the modified format for subsections\newcommand\MySubsection{%\titleformat{\subsection}[runin]{\normalfont\Large\itshape}{\thesubsection}{1em}{}\titlespacing*{\subsection}{0pt}{10pt}{0.5em}}% This command activates the standard format for subsections\newcommand\StdSubsection{%\titleformat{\subsection}{\normalfont\large\bfseries}{\thesubsection}{1em}{}\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}}\begin{document}\section{Test section}\MySubsection\subsection{A modified subsection}text text\StdSubsection\subsection{A standard subsection}text text\MySubsection\subsection{Another modified subsection}text text\StdSubsection\subsection{Another standard subsection}text text\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: temporarily get normal subsection after redefining?
Hi,
Thank you. This might be obvious but - how did you know what the standard options were?
Thank you. This might be obvious but - how did you know what the standard options were?
temporarily get normal subsection after redefining?
You can find them in the file article.cls or in the documentation of the titlesec package (Section "Standard Classes").
1,1,2,3,5,8,13,21,34,55,89,144,233,...