Problem loading optidef package and addtocontents
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am using Miktex 2.9 with Texstudio 2.12.6. My document is in KOMA
-class. As I was trying to load the optidef
package, I got an error which seems related to addcontentslinetoc
.
I assumed some outdated packages to be the cause, so I have updated all packages using Miktex Updater. The problem remains.
Here is a MWE:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
%usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocsetcountertocdepth0
%%%% chapters
addtocontentstocsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
%beginmini[2]
% wf(w)+ R(w+6x)
% labeleq:Example1
%
% addConstraintg(w)=0
% addConstraintn(w)= 6
% addConstraintL(w)+r(x)=Kw+p
% addConstrainth(x)=0.
%endmini
enddocument
Without optidef
package, the document compiles flawlessly. As soon as I load the package optidef
, I will get the following error message for all corresponding lines of code:
Undefined control sequence.
addtocontentstocsetcountertocdepth0
Does anyone have a solution? Thank you very much in advance.
Best regards,
Dan.
optidef
add a comment |Â
up vote
1
down vote
favorite
I am using Miktex 2.9 with Texstudio 2.12.6. My document is in KOMA
-class. As I was trying to load the optidef
package, I got an error which seems related to addcontentslinetoc
.
I assumed some outdated packages to be the cause, so I have updated all packages using Miktex Updater. The problem remains.
Here is a MWE:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
%usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocsetcountertocdepth0
%%%% chapters
addtocontentstocsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
%beginmini[2]
% wf(w)+ R(w+6x)
% labeleq:Example1
%
% addConstraintg(w)=0
% addConstraintn(w)= 6
% addConstraintL(w)+r(x)=Kw+p
% addConstrainth(x)=0.
%endmini
enddocument
Without optidef
package, the document compiles flawlessly. As soon as I load the package optidef
, I will get the following error message for all corresponding lines of code:
Undefined control sequence.
addtocontentstocsetcountertocdepth0
Does anyone have a solution? Thank you very much in advance.
Best regards,
Dan.
optidef
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using Miktex 2.9 with Texstudio 2.12.6. My document is in KOMA
-class. As I was trying to load the optidef
package, I got an error which seems related to addcontentslinetoc
.
I assumed some outdated packages to be the cause, so I have updated all packages using Miktex Updater. The problem remains.
Here is a MWE:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
%usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocsetcountertocdepth0
%%%% chapters
addtocontentstocsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
%beginmini[2]
% wf(w)+ R(w+6x)
% labeleq:Example1
%
% addConstraintg(w)=0
% addConstraintn(w)= 6
% addConstraintL(w)+r(x)=Kw+p
% addConstrainth(x)=0.
%endmini
enddocument
Without optidef
package, the document compiles flawlessly. As soon as I load the package optidef
, I will get the following error message for all corresponding lines of code:
Undefined control sequence.
addtocontentstocsetcountertocdepth0
Does anyone have a solution? Thank you very much in advance.
Best regards,
Dan.
optidef
I am using Miktex 2.9 with Texstudio 2.12.6. My document is in KOMA
-class. As I was trying to load the optidef
package, I got an error which seems related to addcontentslinetoc
.
I assumed some outdated packages to be the cause, so I have updated all packages using Miktex Updater. The problem remains.
Here is a MWE:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
%usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocsetcountertocdepth0
%%%% chapters
addtocontentstocsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
%beginmini[2]
% wf(w)+ R(w+6x)
% labeleq:Example1
%
% addConstraintg(w)=0
% addConstraintn(w)= 6
% addConstraintL(w)+r(x)=Kw+p
% addConstrainth(x)=0.
%endmini
enddocument
Without optidef
package, the document compiles flawlessly. As soon as I load the package optidef
, I will get the following error message for all corresponding lines of code:
Undefined control sequence.
addtocontentstocsetcountertocdepth0
Does anyone have a solution? Thank you very much in advance.
Best regards,
Dan.
optidef
optidef
asked 2 hours ago
dan
506
506
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Add some protect
:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocprotectsetcountertocdepth0
%%%% chapters
addtocontentstocprotectsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
beginmini[2]
wf(w)+ R(w+6x)
labeleq:Example1
addConstraintg(w)=0
addConstraintn(w)= 6
addConstraintL(w)+r(x)=Kw+p
addConstrainth(x)=0.
endmini
enddocument
Explanation: optidef
requires package calc
and the latter modifies setcounter
in a way which makes the protect
here needed.
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actuallyprotect
should also be used without loadingoptidef
.
– egreg
6 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Add some protect
:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocprotectsetcountertocdepth0
%%%% chapters
addtocontentstocprotectsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
beginmini[2]
wf(w)+ R(w+6x)
labeleq:Example1
addConstraintg(w)=0
addConstraintn(w)= 6
addConstraintL(w)+r(x)=Kw+p
addConstrainth(x)=0.
endmini
enddocument
Explanation: optidef
requires package calc
and the latter modifies setcounter
in a way which makes the protect
here needed.
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actuallyprotect
should also be used without loadingoptidef
.
– egreg
6 mins ago
add a comment |Â
up vote
3
down vote
accepted
Add some protect
:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocprotectsetcountertocdepth0
%%%% chapters
addtocontentstocprotectsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
beginmini[2]
wf(w)+ R(w+6x)
labeleq:Example1
addConstraintg(w)=0
addConstraintn(w)= 6
addConstraintL(w)+r(x)=Kw+p
addConstrainth(x)=0.
endmini
enddocument
Explanation: optidef
requires package calc
and the latter modifies setcounter
in a way which makes the protect
here needed.
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actuallyprotect
should also be used without loadingoptidef
.
– egreg
6 mins ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Add some protect
:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocprotectsetcountertocdepth0
%%%% chapters
addtocontentstocprotectsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
beginmini[2]
wf(w)+ R(w+6x)
labeleq:Example1
addConstraintg(w)=0
addConstraintn(w)= 6
addConstraintL(w)+r(x)=Kw+p
addConstrainth(x)=0.
endmini
enddocument
Explanation: optidef
requires package calc
and the latter modifies setcounter
in a way which makes the protect
here needed.
Add some protect
:
documentclass[12pt, twoside, openright, numbers=noenddot]scrreprt
%%%%%%%%%%%%%%%%% BEGIN PACKAGES
%%% Page header
usepackage[automark,headsepline=off]scrlayer-scrpage
%%% Mathematic equations
usepackageoptidef
%%% links in pdf
usepackagehyperref
usepackage[all]hypcap
usepackage[numbered]bookmark
%%%%%%%%%%%%%%%%% END PACKAGES
begindocument
%%% ToC
pagenumberingroman
phantomsection
pdfbookmarkInhaltsverzeichnistoc
setcountertocdepth4
tableofcontents
%%%% from here on: add elements to ToC
addtocontentstocprotectsetcountertocdepth0
%%%% chapters
addtocontentstocprotectsetcountertocdepth4
chapterTest
test
%%%% Optidef Example
beginmini[2]
wf(w)+ R(w+6x)
labeleq:Example1
addConstraintg(w)=0
addConstraintn(w)= 6
addConstraintL(w)+r(x)=Kw+p
addConstrainth(x)=0.
endmini
enddocument
Explanation: optidef
requires package calc
and the latter modifies setcounter
in a way which makes the protect
here needed.
answered 2 hours ago


jfbu
42.7k64139
42.7k64139
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actuallyprotect
should also be used without loadingoptidef
.
– egreg
6 mins ago
add a comment |Â
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actuallyprotect
should also be used without loadingoptidef
.
– egreg
6 mins ago
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
but these lines do not make much sense anyhow especially one after the other
– jfbu
2 hours ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
Thanks for your solution. Indeed, these lines do not make any sense in the MWE. In my actual document, I am loading prefix chapters in between these lines, which does give them a real purpose :)
– dan
1 hour ago
@dan Actually
protect
should also be used without loading optidef
.– egreg
6 mins ago
@dan Actually
protect
should also be used without loading optidef
.– egreg
6 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f454224%2fproblem-loading-optidef-package-and-addtocontents%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password