Electronic structures and charge transfer in lithium and mercury intercalated titanium disulfides