Deductions & credits

which is it - a capital loss which can come from a carryover or a capital gain which could only come from a current year transaction?   but gains could come from many different input forms.