20

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} 
4
  • 3
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented Mar 18, 2013 at 8:19
  • Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or hit Ctrl+K. Commented Mar 18, 2013 at 8:20
  • 5
    The llncs class 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 \subparagraph with this class” is what appears when you try using it under normal setting. Commented Mar 18, 2013 at 10:10
  • Please let us know if you got the answer figured out for this. Commented Mar 27, 2013 at 13:22

2 Answers 2

25

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.

1
  • God, is this you? Commented Aug 27, 2021 at 10:26
1

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.

1
  • 5
    Please have a look to the comment of @egreg. BTW: It is not a good choice to change a package file like 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. Commented Mar 27, 2013 at 14:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.