I think I've found a mistake in my thermodynamics textbook, Chemical Thermodynamics for Process Simulation, but as thermodynamics is hard and I'm a relative novice, I wanted to check here.
The textbook, in talking about partial molar Gibbs excess functions of species in solutions, writes that we can express the partial molar Gibbs free energy of a species $\bar{g_i}$ in solution, as the sum of the partial molar Gibbs free energy in an ideal solution, $\bar{g_i}^\mathrm{id}$, and an excess function, $\bar{g_{i}}^\mathrm{ex}$:
$$\bar{g}_i = \bar{g}_i^\mathrm{id}+\bar{g}_i^\mathrm{ex}.$$
It doesn't specify whether we are thinking of evaluating $\bar{g}_i^\mathrm{id}$ at the system pressure or at a reference pressure, but immediately after it 'expands' the above expression into the form:
$$\bar{g}_i(T,P) = \Big(\bar{g}_i^\mathrm{pure}(T,P_0) + \mathcal{R}T\ln x_i\Big) + \left(\mathcal{R}T\ln \frac{f_i}{x_if_i^0}\right)$$
Clearly we're comparing $\bar{g}_i$ to the ideal value, $\bar{g}_i^\mathrm{id}$, at standard pressure $P_0$. However, they then go on to define the activity $a_i=f_i/f_i^0$ and the activity coefficient $\gamma_i = a_i/x_i$ and substitute these in to get
$$\bar{g}_i(T,P) = \bar{g}_i^\mathrm{pure}(T,P_0) + \mathcal{R}T\ln x_i + \mathcal{R}T\ln \gamma_i.$$
Now, I'm all fine up to here. The first part, $\bar{g}_i^\mathrm{pure}(T,P_0) + \mathcal{R}T\ln x_i $, is the ideal solution Gibbs free energy at standard pressure, and the final term, $\mathcal{R}T\ln \gamma_i,$ is a correction in two ways: It corrects for the non-ideality of the solution, and it corrects for the fact that we may be at a different pressure $P$.
But the book then says:
For an ideal mixture the excess part is equal to zero, since the activity coefficient is $\gamma_i=1$.
I think this is ridiculous: we can only make this conclusion if we have an ideal solution at $P=P_0$.
Is this an error in the textbook? Also, I can see two possible routes to an error: Either $\bar{g}_i^\mathrm{id}$ is actually to be evaluated at system pressure, in which case their last statement is correct but the formula they give is wrong, or else their definition of excess functions is the standard one (actual value minus ideal value at ref. pressure) but they made a mistake in concluding $\gamma_i=1$ for all ideal solutions, independent of the pressure.