I have split my bibliography thematically in several reference segments at the end of my article. I would like to use \nocite locally inside some of the segment environments, but that seems not possible with \refsegment, it still acts globally. Here is an example:
\documentclass[10pt,a4paper,reqno]{amsart}
\usepackage[
backend=biber,
%heading = references,
citestyle=alphabetic,
bibstyle=alphabetic,
sorting=anyvt,
backref=true,
backrefstyle=none,
locallabelwidth=true
]{biblatex}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Ahl,
author = {Ahlfors, L. V.},
title = {Complex Analysis, An Introduction to the Theory of Analytic Functions of One Complex Variable},
edition = {3},
publisher = {McGraw-Hill},
year = {1979},
keywords = {complex analysis}
}
@Book{BerGay,
author = {Berenstein, C. A. and Gay, R.},
title = {Complex Variables, An Introduction},
publisher = {Springer},
year = {1991},
keywords = {complex analysis}
}
@Book{AM,
author = {Atiyah, M. F. and MacDonald, I. G.},
title = {Introduction to Commutative Algebra},
publisher = {Addison-Wesley},
year = {1969},
keywords = {Algebra}
}
@Book{HoffKun,
author = {Hoffman, K. and Kunze, R.},
title = {Linear Algebra},
publisher = {Prentice-Hall},
edition = {2},
year = {1971},
keywords = {Algebra}
}
@Book{GrRem,
author = {Grauert, H. and Remmert, R.},
title = {Coherent Analytic Sheaves},
publisher = {Springer},
year = {1984}
}
@Book{Loday,
author = {Loday, J.-L.},
title = {Cyclic Homology},
publisher = {Springer},
year = {1998},
edition = {2}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Ahl}, \cite{AM}, \cite{GrRem} are great books.
\begin{refsegment}
\nocite{*}
\printbibliography[keyword={complex analysis},title={References on Complex Analysis}]
\end{refsegment}
\begin{refsegment}
\printbibliography[keyword={Algebra},title={References on Algebra}]
\end{refsegment}
\printbibliography[notkeyword={complex analysis},notkeyword={Algebra},title={Other References}]
\end{document}
I know that \nocite behaves locally with \refsection, but I don't want to split my .bib file in various different .bib files, and moreover, the biblatex manual says that \refsegment is the intended environment for my case :-) Indeed \refsection behaves a little funky when I use the same .bib file for different reference sections.
An ugly workaround would be to group together all \nocite reference segments after the no-\nocite reference segments, but this breaks the logical order of the topics.
Does anyone know a solution for this?

refsegments basically just add a marker (much like a keyword) to an entry and otherwise don't change anything it is sort of expected that\nocite{*}would add all entries. In fact I have a hard time figuring out how a local\nocite{*}should work, but I might be missing something (are you using\nocitewith an argument different from*, i.e. a\nocite{sigfridsson}?). A short example document (https://tex.meta.stackexchange.com/q/228/3586 or https://tex.meta.stackexchange.com/q/4407/35864) might help me understand what is going on in more detail. – moewe Dec 01 '18 at 11:34\nocite{*}in basicamsartorreport, see my edit. Do you still need me to include a full MWE? – M.G. Dec 01 '18 at 11:51\cite{sigfridsson}should behave exactly the same as a\nocite{*}. – moewe Dec 01 '18 at 11:53\nocited entry show up in the bibliography of another refsegment? (And it does https://gist.github.com/gusbrs/ba5686c28efc631343c9a128061c9707). – gusbrs Dec 01 '18 at 11:57segment=\therefsegment, but I don't know whether that is really what they want or need and I don't understand why the question only asks about\nocitewhen a normal\citehas the same effect. (Of course that could be explained if the OP simply does not use\cite...) – moewe Dec 01 '18 at 12:10segment=\therefsegmentwas the missing piece here. Thanks. That likely is also the solution for the OP, but indeed, more info is needed to know for sure. – gusbrs Dec 01 '18 at 12:14.bibfile should not be\references.bib). I also removed the title of the paper, because it is not important. I also changedalgebratoAlgebra, so the second bibliography would print something. Please always test your MWEs in a new, empty directory before you send them off. What output would you want from your MWE? What should be different? For me the MWE already looks quite sensible: No entry appears twice, everything is sorted as expected ... – moewe Dec 01 '18 at 12:26\printbibliographystates forsegmentthedefault: 0which is supposed to mean "outside a refsegment environment" and not quite "not acted upon". – gusbrs Dec 01 '18 at 12:28\nociteacts globally spreading outside of the firstrefsegment. So how do I fix that? – M.G. Dec 01 '18 at 12:32refsegmentis useful when we need a global bibliography alongside separated ones. The optionsegmentinprintbibliographyis an integer.0may really be the default, but if so it is somehow hardwired to mean "all refsegments", because that's what we need for a global bibliography. Implicitly, to get the global bibliography,segmenthas to be ommited. If an optionsegment=allexisted, the default could be, more naturally,segment=\therefsegment. I'm guessing here... But, ok, more on github, if need be. – gusbrs Dec 01 '18 at 12:50segment=0, instead the default is nothing at all. Similar to, say, filtering bytype=orcategory=. I have changed the docs (I'm currently in the process of tweaking the docs on a larger scale, so this change might be committed a little later with the other changes I have lined up). – moewe Dec 01 '18 at 14:17