In the .tex file, I want to use the package titlesec. But there is a error:
! Argument of \subparagraph has an extra }. Is there some simple method to fix this?
The code is:
\documentclass{llncs} \usepackage[compact]{titlesec} The titlesec package assumes that the usual sectioning levels are defined with the standard method, basically
\def\section{\@startsection...} However, the llncs class defines \subparagraph to produce a warning text that the command should not be used.
If you really want to change the appearance of section titles, ignoring the fact that you probably are using llncs for submissions to Springer, where the changes will quite surely be overridden, you can do in the following way:
\documentclass{llncs} %% Save the class definition of \subparagraph \let\llncssubparagraph\subparagraph %% Provide a definition to \subparagraph to keep titlesec happy \let\subparagraph\paragraph %% Load titlesec \usepackage[compact]{titlesec} %% Revert \subparagraph to the llncs definition \let\subparagraph\llncssubparagraph This will produce no error when loading titlesec.
You can comment out the lines that have \subparagraph in titlesec.sty. I am not sure if this is the correct way to go about but it compiles fine for this way.
titlesec.sty. If a change is needed, copy the file, rename it to mytitlesec.sty for example and change this one. Now you can use your changed package using \usepackage{mytitlesec.sty} without any bad effects to other documents using the original titlesec.sty.
\documentclass{...}and ending with\end{document}.{}) or hit Ctrl+K.llncsclass is used for submissions to Springer; it's not a good idea to change the setup. In any case, the class explicitly disables\subparagraph: “You should not use\subparagraphwith this class” is what appears when you try using it under normal setting.