When compiling following errors are giving
l.99 \newcounter{lofdepth}
?
l.112 \newcounter{lotdepth}
?
****************************************
Where is the problem?
General ⇒ Error \newcounter{lofdepth} and \newcouter{lotdepth}
-
- Posts: 20
- Joined: Thu Sep 06, 2007 7:31 pm
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Error \newcounter{lofdepth} and \newcouter{lotdepth}
How should anybody know how to deal with this poor information? Especially when you omit the most critical part of the error message.
The counters you tried to defined are already reserved for internal use by the compiler. So, just give your counters other names.
Code: Select all
Code, edit and compile here:
! LaTeX Error: Command \c@lofdepth already defined.Or name \end... illegal, see p.192 of the manual.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help....l.99 \newcounter{lofdepth}Your command was ignored.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 20
- Joined: Thu Sep 06, 2007 7:31 pm
Re: Error \newcounter{lofdepth} and \newcouter{lotdepth}
I haven't deifned any counter for lofdepth or lotdepth. That's why not able to find any error
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Error \newcounter{lofdepth} and \newcouter{lotdepth}
In that case providing a minimal working example (MWE) that reproduces the error ist the only way to find its cause.
Somewhere in your code (exactly lines 99 and 112) there must those redefinitions of the affected counters.
Somewhere in your code (exactly lines 99 and 112) there must those redefinitions of the affected counters.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Error \newcounter{lofdepth} and \newcouter{lotdepth}
Load the tocloft package with the "subfigure" option. See tocloft Package for details.
HTH,
Axel
HTH,
Axel