Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a macro that contains the title for the current section, however when using the titlesec package, it no longer works for \section and \subsection. I know titlesec redefines the functions I'm using, but have not been able to figure out a workaround.







\part*{First Starred part}

\part{First Un-starred part}

\section*{First Starred Section}

\section{Second Un-starred Section}

\subsection*{First Starred Subsection}

\subsection{Second Un-starred Subsection}

share|improve this question
Welcome to! A tip: You can use backticks ` to mark your inline code as I did in my edit. – Torbjørn T. Nov 21 '11 at 21:54

1 Answer 1

up vote 2 down vote accepted

For \section and lower level titles you can do


However, if you're not going to hide titles in groups, the simple


should suffice.

For \part your code still works and I believe also the similar one for \chapter.

share|improve this answer
The first approach was exactly what I was looking for. Thanks! – lyineyes Nov 21 '11 at 22:37
Could you please explain how to use these commands? An example would really help. – wkschwartz Nov 9 at 17:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.