How to charge the MacBook Pro from 12 Volts?
If you connect 18 V to the power/ground pins, your Mac will be powered off the 12 V battery, but it won't charge: https://apple.stackexchange.com/a/132332/26231

To charge, the laptop needs to identify the charger by communicating over the signal pin in the middle. http://www.righto.com/2013/06/teardown-and-exploration-of-magsafe.html

Solution: Sacrifice an apple charger by cutting the cable and connecting the correct pins to your DC/DC converter. I recommend using the 45 W ones so your DC power supply doesn't have to be very big.