Chemical equilibria in slitlike pores