0

I want to use \usepackage[sfdefault]{merriweather}, but without the oldstyle numbers. So, I wanted to change the font for numbers on the sections and chapters or use a similar font (Helvetica, maybe?).

I think that the sectsty package has a solution: \partnumberfont and \chapternumberfont.

Unfortunately, I can not use this package. Also, I cannot use XeTeX or LuaTeX.

Update.: @runartrollet give the solution:

\usefont{T1}{phv}{m}{n}\selectfont
\renewcommand{\thechapter}{\usefont{T1}{phv}{m}{n}\selectfont\arabic{chapter}}
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}

Now I have a correlated question, I don't know if I need to create another topic: There is some way to change all "merriweather" numbers to helvetica numbers?

4
  • Nowhere. It works with just the plain installation on Mac OS.
    – Costa PR
    Commented May 30, 2016 at 21:29
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented May 30, 2016 at 21:37
  • @CostaPR If you want to substitute every numeral in the font with the numerals from a different font, I think you would have to do something very complicated. kerning could be a problem. You could try to make a new question, and maybe some of the super wizards around here could give you a great answer, but I suspect they will just tell you that it shouldn't be done.
    – Runar
    Commented May 30, 2016 at 22:53
  • @CostaPR I found another post which gives an answer on how to replace a symbol with another symbol from another font. It seeks to replace just a single letter, a german one, but you could use the same code to replace all the numbers. Have a look at Importing “ß” from a different font
    – Runar
    Commented May 31, 2016 at 9:54

1 Answer 1

1

I don't think this font includes table-numerals(or uppercase-numerals), so you will have to replace the font for the numbers. I would advice against this, as old style numerals do bring a sense of style in. If you want to do it for only the chapter/section-titles, I would change the font for the whole title, not just the number.

Please do not mix fonts like this on the same line, it is really ugly! It is better to change the font for the whole section/chapter -title, have a look at Gonzalo Medina's answer to How to change section/subsection font size? [duplicate] for details on how to change section-style.

Below, I have changed only the font for the number, but I haven't really spent any time finding a font that actaully fits, so it looks quite ugly. You might bea ble to find one that is more fitting. Again, I would adice against this.

\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage[sfdefault]{merriweather}
\usefont{T1}{fxl}{m}{n}\selectfont
\renewcommand{\thesection}{{\selectfont \arabic{section}}} 
\renewcommand{\thechapter}{{\selectfont \arabic{chapter}}} 
\begin{document}
\chapter{Foo}
\section{Bar}
\end{document}
4
  • It looks quite ugly indeed.
    – Costa PR
    Commented May 30, 2016 at 21:58
  • yep, you really shouldn't do this
    – Runar
    Commented May 30, 2016 at 22:10
  • I will search for another font... I hate these old style numbers on the chapter number...
    – Costa PR
    Commented May 30, 2016 at 22:23
  • @CostaPR I added a note with a link on how to change the font for the whole section/chapter, which I believe would make it look a lot better than only changing the font for the counter.
    – Runar
    Commented May 30, 2016 at 22:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .