TransWikia.com

Different sans serif font for captions

TeX - LaTeX Asked by AbliusKarfax on December 28, 2020

In my document, I want to use palatino as the main text font, and Arev (or Myriad Pro) for captions. I found some relevant question on stackexchange, but none of them works for me 🙁

Here’s the MWE:

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{lipsum}
usepackage{palatino, mathpazo}
usepackage{arev}
usepackage[font=sf]{caption}

begin{document}

section{Introduction}
lipsum[1]
begin{table}[ht]
begin{tabular}{lll}
1 & 1 & 1  
2 & 2 & 2  
end{tabular}
caption{My table}
end{table}

end{document}

I know this is a silly approach, but it’s here just to give an idea.

Ideally, I would like to use MyriadPro, but I can’t figure out how to use it on Overleaf. Do you think it’s possible? In particular, with pdfLaTeX?

One Answer

The trick is to load mathpazo after rather than before arev.

enter image description here

documentclass{article}
usepackage[utf8]{inputenc}
usepackage{lipsum}
usepackage{arev,mathpazo} % no need to load 'palatino' package
usepackage[font=sf]{caption}

begin{document}

section{Introduction}
lipsum[2]

begin{table}[ht]
centering
begin{tabular}{lll}
1 & 1 & 1  
2 & 2 & 2  
end{tabular}
caption{My table}
end{table}

end{document}

Correct answer by Mico on December 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP