Stellar mass-metallicity relation throughout the large-scale structure of the Universe: CAVITY mother sample

,


Introduction
The distribution of galaxies in the Universe forms a web-like structure with over-dense clusters, elongated filaments, sheetlike walls, and under-dense voids.This structure is detected by high-redshift galaxy surveys such as the Sloan Digital Sky Survey (SDSS, York et al. 2000), the 2dF Galaxy Redshift Survey (2dFGRS, Colless et al. 2001), or the 2MASS Redshift Survey (2MRS, Huchra et al. 2012).Voids occupy large volumes (from 10 to 30 h −1 Mpc in diameter) with a low number density of galaxies (density contrast δ = δρ/ρ −0.8, where ρ is the average density of the Universe, Peebles 2001;Kreckel et al. 2011Kreckel et al. , 2012;;Pan et al. 2012;Varela et al. 2012;van de Weygaert 2016).Galaxies in voids are less affected by an intense gravitational potential and local processes than galaxies in filaments, walls, and clusters.These local processes include mergers or tidal interactions with other galaxies, as well as hydro-dynamical interactions between the intracluster medium (ICM) and the interstellar medium (ISM), such as ram-pressure stripping (Boselli & Gavazzi 2006).This makes voids a good probe to study the importance of internal processes in galaxy evolution.
Previous studies have shown that galaxies in voids are bluer, less massive, have later morphological types, and higher specific star formation rates (SFR) on average than galaxies in denser environments (Rojas et al. 2004;Park et al. 2007;Hoyle et al. 2012;Kreckel et al. 2012;Florez et al. 2021).However, there is no consensus about SFR differences for a given stellar mass, luminosity, or morphology.Some studies have found that void galaxies have an enhanced SFR for a given stellar mass (Rojas et al. 2005;Beygu et al. 2016;Florez et al. 2021), but others did not find any significant difference (Patiri et al. 2006;Kreckel et al. 2012;Ricciardelli et al. 2014;Domínguez-Gómez et al. 2022).Additionally, Porter et al. (2023) have recently found that at low redshifts (z < 0.075), the fraction of late-type galaxies is higher in voids than in the field, but these differences are not conclusive at higher redshifts (0.075 < z < 0.150).
In our recent work (Domínguez-Gómez et al. 2023), we have compared the SFHs (as derived from a full-spectral fitting of the central parts) between galaxies located in different large-scale environments, and we found that galaxies in voids assemble their stellar mass more slowly than galaxies in filaments, walls, and clusters.Several physical processes might cause these differences: the different gasaccretion modes that dominate in each large-scale environment (Kereš et al. 2005), the lack of atomic hydrogen that might be present in void galaxies (Kreckel et al. 2012;Domínguez-Gómez et al. 2022;Rosas-Guevara et al. 2022), their higher halo-to-stellar mass ratio (Artale et al. 2018;Alfaro et al. 2020;Habouzit et al. 2020;Rosas-Guevara et al. 2022), their higher fraction of active galactic nuclei (AGNs, Mishra et al. 2021;Ceccarelli et al. 2022), their higher fraction of massive black holes (BHs, Constantin et al. 2008), and their lower local density (Kuutma et al. 2020).
There are numerous studies about the gas-phase massmetallicity relation (MZ g R) that only considered star-forming galaxies, but only a few studies focused on the stellar massmetallicity relation (MZ R) and also considered quenched galaxies.The gas metallicity is largely affected by the current star formation (Salim et al. 2014;Duarte Puertas et al. 2022), but the stellar metallicity traces the accumulated fossil record of the galaxy's star formation through its entire life.The comparison of the MZ R between galaxies in voids, filaments, walls, and clusters will help us to better understand how the large-scale environment affects the galaxy evolution.
Some studies have compared the MZ g R between different large-scale environments, but there is no consensus about the metallicity properties in void galaxies.Pustilnik et al. (2011) found that the gas metallicity of dwarf void galaxies (absolute B-band magnitude, −18.4 < M B < −11.9) is lower by about 30% than in galaxies in denser large-scale environments, but Kreckel et al. (2015) did not find any significant difference between dwarf galaxies in different large-scale environments.Wegner & Grogin (2008) found tentatively lower gasphase metallicities in early-type void galaxies, but Wegner et al. (2019) did not find any significant gas-phase metallicity difference between star-forming galaxies in voids and galaxies in denser large-scale environments.However, the robustness of these results is hampered by the low number of galaxies (20, 8, 26, and 33, respectively), which does not allow strong conclusions.Additionally, Panter et al. (2008) have shown that the gas-phase metallicity of cluster galaxies increases with their environmental density.
Other studies have analysed the effect of the local environment on the gas-phase chemical abundance of galaxies.Pasquali et al. (2012) found that satellite galaxies have higher gas-phase metallicities than central galaxies with the same stellar mass, which is more significant at low than at high stellar masses, and the maximum differences lie (by ∼0.06 dex) at M ∼ 10 8.25 M .Additionally, at a fixed stellar mass, the gas-phase metallicity of satellite galaxies increases with the halo mass (M h ) of the group, also more significantly for low-mass galaxies, and the maximum differences lie (by ∼0.15 dex) at M ∼ 10 9 M inside the range 10 11 < M h /M < 10 14 .Deng (2011) found that star-forming galaxies with high (−22.5 ≤ M r ≤ −20.5) and low luminosities (−20.5 ≤ M r ≤ −18.5) have higher oxygen abundances in regions with higher local densities.Pilyugin et al. (2017) found that late-type galaxies with higher local densities have higher oxygen (by ∼0.05 dex) and nitrogen (by ∼0.1 dex) abundances.This effect is more significant for low-mass than for high-mass galaxies.They derived the local density as the number of neighbours inside five different projected distances, R 0 = 1, 2, 3, 4, and 5 Mpc, but they did not compare galaxies in different large-scale structures such as voids, filaments, walls, and clusters.They also found that regions with the highest local (R 0 = 1 Mpc) densities are not necessarily associated with the highest large-scale (R 0 = 5 Mpc) densities, which supports the hypothesis that high local densities are also found in voids.This confirms that local and large-scale environments are not the same, and further comparisons are needed between galaxies in voids, filaments, walls, and clusters.
A few studies have analysed how the stellar metallicity of galaxies is affected by their local environment, but little is known about the effect of the large-scale environment.Gallazzi et al. (2021) found that the stellar metallicity of cluster galaxies increases with halo mass, but they did not compare their results with void galaxies.Pasquali et al. (2010) found that satellite galaxies have higher stellar metallicities than central galaxies with the same stellar mass.Additionally, the MZ R is shallower in systems with more massive haloes because the stellar metallicity of low-mass satellite galaxies increases with the halo mass of the system.These findings prove that the local environment of the galaxies affects the chemical evolution of their stars, but the effect of their large-scale environment remains unknown.
In this paper, we compare for the first time the MZ R between thousands of galaxies in voids, filaments, walls, and clusters.This study is linked to the Calar Alto void integral-field treasury survey (CAVITY1 ) project, which is an integral-field unit (IFU) legacy survey for void galaxies.It aims to observe around 300 galaxies with the PMAS-PPAK IFU of the Centro Astronómico Hispano en Andalucía (CAHA) together with ancillary deep-imaging, HI, and CO data (Pérez et al., in prep.) to study the spatially resolved stellar populations, gas properties, and kinematics of void galaxies.As a complementary and preparatory study of this project, we derive here the average stellar metallicity of the void galaxy mother sample of CAVITY, and compare our results with galaxies in filaments, walls, and clusters.We apply non-parametric full spectral fitting techniques to the integrated optical spectra in the centre of the galaxies, which are already available in the SDSS, to obtain the stellar populations and metallicities.
This paper is organised in six sections and five appendices.In Sect. 2 we present the void galaxies and control samples of the study.In Sect. 3 we describe the analysis we used to obtain the stellar metallicities.In Sect. 4 we compare the MZ R between galaxies in different large-scale environments for different SFH types, morphologies, and colours.In Sect. 5 we discuss our results and compare them with those of previous studies.In Sect.6 we summarise our conclusions.In Appendix A we extend our study to galaxy samples with the same stellar mass distribution.In Appendix B we determine whether our results remain valid for volume-limited sub-samples with redshifts between 0.01 and 0.03.In Appendix C we analyse whether there is any sample selection effect due to our cut in signal-to-noise ratio (S/N).In Appendix D we show similar results for the luminosityweighted metallicities.In Appendix E we present the tables with our MZ R results.

Sample
We used the samples of galaxies defined in our previous work (Domínguez-Gómez et al. 2023), which were extracted from the spectroscopic catalogue of the SDSS-DR7 with redshifts 0.01 < z < 0.05.We selected the mother sample of the CAVITY project as the mother sample of void galaxies in our study, with 2529 galaxies (see Sect. 2.1).Our mother control sample is made of 6189 galaxies in clusters from Tempel et al. (2017), and 15 000 galaxies in filaments and walls as they belong neither to voids nor to clusters (see Sect. 2.2).We consider that filaments and walls belong to the same large-scale environment (filaments & walls here after) as the number density of galaxies is very similar.After applying the spectral analysis (see Sect. 3) to these galaxies, we carried out a quality control (see Sect. 3.1) and removed galaxies with low-quality spectra (S/N < 20) from the mother samples, leaving us with 987 galaxies in voids, 6463 in filaments & walls, and 3357 in clusters.Additionally, in Appendix A, we define three sub-samples with the same total stellar mass distribution as our sample of void galaxies by applying the Kolmogorov-Smirnov test (KS-test).The total stellar masses of the galaxies were obtained from the database of the Max-Planck-Institut für Astrophysik and the Johns Hopkins University (MPA-JHU, Kauffmann et al. 2003;Salim et al. 2007).All these samples are magnitude limited by the SDSS completeness limit at r-Petrosian <17.77 mag (Strauss et al. 2002;Argudo-Fernández et al. 2015).

Calar Alto void integral-field treasury survey
The mother sample of the CAVITY comprises 2529 galaxies, which form a sub-sample of the Pan et al. (2012) catalogue of SDSS void galaxies.Pan et al. (2012) applied the VoidFinder algorithm (El-Ad & Piran 1997;Hoyle & Vogeley 2002) to the distribution of SDSS galaxies with redshifts z < 0.107, and found 79 947 void galaxies inside 1055 cosmic voids with a typical density contrast δ = −0.94± 0.03 and radii larger than 10 h −1 Mpc.The CAVITY Collaboration (Pérez et al., in prep.)reduced the redshift range (0.01 < z < 0.05) to concentrate on nearby galaxies that are observable with PMAS-PPAK.They chose 15 voids with more than 20 galaxies each to observe around 300 galaxies that are distributed along the entire right ascension range of the SDSS.They finally selected galaxies in the inner region of the voids (i.e.inside 80% of the effective radius of the void) to avoid the possible inclusion of galaxies that inhabit or are affected by denser environments.Additionally, the CAVITY collaboration carried out a visual inspection of the galaxies, and removed duplicated objects from the sample and the spectra integrated in HII regions, not in the centre of the galaxy.

Control samples
The aim of this study is to compare the stellar metallicities between galaxies in voids and galaxies in denser environments.To do this, we defined two control samples: one sample of galaxies in clusters, and the other sample of galaxies in filaments & walls.The mother sample of galaxies in clusters was extracted from the Tempel et al. (2017) catalogue of groups of SDSS galaxies within the same redshift range as the CAVITY mother sample.Galaxies in groups with ≥30 members were selected as cluster galaxies (Abell et al. 1989, see Appendix B for some discussions on how this criterium might affect our results).With these selection criteria, our mother sample of cluster galaxies contains 6189 galaxies.
The mother sample of galaxies in filaments & walls in this study was extracted from all the SDSS galaxies within the same redshift range as the mother sample of CAVITY that are neither in the complete catalogue of void galaxies of Pan et al. (2012) nor in the mother sample of cluster galaxies defined above.To save computational time, we selected a sub-sample of 15 000 galaxies in filaments & walls, preserving similar stellar mass, g−r colour, and redshift distributions (two-sample KS-test with p-values > 0.95) as the original sample of galaxies in filaments & walls directly extracted from SDSS.

Data analysis
In Domínguez-Gómez et al. (2023), we carried out a nonparametric full spectral fitting analysis to derive the stellar populations and compare the SFHs of galaxies in voids, filaments & walls, and clusters.Now, we compare the stellar metallicities of these three galaxy samples (see Sect. 2) using the same stellar populations.This spectral analysis recovers the stellar line-ofsight velocity distribution (LOSVD) and gas emission lines, and it generates a combination of stellar population models that best fit the observed spectra of the galaxies in a wavelength range from 3750 to 5450 Å, in which the most relevant absorption lines of the stars are located.From this combination of models, we can estimate the mass, age, and metallicity of the stars within the galaxies.
For the analysed data, we used optical spectra from the SDSS-DR7 (Abazajian et al. 2009) integrated (fibre aperture with a diameter of 3 arcsec) in the very centre of the galaxies (from 0.3 to 1.6 kpc in the redshift range of 0.01 < z < 0.05) observed at the Apache Point Observatory (APO) 2.5 m telescope.We used the stellar models of the extended medium resolution INT library of empirical spectra (E-MILES, Sánchez-Blázquez et al. 2006;Falcón-Barroso et al. 2011;Vazdekis et al. 2015Vazdekis et al. , 2016)), which are single-age and single-metallicity stellar population (SSP) spectral templates generated assuming the BaSTI isochrones (Pietrinferni et al. 2004) and Kroupa universal initial mass function (IMF, Kroupa 2001).With the penalized pixel-fitting (pPXF, Cappellari & Emsellem 2004;Cappellari 2017Cappellari , 2023) ) algorithm, we generated a combination of stellar population models (E-MILES SSPs) and pure Gaussian emission line templates that best fit the observed spectra of the galaxies, recovering the stellar LOSVD and gas emission.The gas emission obtained by pPXF was subtracted from the observed spectrum of the galaxy to obtain a clean spectrum with only the emission from the stars.
A111, page 3 of 40 Domínguez-Gómez, J., et al.: A&A 680, A111 (2023) Afterwards, we applied the stellar content and kinematics from high-resolution galactic spectra via maximum a posteriori algorithm (STECKMAP, Ocvirk et al. 2006b,a) to recover the stellar populations (stellar mass, age, and metallicity) of a galaxy by fitting a combination of E-MILES SSPs (as for pPXF) to the clean spectrum of the galaxy (only emission from the stars), assuming a fixed stellar LOSVD (previously derived with pPXF).We estimated the errors of the stellar populations (stellar mass, age, and metallicity) as the standard deviation of five Monte Carlo iterations from STECKMAP.For each Monte Carlo solution, we used as input the observed spectrum plus a spectrum of noise with the same standard deviation in the continuum.With this method, we analysed different spectra with the same signal and the same level of noise, but a different distribution the noise.
The recovered stellar populations are affected by the agemetallicity degeneracy of the stars (Worthey 1994), and young metal-poor galaxies might have been classified as old metal-rich stars.This effect arises because old stars with low metallicities have similar spectra as young stars with high metallicities.Sánchez-Blázquez et al. (2011) analysed the effect of the agemetallicity degeneracy for STECKMAP using synthetic spectra for ages 1 and 10 Gyr and solar metallicity (0 dex), and compared them with other spectral index techniques.Their Fig. 7 shows that the age-metallicity degeneracy effect is much more reduced in the case of STECKMAP (ages of ∼1.00±0.04Gy and ∼11 ± 1 Gy, respectively, and metallicities of ∼0.02 ± 0.04 dex) than in the case of spectral indices (ages of ∼1.0 ± 0.1 Gy and ∼10 ± 5 Gy, respectively, and metallicities of ∼−0.1 ± 0.2 dex).
The stellar and gas migration may influence the central metallicities, especially if and when there is a bar in a galaxy.Previous studies found that the gas-phase metallicity (Ellison et al. 2011) and stellar metallicities (Pérez & Sánchez-Blázquez 2011) in the centre of barred galaxies are higher than those of unbarred galaxies, but Cacho et al. (2014) did not find significant difference in metallicity (neither gaseous nor stellar) between barred and unbarred galaxies.Nevertheless, there is no evidence whether the fraction of barred galaxies is different in voids compared to denser environments.

Quality control
The quality of the outcome of spectral fitting techniques is affected by the S/N in the continuum (6000−6100 Å, rest frame) and the intensity of the emission lines, among others.A good indicator of the quality of the spectral fit is the residual spectrum, which is the difference between the observed and fitted spectrum.If the residuals are high, the observed spectrum is noisy, or the fitted spectrum is not a perfect match to the observed one.We removed a fraction of galaxies (61% in voids, 57% in filaments & walls, and 46% in clusters) with S/N < 20 from our sample2 for which the residuals are higher than 2% of the continuum level around Hβ.This selection by S/N removes mainly lowmass galaxies, but we do not expect that it introduces any bias in our sample because the mean stellar mass of the removed galaxies is similar in the three environments (10 9.2±0.1 M in voids, 10 9.3±0.1 M in filaments & walls, and 10 9.5±0.1 M in clusters).However, even after this cut, the stellar mass distribution of the three samples is different.To avoid any effect of the difference stellar mass distributions in our results, we compare in Sect. 4 the stellar metallicities for stellar mass bins of 0.5 dex width.However, the distributions may be still slightly different within each stellar mass bin.To verify that this does not introduce any effect in our analysis for a given stellar mass, we therefore define in Appendix A three sub-samples with the same stellar mass distribution within each stellar mass bin by applying the KS-test, and we analyse the stellar metallicities of these sub-samples.In addition, we also compare in Appendix A the stellar metallicities for narrower stellar mass bins of 0.25 dex width.We find similar results to those derived from the entire sample and bins of 0.5 dex width.
Some galaxies have a high S/N (>20) spectrum and residuals lower than 2% of the continuum level, but higher than the level of noise.This is due to a poor fit of the gas-emission lines.The pPXF algorithm is not efficient in fitting wide or asymmetric emission lines and may leave wavy features in the clean spectrum that consequently affect the STECKMAP fit and lead to incorrect stellar populations.We remov small fractions of galaxies (5% in voids, 8% in filaments & walls, and 7% in clusters) with a high S/N (>20) spectrum and residuals twice higher than the level of noise over Hβ after subtracting the emission lines from our samples.After a careful visual inspection, we confirm that these galaxies have intense, wide, and asymmetric emission lines that pPXF is not able to fit properly.These small percentages of removed galaxies do not introduce any bias in our analysis.
The optical spectra from SDSS are integrated over the central region of the galaxies.This might introduce a bias for galaxy samples with a wide redshift range, where this aperture would cover a large fraction of remote galaxies, but only the inner part of nearby ones.However, the redshift range of our samples is rather narrow (0.01−0.05), and their apparent size (r-Petrosian radius, R 90r , from SDSS) distributions is very similar for the three environments (see Domínguez-Gómez et al. 2023, and Extended Data Fig. 6 therein).In order to minimise a possible size effect in our study, we removed a small fraction (1% in voids, 4% in filaments & walls, and 5% in clusters) of galaxies from our samples with R 90r > 20 arcsec, for which the spectrum would be relatively more influenced by the fibre aperture.After this quality control, we are left with 987 galaxies in voids, 6463 in filaments & walls, and 3357 in clusters.These are the samples we study in this work.

Averaged stellar metallicity
The stellar populations recovered by STECKMAP are characterised by their stellar mass, stellar age, and the metallicity of the gas from which the stars were formed, providing an estimate of the type of stars that currently form a galaxy.In the E-MILES models, the metallicity is defined as the fraction of metals (Z) normalised to the solar value (Z = 0.0198) as [M/H] = log 10 (Z/Z ).We can then derive the mass-weighted average stellar metallicity of the galaxy as where M and [M/H] are the mass and metallicity of the stellar populations that form the galaxy, respectively, which are obtained through spectral fit.The BaSTI theoretical isochrones that are used by the E-MILES models cover the metallicity range −2.27 ≤ [M/H] ≤ 0.4.We find that the stellar metallicity values of some galaxies saturate at the upper boundary of the stellar models.The central parts of the galaxies can be metal rich, 0.30 < [M/H] M < 0.47 (González Delgado et al. 2015, see Appendix B therein), with values higher than the stellar models, leading to a saturation effect.We derived the stellar metallicities of the centre (3 arcsec diameter) of nearby galaxies (0.01 < z < 0.05) using the integrated spectrum in the innermost regions of the galaxies (aperture from 0.3 to 1.6 kpc).For some galaxies, the stars in these inner regions are very metal rich, and the average stellar metallicity of the galaxy reaches the limit of the stellar models.This effect was also found by Gallazzi et al. (2005, see Fig. 8 therein).However, they obtained average metallicities that are lower than ours because they analysed a sample of galaxies with a wider redshift range (0.005 < z < 0.22), and the SDSS spectra that they used were integrated over more external regions of the galaxies, where the stars are more metal poor than in the centre.In our results, the fraction of galaxies with this saturation issue in each stellar mass bin, SFH type, and environment is lower than 10%, except for filament & wall and cluster galaxies with short-timescale SFHs (see Sect. 3.3) at high stellar masses (M > 10 10.5 M ), for which the fraction of saturated galaxies is about 20%.There is no saturation for void galaxies.The saturation effect is conservative because it reduces the average stellar metallicity of filament & wall and cluster massive galaxies, but does not affect void galaxies.This dilutes the stellar metallicity differences that we find at high stellar masses (see Sect. 4).

Star formation histories
The metallicity of a galaxy is strongly influenced by its SFH (Tantalo & Chiosi 2002).A high SFR quickly enriches the ISM and the stars that will form from it.Therefore, the effect of the SFH has to be considered in our analysis of the stellar metallicities.We derived and discussed the SFHs in our previous work (Domínguez-Gómez et al. 2023) as the fraction of stellar mass that was formed at a given look-back time, which was based on the same spectral analysis.We found that the SFHs at early times describe a bimodal distribution in the three large-scale environments (see Domínguez-Gómez et al. 2023, and Fig. 2 therein for more details), which allowed us to classify the SFHs into two types: short-timescale SFH (ST-SFH) galaxies formed a large fraction of their stellar mass (27% on average) ∼12.5 Gyr ago and progressively reduced their star formation since then, while long-timescale SFH (LT-SFH) galaxies formed a lower fraction of their stellar mass (<21.4%)than the ST-SFH galaxies 12.5 Gyr ago, but formed stars more uniformly over time (see examples in Fig. 1).By definition, ST-SFH galaxies formed their stellar mass earlier than LT-SFH galaxies.Therefore, this classification needs to be taken into account when the SFHs between galaxies in different environments are compared.
It is more likely for galaxies in voids to have an LT-SFH (51.7±0.9%)than for galaxies in filaments & walls (44.5±0.3%) and clusters (36.1 ± 0.5%).For a given SFH type, galaxies in voids formed their stars more slowly on average than in filaments & walls at intermediate stellar masses, and much more slowly than in clusters at any given stellar mass.The SFH differences between galaxies in the three large-scale environments might have affected the stellar metallicities diversely in voids, filaments & walls, and clusters.Therefore, we analyse the effect of the large-scale environment on the stellar metallicities of the galaxies for different SFH types.

Morphology and colour
It might be intuitive to associate the ST-SFH type with red elliptical galaxies and the LT-SFH type with blue spiral galaxies.However, the SFH type of a galaxy clearly correlates neither with its colour nor its morphology (see Domínguez-Gómez et al. 2023, and Extended Data Fig. 7 therein for more details).We therefore also analysed the MZ R for different morphologies and colours.We used the g and r dereddened magnitudes from SDSS to define the colour of the galaxies as g − r, and the T-type parameter from Domínguez Sánchez et al. ( 2018) to characterise the morphology of the SDSS galaxies.We considered that galaxies with T-type < 0 are elliptical and galaxies with T-type > 0 are spiral (Domínguez Sánchez et al. 2018), and we define galaxies with g − r ≤ 0.7 mag as blue and g − r > 0.7 mag as red.The SDSS g and r magnitudes are integrated over the entire galaxy, but the stellar populations are recovered from the very centre of the galaxy, where the stars are redder than the average colour g − r of the entire galaxy.

Distribution of the average stellar metallicity
We show in Fig. 2 the normalised distribution of [M/H] M for galaxies in voids (dashed blue line), filaments & walls (dotdashed green line), and clusters (solid red line) in three total stellar mass bins.The small peaks at [M/H] M ∼ 0.4, are produced by the saturation of our results at the upper metallicity limit of the E-MILES SSPs.The distributions exhibit a sharp cut-off at higher values (around 0.5) due to the broadening effect caused by the errors.We find that the stellar metallicity distribution is similar for galaxies in voids and galaxies in filaments & walls.However, cluster galaxies are distributed at much higher metallicities.These differences might be affected by their different stellar mass distributions and SFH types.Void galaxies are less massive on average and form their stars more slowly than galaxies in denser environments (Domínguez-Gómez et al. 2023).We then compared different stellar mass bins, SFH types, morphologies, and colours.

Stellar mass effect
We show in Fig. 3 (left column) the MZ R for all the galaxies regardless of their SFH type in voids (first row), filaments & walls (second row), and clusters (third row).We defined total A111, page 5 of 40 Fig. 2. Mass-weighted average stellar metallicity ([M/H] M ) distribution of our samples of galaxies in voids (dashed blue line), filaments & walls (dot-dashed green line), and clusters (solid red line) for three stellar mass bins as labelled.The number of galaxies in each sample is shown in the legend.The peaks at ∼0.4 are due to the metallicity limit of the E-MILES stellar models.The distribution sharply ends at higher values (∼0.5) than the limit due to the widening by the errors.stellar mass bins of 0.5 dex from 10 8.0 to 10 11.5 M , and obtaine the MZ R (thick lines) as the 50th percentile of the distribution of galaxies inside each stellar mass bin.We estimated the error of the MZ R (shaded areas) as the standard error of the mean (s.e.m.) inside each stellar mass bin.Additionally, we calculated the 16th and the 84th percentiles (thin lines) to visualise the dispersion of the values.We compare the MZ R between the three environments in the fourth row, together with the MZ R from Gallazzi et al. (2005) as a reference.In the fifth row, we show the MZ R differences between galaxies in voids and filaments & walls, and also between galaxies in voids and clusters.
In Table E.1 we report the 50th (together with the s.e.m.), 16th, and the 84th percentiles of the MZ R for the different large-scale environments and SFH types.We report in Table E.2 the differences of the 50th percentile between voids and filaments & walls, and also between voids and clusters.
In the left column panels of Fig. 3, galaxies in voids have slightly lower stellar metallicities on average than galaxies in filaments & walls, and they are much lower than galaxies in clusters for any given stellar mass, regardless of their SFH type.These differences are more significant at low stellar masses than at high stellar masses, at which the difference might have been diluted by the effect of the metallicity saturation (see Sect. 3.2).The stellar metallicity in void galaxies is slightly lower than in filaments & and walls by 0.108 ± 0.019 (5.7σ) at low stellar masses (∼10 9.25 M ) to 0.031 ± 0.009 (3.4σ) at intermediate stellar masses (∼10 10.25 M ).Void galaxies have lower stellar metallicities than cluster galaxies by 0.40 ± 0.02 (20.0σ) at low stellar masses (∼10 9.25 M ) to 0.084 ± 0.013 (6.5σ) at high stellar masses (∼10 10.75 M ).Our results at very low (∼10 8.25 M ) or very high (∼10 11.25 M ) stellar masses are not statistically significant due to the low number of galaxies in voids (4) and clusters (2).In our conclusions, we only consider stellar mass bins with more than ten galaxies.
The MZ R derived by Gallazzi et al. (2005) is in general below what we obtain.They derived the stellar metallicity from the SDSS-DR2 spectra in the centre (3 arcesc aperture) of 175 128 galaxies.They used the same type of spectral data as we do in this paper.However, the redshift range of their galaxy sample (0.005 < z < 0.22) is much wider than ours (0.01 < z < 0.05).The apparent size of their galaxies is smaller than ours on average.Therefore, the spectrum of their galaxies is integrated over more external regions, where the stellar populations are younger and metal poorer.The spectra of our galaxies are integrated in smaller regions from the centre, where the stars are older and metal richer.At low stellar masses (<10 9.5 M ), our MZ R is similar to theirs.This might be due to the completeness limit of the sample because the number of low-mass galaxies decreases with redshift.Therefore, the low-mass galaxies in their sample might be at similar redshifts as low-mass galaxies in our samples, and the aperture effect explained above is negligible.

Effect of the star formation history
In Fig. 3 (centre and right columns panels) we show how the SFH type (ST-SFH and LT-SFH, respectively) of the galaxies affects the MZ R and compare galaxies in voids, filaments & walls, and clusters.We find that ST-SFH galaxies have higher stellar metallicities than LT-SFH galaxies for a given stellar mass in the three environments.Together with the fact that it is more likely for galaxies in voids to have an LT-SFH (51.7 ± 0.9%) than for galaxies in filaments & walls (44.5 ± 0.3%) and cluster (36.1 ± 0.5%), this can explain that void galaxies have slightly lower metallicities on average than galaxies in filaments & walls, and they are much lower than galaxies in clusters when we compare all the galaxies regardless of their SFH type in Fig. 3 (left column panels).
We now analyse the stellar metallicity differences for two different SFH types.Galaxies with ST-SFHs have similar stellar metallicities (within the errors) in voids and filaments & walls, except for intermediate stellar masses (∼10 10.25 M ), where void galaxies have slightly lower stellar metallicities by 0.035 ± 0.011 (3.2σ).Galaxies with ST-SFHs in voids have lower stellar metallicities than galaxies in clusters by 0.152 ± 0.011 (13.8σ) at M ∼ 10 10.25 M or by 0.063 ± 0.017 (3.7σ) at M ∼ 10 9.75 M .Galaxies with LT-SFHs have similar stellar metallicities (within the errors) in voids and filaments & walls, except for low stellar masses (∼10 9.25 M ), where void galaxies have slightly lower stellar metallicities by 0.104 ± 0.021 (5.0σ).Galaxies with LT-SFHs in voids have lower stellar metallicities than in clusters.These differences are more significant at low stellar masses (∼10 9.25 M ), by 0.419 ± 0.024 (17.5σ) than at high stellar masses (∼10 10.75 M ), by 0.11±0.03(3.7σ).The differences that we find for galaxies with LT-SFHs are similar to what we find for all the galaxies regardless of their SFH type in Fig. 3 (left column panels).However, the differences that we find for galaxies with ST-SFHs are less significant.This means that the stellar metallicity differences that we find between galaxies in different environments, regardless of their SFH type, are mainly due to the A111, page 6 of 40 galaxies with LT-SFHs, while the contribution of galaxies with ST-SFH is not significant.

Morphology effect
In Fig. 4 (left and right columns panels) we analyse the MZ R for different morphological types (elliptical and spiral, respectively) and compare galaxies in voids, filaments & walls, and clusters.Additionally, we report in Tables E.3 and E.4 the percentiles (50th with the standard error of the mean (s.e.m.), 16th, and 84th) of the MZ R, and the 50th percentile differences between galaxies located in the three large-scale environments.We find that elliptical galaxies have higher stellar metallicities than spiral galaxies in all environments and at all stellar masses.However, galaxies have similar stellar metallicities (within the errors) in voids and filaments & walls for the two morphological types and for any given stellar mass, except for intermediate stellar masses (∼10 9.75 M ), where void galaxies have slightly lower stellar metallicities by 0.057 ± 0.017 (3.4σ) for elliptical galaxies and 0.071 ± 0.016 (4.4σ) for spiral galaxies.Void galaxies have lower stellar metallicities than cluster galaxies in the two morphological types.These differences are more significant at low stellar masses (∼10 9.25 M ), by 0.26 ± 0.04 (6.5σ) for elliptical galaxies and 0.27 ± 0.03 (9.0σ) for spiral galaxies than at high stellar masses (∼10 10.25 M ), by 0.075 ± 0.012 (6.2σ) for elliptical galaxies and 0.077 ± 0.017 (4.5σ) for spiral galaxies.
The differences that we find for elliptical galaxies, and also for spiral galaxies are similar to what we find for galaxies with LT-SFHs in Fig. 3 (right column panels).This occurs more clearly for spiral than for elliptical galaxies.The differences in stellar metallicity between the three environments for spiral galaxies are similar to what we find for LT-SFHs due to the fraction of spiral galaxies with LT-SFHs (62.7% in voids, 56.5% in filaments & walls, and 52.6% in clusters; see Domínguez-Gómez et al. 2023, and Extended Data Fig. 7 therein).A similar effect is visible for elliptical galaxies, which also have similar differences in stellar metallicity between environments as LT-SFH galaxies, but are much more diluted by the higher fraction of elliptical galaxies with ST-SFHs (56.8% in voids, 65.8% in filaments & walls, and 70.9% in clusters).

Colour effect
In Fig. 5 we analyse the relation between colour and the MZ R, and compare galaxies in voids, filaments & walls, and clusters.The differences between environments are reported in Tables E.5 and E.6.We find that red galaxies (left column panels) have higher stellar metallicities than blue galaxies (right column panels) for a given stellar mass.However, galaxies have similar stellar metallicities (within the errors) in voids and filaments & walls for the two colours and for any given stellar mass, except for low stellar masses (∼10 9.25 M ), where blue galaxies in voids have slightly lower stellar metallicities than in filaments & walls by 0.091 ± 0.020 (4.5σ).Red galaxies in voids have slightly lower stellar metallicities than in clusters by 0.103 ± 0.016 (6.4σ) at intermediate stellar masses (∼10 9.75 M ) to 0.066 ± 0.013 (5.1σ) at high stellar masses (∼10 10.75 M ).Blue galaxies in voids have lower stellar metallicities than in clusters by 0.315 ± 0.023 (13.7σ) at low stellar masses (∼10 9.25 M ) to 0.150 ± 0.015 (10.0σ) at intermediate stellar masses (∼10 9.75 M ).
The stellar metallicity differences of blue galaxies (see the right column panels in Fig. 5) look very similar to what we find for galaxies with LT-SFH (right column panels in Fig. 3), but in a narrower stellar mass range.Blue galaxies in voids have lower stellar metallicities than in clusters for stellar masses between 10 8.75 M and 10 9.75 M , for LT-SFHs galaxies, these differences between voids and clusters remain up to 10 10.25 M .In contrast, the differences in stellar metallicity for red galaxies are less significant, similar to what we find for ST-SFH.The reason is that a high fraction of red galaxies have an ST-SFH and a high fraction of blue galaxies have an LT-SFH (∼65−70%, see Domínguez-Gómez et al. 2023, and Extended Data Fig. 7 therein).
The comparison of blue galaxies between different largescale environments is not straightforward because the colour distribution is not the same.This also holds for the comparison of red galaxies.This means that a different classification criterion between blue and red galaxies may change our results.However, in Fig. A.6 we show the same as in Fig. 5, but with the colour classification criterion at 0.6 instead of 0.7, for which the metallicity differences that we find are is very similar.

Stellar mass-metallicity relation
The MZ R correlates with the large-scale environment, SFH type, morphology, and colour of the galaxies.The stellar metallicity of galaxies in voids is slightly lower than in filaments & walls in specific stellar mass bins, and it is much lower that in clusters at any given stellar mass.Many works have studied the MZ g R of galaxies, and some even compared different local (Deng 2011;Pasquali et al. 2012;Pilyugin et al. 2017) and large-scale environments (Wegner & Grogin 2008;Pustilnik et al. 2011;Kreckel et al. 2015;Wegner et al. 2019), but there is no consensus about the gas metallicity properties in void galaxies.However, only a few works studied how the local environment affects the MZ R, and none of them studied how it is affected by the large-scale structures of the Universe.Pasquali et al. (2010) and Gallazzi et al. (2021) studied the stellar populations of galaxies in groups and found that the stellar age and metallicity of central galaxies increases with the halo mass when they averaged for all stellar masses.However, Scholz-Díaz et al. (2022) found that this correlation is produced by the stellar-to-halo mass relation.The stellar age and metallicity of central galaxies decreases with halo mass for a fixed stellar mass in low-mass haloes (<10 13.5 M ).This means that the lower stellar metallicities that we find for void galaxies might be due to their higher halo-to-stellar mass ratios compared to denser environments (Artale et al. 2018;Alfaro et al. 2020;Habouzit et al. 2020;Rosas-Guevara et al. 2022).However, they did not compare with void galaxies.Kuutma et al. (2020) studied the effect of the local and largescale environment on the properties of galaxies in groups (i.e. from two to six galaxies), such as colour, stellar mass, morphology, and the 4000 Å break.They compared galaxies inside (within a radius of 1 Mpc from the filament axes) and outside the filament (within a radius of 1 Mpc to 4 Mpc) and concluded that the effect of filaments on the properties of galaxies in groups is marginal, and that the local environment is the main factor that determines their properties.However, the delimitation of voids within the large-scale structure of the Universe and the classification of void galaxies is not as easy as measuring their distance to the closest filament, and many of the galaxies outside the filament might be inside a wall, whose galaxies have similar properties as galaxies inside the filaments.Furthermore, they did not study the galaxies in the deepest regions of the voids, which may be located up to 15 Mpc from the closest filament.Clearly, the local density is lower in voids than in filaments on average, but both the local and large-scale environments influence the properties of galaxies directly or indirectly.Gallazzi et al. (2021) found that the stellar metallicity of recent cluster or group infallers (i.e.galaxies that passed the virial radius of the host halo <2.5 Gyr ago) is lower than that of those that have been exposed to the environment of clusters or groups for a longer time (>2.5 Gyr).Recent infallers continue to form stars (although at lower rates) for ∼2 Gyr after their infall (Rhee et al. 2020, Fig. 7 therein).The typical timescale of ram-pressure stripping in clusters as massive as Virgo is <1 Gyr, and ∼2 Gyr for gas stripping due to tidal interactions (Boselli & Gavazzi 2006).This means that for about 2 Gyr after falling into the cluster, the galaxies (recent infaller) still act as if they were in the previous host environment (i.e.voids or filaments & walls) with little changes in the SFR.Gallazzi et al. (2021) results would agree with ours because they found that recent infallers (i.e. with void and filament & wall galaxy properties) have lower stellar metallicities than ancient infallers (with cluster galaxy properties).
It is well known that the metallicity of a galaxy is significantly determined by its SFH (Tantalo & Chiosi 2002), and this is reflected in our results.The stellar metallicity differences that we find for galaxies in different large-scale environments are much more significant for LT-SFH than for ST-SFH.ST-SFH galaxies formed a high fraction (∼27%) of their stellar mass very early (more than 12.5 Gyr ago Domínguez-Gómez et al. 2023), enriching their ISM very quickly for the next generation of stars to be formed.Furthermore, they assembled 50% of their stellar mass at a similar time (∼11 Gyr ago) in voids, filaments & walls, and clusters.This suggests that in the early Universe, the contrast between the large-scale environments was lower, which did not affect the evolution of the ST-SFH galaxies in the beginning but later, that is, when they formed 70% of their stellar mass.Void galaxies assembled 70% of their stellar mass later than in filaments & walls (by ∼1 Gyr) and much later than in clusters (by ∼2 Gyr), more significantly at low (10 9.0 −10 9.5 M ) than at high stellar masses (10 10.0 −10 10.5 M ).
The LT-SFH galaxies have had a more steady SFHs, enriching their ISM more slowly, and possibly diluting their metallicity by metal-poor gas accretion.Moreover, LT-SFH galaxies have been affected by their large-scale environments since very early on, assembling their stellar mass later in voids than in filaments & walls (at intermediate stellar masses, 10 9.5 −10 10.0 M , by ∼1 Gyr), and much later than in clusters (at any given stellar mass by ∼2 Gyr).This indicates that galaxies that had similar SFHs in the beginning (i.e.ST-SFH galaxies that assembled 50% of their stellar mass at similar times in the three environments) would have similar stellar metallicities now, even if their SFH differ later (assembling 70% of their stellar mass at different times).In contrast, galaxies with different SFHs in the beginning (i.e.LT-SFH galaxies that assembled 50% of their stellar mass at different times in the three environments) would have different stellar metallicities now.Therefore, the mass-weighted stellar metallicity of a galaxy is mostly determined by its initial SFH period (old stars).We confirm this in Fig. 6a, where we show a direct correlation (blue arrow) in the mass-weighted stellar age-metallicity distribution.We derived the mass-weighted stellar age following the same recipe as for metallicity given in Eq. ( 1).Gallazzi et al. (2005) found an effect of the age-metallicity degeneracy as an anti-correlation for the oldest galaxies in the stellar age-metallicity distribution for luminosity-weighted ages and metallicities (see their Figs. 11 and 12).We do not find this anti-correlation for the mass-weighted average in Fig. 6a.However, the comparison between luminosity-weighted and mass-weighted averages is not straightforward.We derive in Appendix D the MZ R applying the luminosity-weighted average, where we find similar results to what we find in Sect. 4 for the mass-weighted average.We show in Fig. 6b the luminosityweighted stellar age-metallicity distribution for our sample of galaxies, and we recover a similar anti-correlation (red arrow) for the oldest galaxies.However, the direct correlation (blue arrow) for young galaxies is maintained.Void galaxies have assembled their mass more slowly on average than galaxies in denser environments (see Domínguez-Gómez et al. 2023), and their stellar populations are consequently younger than in filaments & walls, and clusters.This agrees with the lower stellar metallicities that we find for void galaxies.
We also show that the stellar metallicity differences that we find between different large-scale environments are more significant for blue spiral galaxies than for red elliptical galaxies.Gallazzi et al. (2005) found that for a given stellar mass, earlytype galaxies have older and more metal-rich stellar populations on average than late-type galaxies.Red elliptical galaxies are more likely to be gas-poor quenched massive galaxies that have suffered high star formation bursts after galaxy-galaxy interactions or mergers, quickly enriching their ISM.They also suffer from internal feedback processes such as AGNs, supernovae, and stellar winds.Blue spiral galaxies are more likely to be gasrich star-forming galaxies with smaller chances to have suffered mergers in the past, preserving their metal-poor surrounding gas, and enriching their ISM slower than red elliptical galaxies.Void galaxies are bluer on average and have later morphological types than in denser environments, fulfilling the expectations of finding lower stellar metallicities in void galaxies.

Scatter around the gas-phase mass-metallicity relation
As very little is known about the correlation between the MZ R and the large-scale environment, we compared our results with previous studies about the gas-phase metallicity.It is not obvious to directly compare the MZ R with studies focusing on the MZ g R as this procedure only takes into account star-forming galaxies (with gas emission lines), but we also considered quenched galaxies (without gas emission lines).We can only refer to blue and spiral (i.e.star-forming) galaxies of our sample (right column panels in Figs. 4 and 5, respectively) when comparing our MZ R results with the MZ g R. Additionally, previous studies (Gallazzi et al. 2005;Panter et al. 2008;Zahid et al. 2017) have shown that the stellar metallicity correlates with the gas-phase metallicity when considering young stellar populations or the luminosity-weighted average stellar metallicity.We show in Appendix D the MZ R applying the luminosityweighted average, where we find similar results to what we find in Sect. 4 for the mass-weighted average of blue and spiral galaxies.Blue and spiral galaxies in voids have lower stellar metallicities than in filaments & walls and much lower than in clusters, and the differences are more significant at low than at high stellar mass.Thus, we assume that it is fair to compare our massweighted MZ R for blue spiral galaxies with the MZ g R results in the literature, and we interpret our differences in the MZ R for different large-scale environments as scatter around the main MZ g R, associated with the halo mass of the galaxies, gas accretion, and gas feedback.
IllustrisTNG simulation (Torrey et al. 2019) showed that the scatter in the MZ g R correlates with the ISM-to-stellar mass ratio (M ISM /M ) and the SFR.High SFRs or low M ISM /M ratios increase the gas metallicity of star-forming galaxies.This would imply that the higher stellar metallicity that we find for the blue and spiral galaxies in clusters is driven by a lower M ISM /M or higher SFR than in less dense environments.
Observations (Yang et al. 2022) show that the gas mass and the gas metallicity are anti-correlated at a given stellar mass up to M < 10 10.5 M .Simulations (van de Voort et al. 2011) predict a correlation between the gas-accretion rates and the host halo mass of the galaxy up to M h < 10 12.0 M .This means that the more massive the halo, the higher the gas accretion and the gas fraction.This implies a decreased gas-phase metallicity because the inflowing gas is assumed to be more metal poor than the ISM.This would imply that the lower stellar metallicity that we find for our void galaxies is due to a higher gas mass or higher gas-accretion rates driven by their more massive host haloes.This scenario is supported by simulations that find that the halo-to-stellar mass ratio is higher in void galaxies than in galaxies in denser large-scale environments (Artale et al. 2018;Alfaro et al. 2020;Habouzit et al. 2020;Rosas-Guevara et al. 2022).Another possibility is that there are two different modes of gas accretion (Kereš et al. 2005): the cold gas-accretion mode dominates in void galaxies, while the hot gas-accretion mode prevails in denser environments.Additionally, a previous observational study (Florez et al. 2021) found that void galaxies have a higher gas mass than galaxies in denser environments.This is more significant for low-mass (M < 10 10.0 M ) and early-type galaxies than for high-mass or late-type galaxies.However, other observational studies (Szomoru et al. 1996;Kreckel et al. 2012;Domínguez-Gómez et al. 2022) and simulations (Rosas-Guevara et al. 2022) did not find significant gasmass differences between galaxies in different large-scale environments for this stellar mass regime.Very little observational evidence has been provided for gas-accretion rates onto galaxies, given the considerable challenge of directly measuring it.
At higher stellar masses (M > 10 10.5 M ), Yang et al. (2022) reported that the scatter of the MZ g R correlates only very weakly with the gas mass, but a stronger trend is found with AGN activity.Both the EAGLE and IllustrisTNG simulations find that the scatter of the MZ g R is no longer driven by systematic variations in gas-inflow rate, but is instead dominated by the impact of AGN feedback (De Rossi et al. 2017;Torrey et al. 2019;van Loon et al. 2021).Galaxies with a higher nuclear activity have the lowest metallicities.Previous observational studies (Constantin et al. 2008;Ceccarelli et al. 2022) found a larger fraction of AGNs or massive black holes (BH) in voids than in denser large-scale environments.However, there is as yet no consensus on the effect of the large-scale structure on the nuclear activity in galaxies, as Argudo-Fernández et al. (2018) found the opposite result for quenched isolated galaxies, and other studies did not find significant differences in the fraction of AGNs (Amiri et al. 2019, observation) or in the BHto-galaxy mass ratio (Habouzit et al. 2020, simulation) between different large-scale environments.This would agree with our results because we do not find significant stellar metallicity differences between galaxies in different large-scale environments at high stellar masses (M > 10 10.5 M ).However, in this stellar mass range, the stellar metallicity differences that we find between galaxies in voids and denser large-scale environments might have been diluted by the effect of the metallicity saturation.

Conclusions
We applied a non-parametric full spectral fitting analysis to the SDSS spectra in the centre of statistically sound samples of galaxies in voids, filaments & walls, and clusters.We recovered their stellar populations and studied how the large-scale structures of the Universe affect the stellar mass-metallicity relation of galaxies for different SFH types, morphologies, and colours.The main conclusions are listed below.1. Void galaxies have slightly lower stellar metallicities than galaxies in filaments & walls, more significantly so at low stellar masses (10 9.25 M by 0.108±0.019)than at high stellar masses (10 10.25 M by 0.031 ± 0.009), and much lower than galaxies in clusters, also more significantly so at low stellar masses (10 9.25 M by 0.40 ± 0.02) than at high stellar masses (10 10.75 M by 0.084 ± 0.013).At high stellar masses (10 10.75 M ), the differences between galaxies in voids and denser environments might have been diluted by the effect of the metallicity saturation.2. The stellar metallicity differences between galaxies in voids and galaxies in denser environments are more significant for LT-SFH than for ST-SFH galaxies.This is more significant for spiral than for elliptical galaxies, and it is more significant for blue than for red galaxies.3. The ST-SFH galaxies in voids have slightly lower stellar metallicities than galaxies in filaments & walls at intermediate stellar masses (10 10.25 M , by 0.035 ± 0.011), and much lower than galaxies in clusters, more significantly so at intermediate stellar masses (10 10.25 M , by 0.152 ± 0.011) than at low stellar masses (10 9.25 M , by 0.063 ± 0.017).LT-SFH galaxies in voids and filaments & walls have similar stellar metallicities, except for low stellar masses (10 9.25 M ), where void galaxies have slightly lower stellar metallicities (by 0.104 ± 0.021).LT-SFH galaxies in voids have much lower stellar metallicities than in clusters, more significantly so at low stellar masses (10 9.25 M , by 0.419 ± 0.024), than at high stellar masses (10 10.75 M , by 0.11 ± 0.03).4. Both elliptical and spiral galaxies in voids have slightly lower stellar metallicities than in filaments & walls at intermediate stellar masses (10 9.75 M , by 0.057 ± 0.017 and 0.071 ± 0.016, respectively), and much lower than in clusters, more significantly so at low stellar masses (10 9.25 M , by 0.26±0.04 and 0.27±0.03,respectively) than at high stellar masses (10 10.25 M , by 0.075 ± 0.012 and 0.077 ± 0.017, respectively). 5. Blue galaxies in voids have slightly lower stellar metallicities than in filaments & walls at low stellar masses (10 9.25 M , by 0.091 ± 0.020), but no significant differences are found between red galaxies in voids and filaments & walls.Red galaxies in voids have slightly lower stellar metallicities than in clusters, more significantly so at lower stellar masses (10 9.75 M by 0.103 ± 0.016) than at higher stellar masses (10 10.75 M by 0.066 ± 0.013).Blue galaxies in voids have lower stellar metallicities than in clusters, more significantly so at lower stellar masses (10 9.25 M by 0.315 ± 0.023) than at higher stellar masses (10 9.75 M by 0.150 ± 0.015).In summary, galaxies in voids and filaments & walls have similar stellar metallicities, except for intermediate stellar masses, where void galaxies have slightly lower stellar metallicities.Void galaxies have lower stellar metallicities than galaxies in clusters (more significantly so at low than at high stellar masses).These differences can be explained by the slower SFHs of voids galaxies, specially at the initial star formation period in LT-SFH galaxies.Additionally, when we assume a good correlation between the stellar and gas-phase metallicities of star-forming galaxies (i.e.blue and spiral galaxies, for which we find the highest stellar metallicity differences between galaxies in different large-scale environments compared to red and elliptical galaxies, where the differences are less significant), we can explain the lower stellar metallicity of void galaxies at intermediate stellar masses (M < 10 10.5 M ) based on their higher halo-to-stellar mass ratio, and higher gas accretion.However, further research is needed in terms of gas-mass content, gas-phase metallicity, and nuclear activity of void galaxies, together with the correlation between these physical processes and the SFH.The CAVITY project aims to fulfil these needs by analysing the resolved emis-sion lines, stellar populations, and kinematics from PPAK IFU data, together with ancillary data, such as atomic and molecular gas, of galaxies in voids.
Appendix A: Sub-samples with the same stellar mass distribution We show in Figure A.1 the colour vs. stellar mass diagram distribution of our galaxy samples.Void galaxies are bluer on average and less massive than galaxies in denser environments.Our analysis might be affected by the different stellar mass distribution of the three samples.We defined five stellar mass bins of 0.5 dex between 10 8.5 and 10 11.0 M and selected random sub-samples with the same stellar mass distribution as our void galaxy sample inside each stellar mass bin.The number of galaxies beyond these limits was not enough to define sub-samples with a similar stellar mass distribution applying a KS-test.We were left with 978 galaxies in voids, 4800 galaxies in filaments & walls, and 2570 galaxies in clusters for our study.
In figures A.2-A.4 we showed the same as figures 3-5, respectively, but for the sub-samples with the same stellar mass distribution inside each stellar mass bin.The values represented in the figures are reported in tables E.7-E.12.The stellar metallicity differences that we find between galaxies in voids, filaments & walls, and cluster for the sub-samples with the same stellar mass distribution are similar to what we find in Section 4 for the main sample.We also show in Figure A.5 the same as in Figure 3, but for narrower stellar mass bins of 0.25 dex width.Additionally, in Figure A.6 we show the same as in Figure 5 for red and blue galaxies, but with the classification criterion at 0.6 instead of 0.7 mag.The results change, but the general tendency is similar.Notes.Differences of stellar mass-metallicity relation between galaxies in filaments & walls and voids (a), and between galaxies in clusters and voids (b) for all the galaxies, regardless of their SFH type (left multi-column), galaxies with ST-SFH (centre multi-column), and galaxies with LT-SFH (right multi-column).∆p 50 represents the difference (together with its error) of the 50th percentile of the stellar mass-metallicity distribution between different large-scale environments, and σ is the ratio of the nominal value and the error or the difference.

Fig. 1 .
Fig. 1.Examples of SFH as the stellar mass fraction vs. the lookback time of galaxies CAVITY41603 (solid magenta line) and CAV-ITY51386 (dashed cyan line), which are examples of ST-SFH and LT-SFH, respectively.The shaded boxes represent the uncertainties of the stellar mass fraction of the galaxy associate to each SSP that is representative for each look-back time bin.The lines represent the interpolation between the nominal values of the SSP mass fractions.

Fig. 3 .
Fig. 3. Stellar mass-metallicity relation (MZ R).Mass-weighted average stellar metallicity ([M/H] M) as a function of the total stellar mass for the galaxies regardless of their SFH type (left column), galaxies with ST-SFHs (centre column), and galaxies with LT-SFHs (right column) in voids (first row), filaments & walls (second row), and clusters (third row).The MZ R (dashed blue lines for voids, dot-dashed green lines for filaments & walls, and solid red lines for clusters) is derived as the 50th percentile (thick lines) inside each stellar mass bin of 0.5 dex.The number of galaxies inside each stellar mass bin is shown in brackets at the bottom of the panels.The shaded areas represent the s.e.m., and the 16th and 84th percentiles (thin lines) show the dispersion of the MZ R. The fourth row shows a comparison of the MZ R between galaxies voids, filaments & walls, and clusters, together with the MZ R fromGallazzi et al. (2005) as a reference.In the fifth row, we show the differences of the MZ R (lines), together with the error of the difference (shaded areas).See the values reported in Tables E.1 and E.2.
Fig.4.Same as Fig.3, but for elliptical (left column) and spiral galaxies (right column).See the values reported in Tables E.3 and E.4.
Fig. 6.Stellar age-metallicity distribution for several stellar mass ranges.The stellar metallicities and ages of the galaxies are derived as the mass-weighted (a) and luminosity-weighted (b) averages.The arrows illustrate the age-metallicity correlation (blue arrows) and anticorrelation (red arrow).

Fig. A. 1 .
Fig. A.1.Colour vs. stellar diagram distribution of our samples of galaxies in voids (left), filaments & walls (centre), and clusters (right).The number of galaxies in each sample is shown between brackets in the legend.

Fig. B. 1 .
Fig. B.1.Same as Figure3, but for volume-limited sub-samples of galaxies with redshifts between 0.01 and 0.03.The error bars represent the differences between the results for the flux-limited sub-sample of Figure3and the results for the volume-limited sub-samples of this figure.See the values reported in tables E.17 and E.18.

Table E .
2. Differences of the stellar mass-metallicity relation between galaxies in voids, filaments & walls, and clusters for different SFH types.

Table E .
3. Stellar mass-metallicity relation for different morphologies.Table E.4.Differences of the stellar mass-metallicity relation between galaxies in voids, filaments & walls, and clusters for different morphologies.Notes.Same as TableE.2,butforelliptical(leftmulti-column) and spiral galaxies (right multi-column).Table E.6.Differences of the stellar mass-metallicity relation between galaxies in voids, filaments & walls, and clusters for different colours.Notes.Same as TableE.2,but for red (left multi-column) and blue galaxies (right multi-column).Table E.7.Stellar mass-metallicity relation of sub-samples with the same stellar mass distribution for different SFH types.Notes.Same as Table E.1, but for sub-samples with the same stellar mass distribution.A111, page 30 of 40 Domínguez-Gómez, J., et al.: A&A 680, A111 (2023) Table E.8.Differences of the stellar mass-metallicity relation of sub-samples with the same stellar mass distribution for different SFH types.Notes.Same as Table E.2, but for sub-samples with the same stellar mass distribution.Table E.9.Stellar mass-metallicity relation of sub-samples with the same stellar mass distribution for different morphologies.Notes.Same as Table E.3, but for sub-samples with the same stellar mass distribution.A111, page 31 of 40 Domínguez-Gómez, J., et al.: A&A 680, A111 (2023) Table E.10.Differences of the stellar mass-metallicity relation of sub-samples with the same stellar mass distribution for different morphologies.Notes.Same as Table E.4 but for sub-samples with the same stellar mass distribution.Table E.11.Stellar mass-metallicity relation of sub-samples with the same stellar mass distribution for different colours.