Notoccite not workingCitet and citep not working with hyperlinkHyperlinks not working after preview?ref not...

Binary Numbers Magic Trick

Feels like I am getting dragged into office politics

Geometry - Proving a common centroid.

Stark VS Thanos

Why do computer-science majors learn calculus?

Is this homebrew race based on the Draco Volans lizard species balanced?

How do you center multiple equations that have multiple steps?

Why are notes ordered like they are on a piano?

What was the state of the German rail system in 1944?

How to reply this mail from potential PhD professor?

LT Spice Voltage Output

Field Length Validation for Desktop Application which has maximum 1000 characters

An 'if constexpr branch' does not get discarded inside lambda that is inside a template function

Is Cola "probably the best-known" Latin word in the world? If not, which might it be?

Why is the SNP putting so much emphasis on currency plans?

Game of Life meets Chaos Theory

If Melisandre foresaw another character closing blue eyes, why did she follow Stannis?

Airbnb - host wants to reduce rooms, can we get refund?

Can fracking help reduce CO2?

Entropy as a function of temperature: is temperature well defined?

The barbers paradox first order logic formalization

What word means "to make something obsolete"?

How long can a 35mm film be used/stored before it starts to lose its quality after expiry?

Was the ancestor of SCSI, the SASI protocol, nothing more than a draft?



Notoccite not working


Citet and citep not working with hyperlinkHyperlinks not working after preview?ref not working with tikz and externalize libHyperref not workingReference to listing not workingBreak Hyper Link not workingCiting (author, journalabbr., year) neededLinks in pdf not working?cite is not working properlyLastPage not working with HyperRef













1















I have the following document preamble and I cannot understand why notoccite does not work (i.e. LaTeX stills considers the references in the list of Figures/Tables as the firsts appearing in the document). Could it be something related to hyperref? I can't figure it out! Thank you in advance



% **************************************************
% Document Class Definition
% **************************************************
documentclass[%
%paper=A4, % paper size --> A4 is default in Germany
paperheight=24cm, % Size of a book
paperwidth=17cm,
twoside=true, % true onesite or twoside printing
openright, % doublepage cleaning ends up right side
%parskip=small, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
12pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc totoc
listof=nottoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%

%% MISCELANEOUS
usepackage{notoccite}
usepackage{lmodern,textcomp}
% babel system, adjust the language of the content
usepackage[english]{babel}
usepackage{enumerate}
usepackage{siunitx}
usepackage{mathptmx} %ecuaciones con misma letra que texto
%% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
%% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
setlength{parskip}{0.5baselineskip}
usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
%sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose).
bibfile=library, %Put the name of the bibliography file
%bibsys=bibtex,%
%bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
]{cleanthesis}
usepackage{enumitem}
usepackage{placeins}
%% Use the package `pdfpages' to include given pdf documents into your generated document
usepackage{pdfpages}
%% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
usepackage{threeparttable}
%% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
usepackage{pifont}
%% Use package `lscape' for placing selected parts of a document in landscape
usepackage{lscape}
newcommand{cmark}{ding{51}}%
newcommand{xmark}{ding{55}}%
%% Use package `changes' to show produced changes into your document
usepackage[final]{changes}
%% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
hypersetup{
pdftitle={thesisTitle}, % - title (PDF meta)
pdfsubject={thesisSubject},% - subject (PDF meta)
pdfauthor={thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % - {0 0 0}
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}
usepackage{graphics}
%% or use the graphicx package for more complicated commands:
usepackage{graphicx}
%% MATHEMATICAL PACKAGES
usepackage{amssymb} %provides various useful mathematical symbols
usepackage{amsthm} %provides extended theorem environments
usepackage{amsfonts} %provides extended fonts
usepackage{amsmath} %provides mathematical facilities
usepackage{mathtools} %provides useful tools for mathematical typesetting
DeclarePairedDelimiterfloor{lfloor}{rfloor}
usepackage{bm} %Allows bold math font
usepackage{gensymb} %Adds generics symbols
usepackage[nodots]{numcompress}
usepackage{adjustbox}
%% The cleveref package allows to compres multiple refenced equations:
usepackage{cleveref}
newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.
%% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
usepackage{titlesec}
makeatletter
setcounter{secnumdepth}{3}
titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
ifct@cthesis@hangsubsection
titleformat{subsubsection}[hang]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
else
titleformat{subsubsection}[block]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
fi
makeatother
%Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
%% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
makeatletter
g@addto@macronormalsize{%
setlengthabovedisplayskip{5pt}
setlengthbelowdisplayskip{5pt}
setlengthabovedisplayshortskip{5pt}
setlengthbelowdisplayshortskip{5pt}
}
makeatother
%% Use the package caption or subcaption to customize the caption in figures and tables:
usepackage{caption}
usepackage{subcaption}
usepackage[numbers, square, comma, sort&compress]{natbib}
%% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
setlength{emergencystretch}{2pt}
%% Use the following commands to change the space between the text and figures
setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
%setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
%
% **************************************************
% ToC, LoF, LoT
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables

% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
usepackage{tocloft}
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
cftsetindents{figure}{0em}{3em}
cftsetindents{table}{0em}{3em}
renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
%renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
%renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
%renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.

begin{filecontents}{jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{ba,
author = {Ba},
title = {Title of Ba},
}
end{filecontents}

% **************************************************
% Document CONTENT
% **************************************************
begin{document}



listoffigures

this is the text cite{foo} and it should be cited first cite{bar}
begin{figure} [h]
centering
includegraphics[width=4cm]{example-image}
caption{the caption in the text cite{ba}}
label{X}
end{figure}

bibliographystyle{elsarticle-num}

bibliography{library}

% **************************************************
end{document}









share|improve this question




















  • 3





    Please provide a working example, and not just a preamble.

    – Steven B. Segletes
    6 hours ago











  • Thanks for the comment Steven, I provided the mwe!

    – Santi
    4 hours ago
















1















I have the following document preamble and I cannot understand why notoccite does not work (i.e. LaTeX stills considers the references in the list of Figures/Tables as the firsts appearing in the document). Could it be something related to hyperref? I can't figure it out! Thank you in advance



% **************************************************
% Document Class Definition
% **************************************************
documentclass[%
%paper=A4, % paper size --> A4 is default in Germany
paperheight=24cm, % Size of a book
paperwidth=17cm,
twoside=true, % true onesite or twoside printing
openright, % doublepage cleaning ends up right side
%parskip=small, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
12pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc totoc
listof=nottoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%

%% MISCELANEOUS
usepackage{notoccite}
usepackage{lmodern,textcomp}
% babel system, adjust the language of the content
usepackage[english]{babel}
usepackage{enumerate}
usepackage{siunitx}
usepackage{mathptmx} %ecuaciones con misma letra que texto
%% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
%% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
setlength{parskip}{0.5baselineskip}
usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
%sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose).
bibfile=library, %Put the name of the bibliography file
%bibsys=bibtex,%
%bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
]{cleanthesis}
usepackage{enumitem}
usepackage{placeins}
%% Use the package `pdfpages' to include given pdf documents into your generated document
usepackage{pdfpages}
%% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
usepackage{threeparttable}
%% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
usepackage{pifont}
%% Use package `lscape' for placing selected parts of a document in landscape
usepackage{lscape}
newcommand{cmark}{ding{51}}%
newcommand{xmark}{ding{55}}%
%% Use package `changes' to show produced changes into your document
usepackage[final]{changes}
%% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
hypersetup{
pdftitle={thesisTitle}, % - title (PDF meta)
pdfsubject={thesisSubject},% - subject (PDF meta)
pdfauthor={thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % - {0 0 0}
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}
usepackage{graphics}
%% or use the graphicx package for more complicated commands:
usepackage{graphicx}
%% MATHEMATICAL PACKAGES
usepackage{amssymb} %provides various useful mathematical symbols
usepackage{amsthm} %provides extended theorem environments
usepackage{amsfonts} %provides extended fonts
usepackage{amsmath} %provides mathematical facilities
usepackage{mathtools} %provides useful tools for mathematical typesetting
DeclarePairedDelimiterfloor{lfloor}{rfloor}
usepackage{bm} %Allows bold math font
usepackage{gensymb} %Adds generics symbols
usepackage[nodots]{numcompress}
usepackage{adjustbox}
%% The cleveref package allows to compres multiple refenced equations:
usepackage{cleveref}
newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.
%% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
usepackage{titlesec}
makeatletter
setcounter{secnumdepth}{3}
titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
ifct@cthesis@hangsubsection
titleformat{subsubsection}[hang]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
else
titleformat{subsubsection}[block]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
fi
makeatother
%Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
%% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
makeatletter
g@addto@macronormalsize{%
setlengthabovedisplayskip{5pt}
setlengthbelowdisplayskip{5pt}
setlengthabovedisplayshortskip{5pt}
setlengthbelowdisplayshortskip{5pt}
}
makeatother
%% Use the package caption or subcaption to customize the caption in figures and tables:
usepackage{caption}
usepackage{subcaption}
usepackage[numbers, square, comma, sort&compress]{natbib}
%% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
setlength{emergencystretch}{2pt}
%% Use the following commands to change the space between the text and figures
setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
%setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
%
% **************************************************
% ToC, LoF, LoT
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables

% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
usepackage{tocloft}
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
cftsetindents{figure}{0em}{3em}
cftsetindents{table}{0em}{3em}
renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
%renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
%renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
%renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.

begin{filecontents}{jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{ba,
author = {Ba},
title = {Title of Ba},
}
end{filecontents}

% **************************************************
% Document CONTENT
% **************************************************
begin{document}



listoffigures

this is the text cite{foo} and it should be cited first cite{bar}
begin{figure} [h]
centering
includegraphics[width=4cm]{example-image}
caption{the caption in the text cite{ba}}
label{X}
end{figure}

bibliographystyle{elsarticle-num}

bibliography{library}

% **************************************************
end{document}









share|improve this question




















  • 3





    Please provide a working example, and not just a preamble.

    – Steven B. Segletes
    6 hours ago











  • Thanks for the comment Steven, I provided the mwe!

    – Santi
    4 hours ago














1












1








1








I have the following document preamble and I cannot understand why notoccite does not work (i.e. LaTeX stills considers the references in the list of Figures/Tables as the firsts appearing in the document). Could it be something related to hyperref? I can't figure it out! Thank you in advance



% **************************************************
% Document Class Definition
% **************************************************
documentclass[%
%paper=A4, % paper size --> A4 is default in Germany
paperheight=24cm, % Size of a book
paperwidth=17cm,
twoside=true, % true onesite or twoside printing
openright, % doublepage cleaning ends up right side
%parskip=small, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
12pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc totoc
listof=nottoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%

%% MISCELANEOUS
usepackage{notoccite}
usepackage{lmodern,textcomp}
% babel system, adjust the language of the content
usepackage[english]{babel}
usepackage{enumerate}
usepackage{siunitx}
usepackage{mathptmx} %ecuaciones con misma letra que texto
%% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
%% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
setlength{parskip}{0.5baselineskip}
usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
%sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose).
bibfile=library, %Put the name of the bibliography file
%bibsys=bibtex,%
%bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
]{cleanthesis}
usepackage{enumitem}
usepackage{placeins}
%% Use the package `pdfpages' to include given pdf documents into your generated document
usepackage{pdfpages}
%% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
usepackage{threeparttable}
%% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
usepackage{pifont}
%% Use package `lscape' for placing selected parts of a document in landscape
usepackage{lscape}
newcommand{cmark}{ding{51}}%
newcommand{xmark}{ding{55}}%
%% Use package `changes' to show produced changes into your document
usepackage[final]{changes}
%% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
hypersetup{
pdftitle={thesisTitle}, % - title (PDF meta)
pdfsubject={thesisSubject},% - subject (PDF meta)
pdfauthor={thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % - {0 0 0}
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}
usepackage{graphics}
%% or use the graphicx package for more complicated commands:
usepackage{graphicx}
%% MATHEMATICAL PACKAGES
usepackage{amssymb} %provides various useful mathematical symbols
usepackage{amsthm} %provides extended theorem environments
usepackage{amsfonts} %provides extended fonts
usepackage{amsmath} %provides mathematical facilities
usepackage{mathtools} %provides useful tools for mathematical typesetting
DeclarePairedDelimiterfloor{lfloor}{rfloor}
usepackage{bm} %Allows bold math font
usepackage{gensymb} %Adds generics symbols
usepackage[nodots]{numcompress}
usepackage{adjustbox}
%% The cleveref package allows to compres multiple refenced equations:
usepackage{cleveref}
newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.
%% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
usepackage{titlesec}
makeatletter
setcounter{secnumdepth}{3}
titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
ifct@cthesis@hangsubsection
titleformat{subsubsection}[hang]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
else
titleformat{subsubsection}[block]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
fi
makeatother
%Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
%% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
makeatletter
g@addto@macronormalsize{%
setlengthabovedisplayskip{5pt}
setlengthbelowdisplayskip{5pt}
setlengthabovedisplayshortskip{5pt}
setlengthbelowdisplayshortskip{5pt}
}
makeatother
%% Use the package caption or subcaption to customize the caption in figures and tables:
usepackage{caption}
usepackage{subcaption}
usepackage[numbers, square, comma, sort&compress]{natbib}
%% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
setlength{emergencystretch}{2pt}
%% Use the following commands to change the space between the text and figures
setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
%setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
%
% **************************************************
% ToC, LoF, LoT
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables

% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
usepackage{tocloft}
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
cftsetindents{figure}{0em}{3em}
cftsetindents{table}{0em}{3em}
renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
%renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
%renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
%renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.

begin{filecontents}{jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{ba,
author = {Ba},
title = {Title of Ba},
}
end{filecontents}

% **************************************************
% Document CONTENT
% **************************************************
begin{document}



listoffigures

this is the text cite{foo} and it should be cited first cite{bar}
begin{figure} [h]
centering
includegraphics[width=4cm]{example-image}
caption{the caption in the text cite{ba}}
label{X}
end{figure}

bibliographystyle{elsarticle-num}

bibliography{library}

% **************************************************
end{document}









share|improve this question
















I have the following document preamble and I cannot understand why notoccite does not work (i.e. LaTeX stills considers the references in the list of Figures/Tables as the firsts appearing in the document). Could it be something related to hyperref? I can't figure it out! Thank you in advance



% **************************************************
% Document Class Definition
% **************************************************
documentclass[%
%paper=A4, % paper size --> A4 is default in Germany
paperheight=24cm, % Size of a book
paperwidth=17cm,
twoside=true, % true onesite or twoside printing
openright, % doublepage cleaning ends up right side
%parskip=small, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
12pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc totoc
listof=nottoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%

%% MISCELANEOUS
usepackage{notoccite}
usepackage{lmodern,textcomp}
% babel system, adjust the language of the content
usepackage[english]{babel}
usepackage{enumerate}
usepackage{siunitx}
usepackage{mathptmx} %ecuaciones con misma letra que texto
%% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
%% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
setlength{parskip}{0.5baselineskip}
usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
%sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose).
bibfile=library, %Put the name of the bibliography file
%bibsys=bibtex,%
%bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
]{cleanthesis}
usepackage{enumitem}
usepackage{placeins}
%% Use the package `pdfpages' to include given pdf documents into your generated document
usepackage{pdfpages}
%% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
usepackage{threeparttable}
%% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
usepackage{pifont}
%% Use package `lscape' for placing selected parts of a document in landscape
usepackage{lscape}
newcommand{cmark}{ding{51}}%
newcommand{xmark}{ding{55}}%
%% Use package `changes' to show produced changes into your document
usepackage[final]{changes}
%% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
hypersetup{
pdftitle={thesisTitle}, % - title (PDF meta)
pdfsubject={thesisSubject},% - subject (PDF meta)
pdfauthor={thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % - {0 0 0}
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}
usepackage{graphics}
%% or use the graphicx package for more complicated commands:
usepackage{graphicx}
%% MATHEMATICAL PACKAGES
usepackage{amssymb} %provides various useful mathematical symbols
usepackage{amsthm} %provides extended theorem environments
usepackage{amsfonts} %provides extended fonts
usepackage{amsmath} %provides mathematical facilities
usepackage{mathtools} %provides useful tools for mathematical typesetting
DeclarePairedDelimiterfloor{lfloor}{rfloor}
usepackage{bm} %Allows bold math font
usepackage{gensymb} %Adds generics symbols
usepackage[nodots]{numcompress}
usepackage{adjustbox}
%% The cleveref package allows to compres multiple refenced equations:
usepackage{cleveref}
newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.
%% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
usepackage{titlesec}
makeatletter
setcounter{secnumdepth}{3}
titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
ifct@cthesis@hangsubsection
titleformat{subsubsection}[hang]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
else
titleformat{subsubsection}[block]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
fi
makeatother
%Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
%% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
makeatletter
g@addto@macronormalsize{%
setlengthabovedisplayskip{5pt}
setlengthbelowdisplayskip{5pt}
setlengthabovedisplayshortskip{5pt}
setlengthbelowdisplayshortskip{5pt}
}
makeatother
%% Use the package caption or subcaption to customize the caption in figures and tables:
usepackage{caption}
usepackage{subcaption}
usepackage[numbers, square, comma, sort&compress]{natbib}
%% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
setlength{emergencystretch}{2pt}
%% Use the following commands to change the space between the text and figures
setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
%setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
%
% **************************************************
% ToC, LoF, LoT
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables

% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
usepackage{tocloft}
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
cftsetindents{figure}{0em}{3em}
cftsetindents{table}{0em}{3em}
renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
%renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
%renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
%renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.

begin{filecontents}{jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{ba,
author = {Ba},
title = {Title of Ba},
}
end{filecontents}

% **************************************************
% Document CONTENT
% **************************************************
begin{document}



listoffigures

this is the text cite{foo} and it should be cited first cite{bar}
begin{figure} [h]
centering
includegraphics[width=4cm]{example-image}
caption{the caption in the text cite{ba}}
label{X}
end{figure}

bibliographystyle{elsarticle-num}

bibliography{library}

% **************************************************
end{document}






hyperref cross-referencing citing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 3 hours ago









Kurt

42.4k950167




42.4k950167










asked 6 hours ago









SantiSanti

1096




1096








  • 3





    Please provide a working example, and not just a preamble.

    – Steven B. Segletes
    6 hours ago











  • Thanks for the comment Steven, I provided the mwe!

    – Santi
    4 hours ago














  • 3





    Please provide a working example, and not just a preamble.

    – Steven B. Segletes
    6 hours ago











  • Thanks for the comment Steven, I provided the mwe!

    – Santi
    4 hours ago








3




3





Please provide a working example, and not just a preamble.

– Steven B. Segletes
6 hours ago





Please provide a working example, and not just a preamble.

– Steven B. Segletes
6 hours ago













Thanks for the comment Steven, I provided the mwe!

– Santi
4 hours ago





Thanks for the comment Steven, I provided the mwe!

– Santi
4 hours ago










1 Answer
1






active

oldest

votes


















1














Well, you have a lot of issues in your show code, some of them resulting of some missunderstanding, I guess. Please see the following list:





  1. classicthesis does it own bibliography thing with biblatex, so your used commands bibliographystyle and bibliography are simply wrong. Use printbibliography instead.

  2. With your given code you need bibfile=jobname, as package option for classicthesis.


  3. colortheme=blueblack seems to be undefined on my system, I commented that package option for classicthesis


  4. usepackage[nodots]{numcompress} results in error, commented.


  5. usepackage[numbers, square, comma, sort&compress]{natbib} is wrong together with biblatex, commented. Please read the documentation of classicthesis how to use natbib.

  6. Several commands thesis... undefined in hypersetup, commented.


  7. cleverref should be called after hyperref, hyperref is called in classicthesis

  8. You got several warnings about using packages better not to use in KOMA-Script, for example fancyhdr (use scrlayer-scrpage instead), and others resulting from the usage of classicthesis

  9. Package notoccite is relative old (2000). Do you really need it?


However, the following code compiles without error on my current MiKTeX 2.9:



documentclass[%
%paper=A4, % paper size --> A4 is default in Germany
paperheight=24cm, % Size of a book
paperwidth=17cm,
twoside=true, % true onesite or twoside printing
openright, % doublepage cleaning ends up right side
%parskip=small, % spacing value / method for paragraphs
chapterprefix=true, % prefix for chapter marks
12pt, % font size
headings=normal, % size of headings
bibliography=totoc, % include bib in toc totoc
listof=nottoc, % include listof entries in toc
titlepage=on, % own page for each title page
captions=tableabove, % display table captions above the float env
draft=false, % value for draft version
]{scrreprt}%

%% MISCELANEOUS
usepackage{notoccite}
usepackage{lmodern,textcomp}
% babel system, adjust the language of the content
usepackage[english]{babel}
usepackage{enumerate}
usepackage{siunitx}
usepackage{mathptmx} %ecuaciones con misma letra que texto
%% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
%% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
setlength{parskip}{0.5baselineskip}
usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
%sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
% colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose). <===================================
bibfile=jobname,%, %Put the name of the bibliography file % <================================
%bibsys=bibtex,%
%bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
]{cleanthesis}
usepackage{enumitem}
usepackage{placeins}
%% Use the package `pdfpages' to include given pdf documents into your generated document
usepackage{pdfpages}
%% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
usepackage{threeparttable}
%% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
usepackage{pifont}
%% Use package `lscape' for placing selected parts of a document in landscape
usepackage{lscape}
newcommand{cmark}{ding{51}}%
newcommand{xmark}{ding{55}}%
%% Use package `changes' to show produced changes into your document
usepackage[final]{changes}

%usepackage{graphics}
%% or use the graphicx package for more complicated commands:
usepackage{graphicx}
%% MATHEMATICAL PACKAGES
usepackage{amssymb} %provides various useful mathematical symbols
usepackage{amsthm} %provides extended theorem environments
usepackage{amsfonts} %provides extended fonts
usepackage{amsmath} %provides mathematical facilities
usepackage{mathtools} %provides useful tools for mathematical typesetting
DeclarePairedDelimiterfloor{lfloor}{rfloor}
usepackage{bm} %Allows bold math font
usepackage{gensymb} %Adds generics symbols
%usepackage[nodots]{numcompress} % <=====================================
usepackage{adjustbox}

%% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
usepackage{titlesec}
makeatletter
setcounter{secnumdepth}{3}
titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
ifct@cthesis@hangsubsection
titleformat{subsubsection}[hang]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
else
titleformat{subsubsection}[block]%
{usekomafont{subsubsection}}%
{color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
{0pt}%
{raggedright}%
[phantomsection]
fi
makeatother
%Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
%% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
makeatletter
g@addto@macronormalsize{%
setlengthabovedisplayskip{5pt}
setlengthbelowdisplayskip{5pt}
setlengthabovedisplayshortskip{5pt}
setlengthbelowdisplayshortskip{5pt}
}
makeatother
%% Use the package caption or subcaption to customize the caption in figures and tables:
usepackage{caption}
usepackage{subcaption}
%usepackage[numbers, square, comma, sort&compress]{natbib} % <====== classicthesis
%% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
setlength{emergencystretch}{2pt}
%% Use the following commands to change the space between the text and figures
setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
%setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
%
% **************************************************
% ToC, LoF, LoT
% **************************************************
%
% -- modifications regarding the table of contents,
% the list of figures and the list of tables

% The tocloft package enables us to control the typographic design of the
% table of contents, list of figures and list of tables
usepackage{tocloft}
%
% > adjusts the indention for figure and table entries (lof and lot)
% -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
% the length indent and its numwidth to the length numwidth
cftsetindents{figure}{0em}{3em}
cftsetindents{table}{0em}{3em}
renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
%renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
%renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
%renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.



%% The cleveref package allows to compres multiple refenced equations:
usepackage{cleveref}
newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.

%% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
hypersetup{
% pdftitle={ThesisTitle}, % - title (PDF meta) <================================
% pdfsubject={thesisSubject},% - subject (PDF meta)
% pdfauthor={thesisName}, % - author (PDF meta)
plainpages=false, % -
colorlinks=false, % - colorize links?
pdfborder={0 0 0}, % - {0 0 0}
breaklinks=true, % - allow line break inside links
bookmarksnumbered=true, %
bookmarksopen=true %
}

begin{filecontents}{jobname.bib}
@misc{foo,
author = {Foo},
title = {Title of Foo},
}
@misc{bar,
author = {Bar},
title = {Title of Bar},
}
@misc{ba,
author = {Ba},
title = {Title of Ba},
}
end{filecontents}



% **************************************************
% Document CONTENT
% **************************************************
begin{document}

listoffigures

this is the text cite{foo} and it should be cited first cite{bar}

begin{figure} [h]
centering
includegraphics[width=4cm]{example-image}
caption{the caption in the text cite{bar}}
label{X}
end{figure}

%bibliographystyle{elsarticle-num} % <=================================

printbibliography%{jobname} % <=======================================

% **************************************************
end{document}


with the result:



page 1



and



bibliography






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488282%2fnotoccite-not-working%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Well, you have a lot of issues in your show code, some of them resulting of some missunderstanding, I guess. Please see the following list:





    1. classicthesis does it own bibliography thing with biblatex, so your used commands bibliographystyle and bibliography are simply wrong. Use printbibliography instead.

    2. With your given code you need bibfile=jobname, as package option for classicthesis.


    3. colortheme=blueblack seems to be undefined on my system, I commented that package option for classicthesis


    4. usepackage[nodots]{numcompress} results in error, commented.


    5. usepackage[numbers, square, comma, sort&compress]{natbib} is wrong together with biblatex, commented. Please read the documentation of classicthesis how to use natbib.

    6. Several commands thesis... undefined in hypersetup, commented.


    7. cleverref should be called after hyperref, hyperref is called in classicthesis

    8. You got several warnings about using packages better not to use in KOMA-Script, for example fancyhdr (use scrlayer-scrpage instead), and others resulting from the usage of classicthesis

    9. Package notoccite is relative old (2000). Do you really need it?


    However, the following code compiles without error on my current MiKTeX 2.9:



    documentclass[%
    %paper=A4, % paper size --> A4 is default in Germany
    paperheight=24cm, % Size of a book
    paperwidth=17cm,
    twoside=true, % true onesite or twoside printing
    openright, % doublepage cleaning ends up right side
    %parskip=small, % spacing value / method for paragraphs
    chapterprefix=true, % prefix for chapter marks
    12pt, % font size
    headings=normal, % size of headings
    bibliography=totoc, % include bib in toc totoc
    listof=nottoc, % include listof entries in toc
    titlepage=on, % own page for each title page
    captions=tableabove, % display table captions above the float env
    draft=false, % value for draft version
    ]{scrreprt}%

    %% MISCELANEOUS
    usepackage{notoccite}
    usepackage{lmodern,textcomp}
    % babel system, adjust the language of the content
    usepackage[english]{babel}
    usepackage{enumerate}
    usepackage{siunitx}
    usepackage{mathptmx} %ecuaciones con misma letra que texto
    %% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
    newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
    newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
    %% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
    setlength{parskip}{0.5baselineskip}
    usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
    figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
    %sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
    hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
    hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
    hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
    colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
    % colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose). <===================================
    bibfile=jobname,%, %Put the name of the bibliography file % <================================
    %bibsys=bibtex,%
    %bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
    ]{cleanthesis}
    usepackage{enumitem}
    usepackage{placeins}
    %% Use the package `pdfpages' to include given pdf documents into your generated document
    usepackage{pdfpages}
    %% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
    usepackage{threeparttable}
    %% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
    usepackage{pifont}
    %% Use package `lscape' for placing selected parts of a document in landscape
    usepackage{lscape}
    newcommand{cmark}{ding{51}}%
    newcommand{xmark}{ding{55}}%
    %% Use package `changes' to show produced changes into your document
    usepackage[final]{changes}

    %usepackage{graphics}
    %% or use the graphicx package for more complicated commands:
    usepackage{graphicx}
    %% MATHEMATICAL PACKAGES
    usepackage{amssymb} %provides various useful mathematical symbols
    usepackage{amsthm} %provides extended theorem environments
    usepackage{amsfonts} %provides extended fonts
    usepackage{amsmath} %provides mathematical facilities
    usepackage{mathtools} %provides useful tools for mathematical typesetting
    DeclarePairedDelimiterfloor{lfloor}{rfloor}
    usepackage{bm} %Allows bold math font
    usepackage{gensymb} %Adds generics symbols
    %usepackage[nodots]{numcompress} % <=====================================
    usepackage{adjustbox}

    %% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
    usepackage{titlesec}
    makeatletter
    setcounter{secnumdepth}{3}
    titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
    ifct@cthesis@hangsubsection
    titleformat{subsubsection}[hang]%
    {usekomafont{subsubsection}}%
    {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
    {0pt}%
    {raggedright}%
    [phantomsection]
    else
    titleformat{subsubsection}[block]%
    {usekomafont{subsubsection}}%
    {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
    {0pt}%
    {raggedright}%
    [phantomsection]
    fi
    makeatother
    %Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
    titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
    titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
    %% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
    makeatletter
    g@addto@macronormalsize{%
    setlengthabovedisplayskip{5pt}
    setlengthbelowdisplayskip{5pt}
    setlengthabovedisplayshortskip{5pt}
    setlengthbelowdisplayshortskip{5pt}
    }
    makeatother
    %% Use the package caption or subcaption to customize the caption in figures and tables:
    usepackage{caption}
    usepackage{subcaption}
    %usepackage[numbers, square, comma, sort&compress]{natbib} % <====== classicthesis
    %% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
    setlength{emergencystretch}{2pt}
    %% Use the following commands to change the space between the text and figures
    setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
    %setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
    setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
    %
    % **************************************************
    % ToC, LoF, LoT
    % **************************************************
    %
    % -- modifications regarding the table of contents,
    % the list of figures and the list of tables

    % The tocloft package enables us to control the typographic design of the
    % table of contents, list of figures and list of tables
    usepackage{tocloft}
    %
    % > adjusts the indention for figure and table entries (lof and lot)
    % -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
    % the length indent and its numwidth to the length numwidth
    cftsetindents{figure}{0em}{3em}
    cftsetindents{table}{0em}{3em}
    renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
    renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
    renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
    %renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
    %renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
    %renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
    renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
    renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.



    %% The cleveref package allows to compres multiple refenced equations:
    usepackage{cleveref}
    newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
    crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.

    %% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
    hypersetup{
    % pdftitle={ThesisTitle}, % - title (PDF meta) <================================
    % pdfsubject={thesisSubject},% - subject (PDF meta)
    % pdfauthor={thesisName}, % - author (PDF meta)
    plainpages=false, % -
    colorlinks=false, % - colorize links?
    pdfborder={0 0 0}, % - {0 0 0}
    breaklinks=true, % - allow line break inside links
    bookmarksnumbered=true, %
    bookmarksopen=true %
    }

    begin{filecontents}{jobname.bib}
    @misc{foo,
    author = {Foo},
    title = {Title of Foo},
    }
    @misc{bar,
    author = {Bar},
    title = {Title of Bar},
    }
    @misc{ba,
    author = {Ba},
    title = {Title of Ba},
    }
    end{filecontents}



    % **************************************************
    % Document CONTENT
    % **************************************************
    begin{document}

    listoffigures

    this is the text cite{foo} and it should be cited first cite{bar}

    begin{figure} [h]
    centering
    includegraphics[width=4cm]{example-image}
    caption{the caption in the text cite{bar}}
    label{X}
    end{figure}

    %bibliographystyle{elsarticle-num} % <=================================

    printbibliography%{jobname} % <=======================================

    % **************************************************
    end{document}


    with the result:



    page 1



    and



    bibliography






    share|improve this answer




























      1














      Well, you have a lot of issues in your show code, some of them resulting of some missunderstanding, I guess. Please see the following list:





      1. classicthesis does it own bibliography thing with biblatex, so your used commands bibliographystyle and bibliography are simply wrong. Use printbibliography instead.

      2. With your given code you need bibfile=jobname, as package option for classicthesis.


      3. colortheme=blueblack seems to be undefined on my system, I commented that package option for classicthesis


      4. usepackage[nodots]{numcompress} results in error, commented.


      5. usepackage[numbers, square, comma, sort&compress]{natbib} is wrong together with biblatex, commented. Please read the documentation of classicthesis how to use natbib.

      6. Several commands thesis... undefined in hypersetup, commented.


      7. cleverref should be called after hyperref, hyperref is called in classicthesis

      8. You got several warnings about using packages better not to use in KOMA-Script, for example fancyhdr (use scrlayer-scrpage instead), and others resulting from the usage of classicthesis

      9. Package notoccite is relative old (2000). Do you really need it?


      However, the following code compiles without error on my current MiKTeX 2.9:



      documentclass[%
      %paper=A4, % paper size --> A4 is default in Germany
      paperheight=24cm, % Size of a book
      paperwidth=17cm,
      twoside=true, % true onesite or twoside printing
      openright, % doublepage cleaning ends up right side
      %parskip=small, % spacing value / method for paragraphs
      chapterprefix=true, % prefix for chapter marks
      12pt, % font size
      headings=normal, % size of headings
      bibliography=totoc, % include bib in toc totoc
      listof=nottoc, % include listof entries in toc
      titlepage=on, % own page for each title page
      captions=tableabove, % display table captions above the float env
      draft=false, % value for draft version
      ]{scrreprt}%

      %% MISCELANEOUS
      usepackage{notoccite}
      usepackage{lmodern,textcomp}
      % babel system, adjust the language of the content
      usepackage[english]{babel}
      usepackage{enumerate}
      usepackage{siunitx}
      usepackage{mathptmx} %ecuaciones con misma letra que texto
      %% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
      newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
      newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
      %% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
      setlength{parskip}{0.5baselineskip}
      usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
      figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
      %sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
      hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
      hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
      hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
      colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
      % colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose). <===================================
      bibfile=jobname,%, %Put the name of the bibliography file % <================================
      %bibsys=bibtex,%
      %bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
      ]{cleanthesis}
      usepackage{enumitem}
      usepackage{placeins}
      %% Use the package `pdfpages' to include given pdf documents into your generated document
      usepackage{pdfpages}
      %% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
      usepackage{threeparttable}
      %% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
      usepackage{pifont}
      %% Use package `lscape' for placing selected parts of a document in landscape
      usepackage{lscape}
      newcommand{cmark}{ding{51}}%
      newcommand{xmark}{ding{55}}%
      %% Use package `changes' to show produced changes into your document
      usepackage[final]{changes}

      %usepackage{graphics}
      %% or use the graphicx package for more complicated commands:
      usepackage{graphicx}
      %% MATHEMATICAL PACKAGES
      usepackage{amssymb} %provides various useful mathematical symbols
      usepackage{amsthm} %provides extended theorem environments
      usepackage{amsfonts} %provides extended fonts
      usepackage{amsmath} %provides mathematical facilities
      usepackage{mathtools} %provides useful tools for mathematical typesetting
      DeclarePairedDelimiterfloor{lfloor}{rfloor}
      usepackage{bm} %Allows bold math font
      usepackage{gensymb} %Adds generics symbols
      %usepackage[nodots]{numcompress} % <=====================================
      usepackage{adjustbox}

      %% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
      usepackage{titlesec}
      makeatletter
      setcounter{secnumdepth}{3}
      titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
      ifct@cthesis@hangsubsection
      titleformat{subsubsection}[hang]%
      {usekomafont{subsubsection}}%
      {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
      {0pt}%
      {raggedright}%
      [phantomsection]
      else
      titleformat{subsubsection}[block]%
      {usekomafont{subsubsection}}%
      {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
      {0pt}%
      {raggedright}%
      [phantomsection]
      fi
      makeatother
      %Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
      titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
      titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
      %% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
      makeatletter
      g@addto@macronormalsize{%
      setlengthabovedisplayskip{5pt}
      setlengthbelowdisplayskip{5pt}
      setlengthabovedisplayshortskip{5pt}
      setlengthbelowdisplayshortskip{5pt}
      }
      makeatother
      %% Use the package caption or subcaption to customize the caption in figures and tables:
      usepackage{caption}
      usepackage{subcaption}
      %usepackage[numbers, square, comma, sort&compress]{natbib} % <====== classicthesis
      %% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
      setlength{emergencystretch}{2pt}
      %% Use the following commands to change the space between the text and figures
      setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
      %setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
      setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
      %
      % **************************************************
      % ToC, LoF, LoT
      % **************************************************
      %
      % -- modifications regarding the table of contents,
      % the list of figures and the list of tables

      % The tocloft package enables us to control the typographic design of the
      % table of contents, list of figures and list of tables
      usepackage{tocloft}
      %
      % > adjusts the indention for figure and table entries (lof and lot)
      % -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
      % the length indent and its numwidth to the length numwidth
      cftsetindents{figure}{0em}{3em}
      cftsetindents{table}{0em}{3em}
      renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
      renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
      renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
      %renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
      %renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
      %renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
      renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
      renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.



      %% The cleveref package allows to compres multiple refenced equations:
      usepackage{cleveref}
      newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
      crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.

      %% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
      hypersetup{
      % pdftitle={ThesisTitle}, % - title (PDF meta) <================================
      % pdfsubject={thesisSubject},% - subject (PDF meta)
      % pdfauthor={thesisName}, % - author (PDF meta)
      plainpages=false, % -
      colorlinks=false, % - colorize links?
      pdfborder={0 0 0}, % - {0 0 0}
      breaklinks=true, % - allow line break inside links
      bookmarksnumbered=true, %
      bookmarksopen=true %
      }

      begin{filecontents}{jobname.bib}
      @misc{foo,
      author = {Foo},
      title = {Title of Foo},
      }
      @misc{bar,
      author = {Bar},
      title = {Title of Bar},
      }
      @misc{ba,
      author = {Ba},
      title = {Title of Ba},
      }
      end{filecontents}



      % **************************************************
      % Document CONTENT
      % **************************************************
      begin{document}

      listoffigures

      this is the text cite{foo} and it should be cited first cite{bar}

      begin{figure} [h]
      centering
      includegraphics[width=4cm]{example-image}
      caption{the caption in the text cite{bar}}
      label{X}
      end{figure}

      %bibliographystyle{elsarticle-num} % <=================================

      printbibliography%{jobname} % <=======================================

      % **************************************************
      end{document}


      with the result:



      page 1



      and



      bibliography






      share|improve this answer


























        1












        1








        1







        Well, you have a lot of issues in your show code, some of them resulting of some missunderstanding, I guess. Please see the following list:





        1. classicthesis does it own bibliography thing with biblatex, so your used commands bibliographystyle and bibliography are simply wrong. Use printbibliography instead.

        2. With your given code you need bibfile=jobname, as package option for classicthesis.


        3. colortheme=blueblack seems to be undefined on my system, I commented that package option for classicthesis


        4. usepackage[nodots]{numcompress} results in error, commented.


        5. usepackage[numbers, square, comma, sort&compress]{natbib} is wrong together with biblatex, commented. Please read the documentation of classicthesis how to use natbib.

        6. Several commands thesis... undefined in hypersetup, commented.


        7. cleverref should be called after hyperref, hyperref is called in classicthesis

        8. You got several warnings about using packages better not to use in KOMA-Script, for example fancyhdr (use scrlayer-scrpage instead), and others resulting from the usage of classicthesis

        9. Package notoccite is relative old (2000). Do you really need it?


        However, the following code compiles without error on my current MiKTeX 2.9:



        documentclass[%
        %paper=A4, % paper size --> A4 is default in Germany
        paperheight=24cm, % Size of a book
        paperwidth=17cm,
        twoside=true, % true onesite or twoside printing
        openright, % doublepage cleaning ends up right side
        %parskip=small, % spacing value / method for paragraphs
        chapterprefix=true, % prefix for chapter marks
        12pt, % font size
        headings=normal, % size of headings
        bibliography=totoc, % include bib in toc totoc
        listof=nottoc, % include listof entries in toc
        titlepage=on, % own page for each title page
        captions=tableabove, % display table captions above the float env
        draft=false, % value for draft version
        ]{scrreprt}%

        %% MISCELANEOUS
        usepackage{notoccite}
        usepackage{lmodern,textcomp}
        % babel system, adjust the language of the content
        usepackage[english]{babel}
        usepackage{enumerate}
        usepackage{siunitx}
        usepackage{mathptmx} %ecuaciones con misma letra que texto
        %% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
        newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
        newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
        %% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
        setlength{parskip}{0.5baselineskip}
        usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
        figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
        %sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
        hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
        hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
        hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
        colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
        % colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose). <===================================
        bibfile=jobname,%, %Put the name of the bibliography file % <================================
        %bibsys=bibtex,%
        %bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
        ]{cleanthesis}
        usepackage{enumitem}
        usepackage{placeins}
        %% Use the package `pdfpages' to include given pdf documents into your generated document
        usepackage{pdfpages}
        %% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
        usepackage{threeparttable}
        %% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
        usepackage{pifont}
        %% Use package `lscape' for placing selected parts of a document in landscape
        usepackage{lscape}
        newcommand{cmark}{ding{51}}%
        newcommand{xmark}{ding{55}}%
        %% Use package `changes' to show produced changes into your document
        usepackage[final]{changes}

        %usepackage{graphics}
        %% or use the graphicx package for more complicated commands:
        usepackage{graphicx}
        %% MATHEMATICAL PACKAGES
        usepackage{amssymb} %provides various useful mathematical symbols
        usepackage{amsthm} %provides extended theorem environments
        usepackage{amsfonts} %provides extended fonts
        usepackage{amsmath} %provides mathematical facilities
        usepackage{mathtools} %provides useful tools for mathematical typesetting
        DeclarePairedDelimiterfloor{lfloor}{rfloor}
        usepackage{bm} %Allows bold math font
        usepackage{gensymb} %Adds generics symbols
        %usepackage[nodots]{numcompress} % <=====================================
        usepackage{adjustbox}

        %% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
        usepackage{titlesec}
        makeatletter
        setcounter{secnumdepth}{3}
        titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
        ifct@cthesis@hangsubsection
        titleformat{subsubsection}[hang]%
        {usekomafont{subsubsection}}%
        {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
        {0pt}%
        {raggedright}%
        [phantomsection]
        else
        titleformat{subsubsection}[block]%
        {usekomafont{subsubsection}}%
        {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
        {0pt}%
        {raggedright}%
        [phantomsection]
        fi
        makeatother
        %Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
        titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
        titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
        %% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
        makeatletter
        g@addto@macronormalsize{%
        setlengthabovedisplayskip{5pt}
        setlengthbelowdisplayskip{5pt}
        setlengthabovedisplayshortskip{5pt}
        setlengthbelowdisplayshortskip{5pt}
        }
        makeatother
        %% Use the package caption or subcaption to customize the caption in figures and tables:
        usepackage{caption}
        usepackage{subcaption}
        %usepackage[numbers, square, comma, sort&compress]{natbib} % <====== classicthesis
        %% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
        setlength{emergencystretch}{2pt}
        %% Use the following commands to change the space between the text and figures
        setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
        %setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
        setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
        %
        % **************************************************
        % ToC, LoF, LoT
        % **************************************************
        %
        % -- modifications regarding the table of contents,
        % the list of figures and the list of tables

        % The tocloft package enables us to control the typographic design of the
        % table of contents, list of figures and list of tables
        usepackage{tocloft}
        %
        % > adjusts the indention for figure and table entries (lof and lot)
        % -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
        % the length indent and its numwidth to the length numwidth
        cftsetindents{figure}{0em}{3em}
        cftsetindents{table}{0em}{3em}
        renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
        renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
        renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
        %renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
        %renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
        %renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
        renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
        renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.



        %% The cleveref package allows to compres multiple refenced equations:
        usepackage{cleveref}
        newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
        crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.

        %% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
        hypersetup{
        % pdftitle={ThesisTitle}, % - title (PDF meta) <================================
        % pdfsubject={thesisSubject},% - subject (PDF meta)
        % pdfauthor={thesisName}, % - author (PDF meta)
        plainpages=false, % -
        colorlinks=false, % - colorize links?
        pdfborder={0 0 0}, % - {0 0 0}
        breaklinks=true, % - allow line break inside links
        bookmarksnumbered=true, %
        bookmarksopen=true %
        }

        begin{filecontents}{jobname.bib}
        @misc{foo,
        author = {Foo},
        title = {Title of Foo},
        }
        @misc{bar,
        author = {Bar},
        title = {Title of Bar},
        }
        @misc{ba,
        author = {Ba},
        title = {Title of Ba},
        }
        end{filecontents}



        % **************************************************
        % Document CONTENT
        % **************************************************
        begin{document}

        listoffigures

        this is the text cite{foo} and it should be cited first cite{bar}

        begin{figure} [h]
        centering
        includegraphics[width=4cm]{example-image}
        caption{the caption in the text cite{bar}}
        label{X}
        end{figure}

        %bibliographystyle{elsarticle-num} % <=================================

        printbibliography%{jobname} % <=======================================

        % **************************************************
        end{document}


        with the result:



        page 1



        and



        bibliography






        share|improve this answer













        Well, you have a lot of issues in your show code, some of them resulting of some missunderstanding, I guess. Please see the following list:





        1. classicthesis does it own bibliography thing with biblatex, so your used commands bibliographystyle and bibliography are simply wrong. Use printbibliography instead.

        2. With your given code you need bibfile=jobname, as package option for classicthesis.


        3. colortheme=blueblack seems to be undefined on my system, I commented that package option for classicthesis


        4. usepackage[nodots]{numcompress} results in error, commented.


        5. usepackage[numbers, square, comma, sort&compress]{natbib} is wrong together with biblatex, commented. Please read the documentation of classicthesis how to use natbib.

        6. Several commands thesis... undefined in hypersetup, commented.


        7. cleverref should be called after hyperref, hyperref is called in classicthesis

        8. You got several warnings about using packages better not to use in KOMA-Script, for example fancyhdr (use scrlayer-scrpage instead), and others resulting from the usage of classicthesis

        9. Package notoccite is relative old (2000). Do you really need it?


        However, the following code compiles without error on my current MiKTeX 2.9:



        documentclass[%
        %paper=A4, % paper size --> A4 is default in Germany
        paperheight=24cm, % Size of a book
        paperwidth=17cm,
        twoside=true, % true onesite or twoside printing
        openright, % doublepage cleaning ends up right side
        %parskip=small, % spacing value / method for paragraphs
        chapterprefix=true, % prefix for chapter marks
        12pt, % font size
        headings=normal, % size of headings
        bibliography=totoc, % include bib in toc totoc
        listof=nottoc, % include listof entries in toc
        titlepage=on, % own page for each title page
        captions=tableabove, % display table captions above the float env
        draft=false, % value for draft version
        ]{scrreprt}%

        %% MISCELANEOUS
        usepackage{notoccite}
        usepackage{lmodern,textcomp}
        % babel system, adjust the language of the content
        usepackage[english]{babel}
        usepackage{enumerate}
        usepackage{siunitx}
        usepackage{mathptmx} %ecuaciones con misma letra que texto
        %% Use the following command to allow font sizes larger than `Huge'. Useful for doing the title larger
        newcommandSuperHuge{fontsize{40}{40}selectfont} % For cover page
        newcommandSuperHuuge{fontsize{31}{31}selectfont}% For page after cover
        %% Use the parskip package to control the space between paragraphs. The following command will leave one empty line of space and will remove the identation. The space can be controlled by changing the value in the second {}.
        setlength{parskip}{0.5baselineskip}
        usepackage[ % clean thesis style package and options. You can find all options in `doc' folder. These options can also be defined at the document options
        figuresep=colon, % This determines what appears after the number of the figure caption. Options are: 'colon' (inserts :), 'none' (inserts nothing), 'period' (inserts .), 'space' (inserts a single space), `quad` (inserts a larger space), 'endash' (inserts a -).
        %sansserif=false, % Option to use sanserif font. Options are: 'true' or 'false'. This is no longer used since times font is enforced.
        hangfigurecaption=false, %Sets whether to use a hanging figure label or not (placed in page margin). Options: 'true' or 'false'.
        hangsection=true, %Sets whether to use a hanging section label (placed in page margin). Options are 'true' or 'false'
        hangsubsection=true, %Sets whether to use a hanging subsection label (placed in page margin). Options are 'true' or 'false'
        colorize=full, %This determines how many things are colored 8such as the titles, etc.). Options are: 'full' (footers, headers, sections are painted everywhere), 'reduced' (less things are painted), and 'bw' (all is black-grey color except figures).
        % colortheme=blueblack, %This changes the colors of sections, titles, headers, etc. Combinations are: 'bluemagenta', 'bluegreen', 'blueblack' (added by Jose). <===================================
        bibfile=jobname,%, %Put the name of the bibliography file % <================================
        %bibsys=bibtex,%
        %bibstyle=numeric-comp %authoryear,%alphabetic,%numeric, numeric-comp
        ]{cleanthesis}
        usepackage{enumitem}
        usepackage{placeins}
        %% Use the package `pdfpages' to include given pdf documents into your generated document
        usepackage{pdfpages}
        %% Use package `threeparttable' to pro­vides a scheme for ta­bles that have a struc­tured note sec­tion, af­ter the cap­tion.
        usepackage{threeparttable}
        %% Use package `pifont' for providing commands for pi fonts. See http://ctan.org/pkg/pifont
        usepackage{pifont}
        %% Use package `lscape' for placing selected parts of a document in landscape
        usepackage{lscape}
        newcommand{cmark}{ding{51}}%
        newcommand{xmark}{ding{55}}%
        %% Use package `changes' to show produced changes into your document
        usepackage[final]{changes}

        %usepackage{graphics}
        %% or use the graphicx package for more complicated commands:
        usepackage{graphicx}
        %% MATHEMATICAL PACKAGES
        usepackage{amssymb} %provides various useful mathematical symbols
        usepackage{amsthm} %provides extended theorem environments
        usepackage{amsfonts} %provides extended fonts
        usepackage{amsmath} %provides mathematical facilities
        usepackage{mathtools} %provides useful tools for mathematical typesetting
        DeclarePairedDelimiterfloor{lfloor}{rfloor}
        usepackage{bm} %Allows bold math font
        usepackage{gensymb} %Adds generics symbols
        %usepackage[nodots]{numcompress} % <=====================================
        usepackage{adjustbox}

        %% Clean style thesis does not number `subsubsection' by default. Add the following code so that they are numbered, and follow the same style as section and subsection:
        usepackage{titlesec}
        makeatletter
        setcounter{secnumdepth}{3}
        titlespacing{subsubsection}{0em}{0.5em}{-0.25baselineskip}%[0pt]
        ifct@cthesis@hangsubsection
        titleformat{subsubsection}[hang]%
        {usekomafont{subsubsection}}%
        {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
        {0pt}%
        {raggedright}%
        [phantomsection]
        else
        titleformat{subsubsection}[block]%
        {usekomafont{subsubsection}}%
        {color{ctcolorblack}thesubsubsectionhspace*{10pt}}%
        {0pt}%
        {raggedright}%
        [phantomsection]
        fi
        makeatother
        %Change also the spacing of the section, subsection, etc, by deleting the empty line left below with:
        titlespacing{section}{0pt}{0pt}{-0.25baselineskip}
        titlespacing{subsection}{0pt}{0pt}{-0.25baselineskip}
        %% By default, latex leaves a large space between the text and equations. Use the following to reduce it:
        makeatletter
        g@addto@macronormalsize{%
        setlengthabovedisplayskip{5pt}
        setlengthbelowdisplayskip{5pt}
        setlengthabovedisplayshortskip{5pt}
        setlengthbelowdisplayshortskip{5pt}
        }
        makeatother
        %% Use the package caption or subcaption to customize the caption in figures and tables:
        usepackage{caption}
        usepackage{subcaption}
        %usepackage[numbers, square, comma, sort&compress]{natbib} % <====== classicthesis
        %% Use the following commando to change how latex decides if a word is pushed to the next line earlier or not. It helps to avoid having words exceeding the page width
        setlength{emergencystretch}{2pt}
        %% Use the following commands to change the space between the text and figures
        setlength{intextsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space betwen figure and text for a figure placed at top or bottom of a page
        %setlength{textfloatsep}{10 pt plus 0pt minus 0pt}
        setlength{textfloatsep}{0.5baselineskip plus 0.0baselineskip minus 0.0baselineskip} %This changes the space between figure and text for a figure placed in any other place of the document.
        %
        % **************************************************
        % ToC, LoF, LoT
        % **************************************************
        %
        % -- modifications regarding the table of contents,
        % the list of figures and the list of tables

        % The tocloft package enables us to control the typographic design of the
        % table of contents, list of figures and list of tables
        usepackage{tocloft}
        %
        % > adjusts the indention for figure and table entries (lof and lot)
        % -- cftsetindents{entry}{indent}{numwidth} sets the entry's indent to
        % the length indent and its numwidth to the length numwidth
        cftsetindents{figure}{0em}{3em}
        cftsetindents{table}{0em}{3em}
        renewcommand{cfttoctitlefont}{normalfonthugebfseries} %To customizethe Contents title. In this case, to use the normal font and bold.
        renewcommand{cftpartfont}{normalfontsffamilybfseries}% part font in ToC
        renewcommand{cftchapfont}{normalfontlargebfseries} % chapter fontin ToC
        %renewcommand{cftsecfont}{normalfontslshape} % section fontin ToC
        %renewcommand{cftsubsecfont}{normalfontitshape} % subsectionfont in ToC
        %renewcommand{cftsubsubsecfont}{normalfontsmall} %subsubsection font in ToC
        renewcommand{cftloftitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.
        renewcommand{cftlottitlefont}{normalfonthugebfseries} %To customizethe List of Figures title. In this case, to use the normal font and bold.



        %% The cleveref package allows to compres multiple refenced equations:
        usepackage{cleveref}
        newcommand{crefrangeconjunction}{--} %Changes "to" by "-" when referencing multiple equations, i.e. (1) to (5) becomes (1)-(5).
        crefname{equation}{}{} %This option allows that only the equation numbers appear when using the package.

        %% The package hyperref is used to generate hyperreferences along the document. Setup it according to clean-thesis style:
        hypersetup{
        % pdftitle={ThesisTitle}, % - title (PDF meta) <================================
        % pdfsubject={thesisSubject},% - subject (PDF meta)
        % pdfauthor={thesisName}, % - author (PDF meta)
        plainpages=false, % -
        colorlinks=false, % - colorize links?
        pdfborder={0 0 0}, % - {0 0 0}
        breaklinks=true, % - allow line break inside links
        bookmarksnumbered=true, %
        bookmarksopen=true %
        }

        begin{filecontents}{jobname.bib}
        @misc{foo,
        author = {Foo},
        title = {Title of Foo},
        }
        @misc{bar,
        author = {Bar},
        title = {Title of Bar},
        }
        @misc{ba,
        author = {Ba},
        title = {Title of Ba},
        }
        end{filecontents}



        % **************************************************
        % Document CONTENT
        % **************************************************
        begin{document}

        listoffigures

        this is the text cite{foo} and it should be cited first cite{bar}

        begin{figure} [h]
        centering
        includegraphics[width=4cm]{example-image}
        caption{the caption in the text cite{bar}}
        label{X}
        end{figure}

        %bibliographystyle{elsarticle-num} % <=================================

        printbibliography%{jobname} % <=======================================

        % **************************************************
        end{document}


        with the result:



        page 1



        and



        bibliography







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        KurtKurt

        42.4k950167




        42.4k950167






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488282%2fnotoccite-not-working%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

            How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...