f(x)=lnx-x+1
f'(x)=1/x-1
k=f'(2)=1/2-1=-1/2
f(2)=ln2-2+1=ln2-1
∴切线方程是
y-(ln2-1)=-1/2(x-2)=-x/2+1
y=-x/2+1+ln2-1
=-x/2+ln2