Lord Pentland will become the new head of Scotland’s judiciary next month after being appointed Lord President by King Charles.