Text Formatting ⇒ temporarily get normal subsection after redefining?
temporarily get normal subsection after redefining?
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.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
temporarily get normal subsection after redefining?
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
\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}
Re: temporarily get normal subsection after redefining?
Thank you. This might be obvious but - how did you know what the standard options were?