4

The following code produces a strange rendered percentage symbol which looks like this: Strange Percentage Symbol
Here's my code:

\documentclass[12pt, a4paper, twoside, %openright, 
toc=listof, BCOR=5mm, bibliography=totoc, parskip=half]{scrreprt}
\usepackage{helvet}
\usepackage[ngerman]{babel} 
\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc}
\begin{document}
11-13\%
\end{document}

Now I used the board search and came across this solution: Combining Helvetica and Symbol fonts with mathspec But since I'm not too familiar with all these LaTeX packages and I'm not using them, I didn't want to just add them to my code, but wanted to know, which lines i need to add to get my code working without possibly changing anything else which i might not want. Thanks in advance

Max
  • 438
  • 2
    That can't be exactly the code that produced the output. I guess you meant to escape the % with a backslash? – Thruston Oct 09 '15 at 13:56
  • yes absolutly, gonna edit! – Max Oct 09 '15 at 13:58
  • Loading the package helvet changes the default sans-serif font, but loading the package does not change the default text font from serif to sans-serif. You should try \sffamily 11-13\%. Be sure not to forget to escape the % symbol. – Mico Oct 09 '15 at 13:58
  • Could be \textsf{11-13\%}. – Sigur Oct 09 '15 at 14:00
  • A couple of other clarifications: are you trying to typeset the whole document in Helvectica? and are you using pdflatex or xelatex? (because the mathspec solution is only for xelatex). – Thruston Oct 09 '15 at 14:00
  • @Mico well, this solves the problem, but it will changes the whole font for everything coming afterwards. And actually i would prefer a solution, that i don't have write in front of every %-symbol i'm going to use – Max Oct 09 '15 at 14:01
  • @Thruston: i'm using pdflatex and yes, the whole document is supposed to be helvetica. – Max Oct 09 '15 at 14:03
  • @Max - The unescaped "%" symbol is the comment character in TeX and LaTeX. If you need to actually show the percent symbol itself, you must escape it, i.e., write \%. – Mico Oct 09 '15 at 14:03
  • See this answer http://tex.stackexchange.com/questions/2095/simplest-way-to-typeset-entire-document-in-sans-serif-helvetica. You need to add \renewcommand{\familydefault}{\sfdefault} in the preamble. – Thruston Oct 09 '15 at 14:04
  • @thruston this changes the font of my entire document, it looks really strange now. I just want the percentage-symbol to show normal – Max Oct 09 '15 at 14:08
  • @thruston ok, i gotta correct myself. I thought i wanted the document to use helvetica, because i was using a template of the institute i am working for and it had the \usepackage{helvet} in the preamble. But IF that alone does not make the document to show up in helvetica, than i apparently don't want it to be in helvetica. – Max Oct 09 '15 at 14:13
  • This comment discussion is already too long - so continue in chat if you want more. helvet package just sets the sans serif font, which scrrpt uses for headings I believe. The percent sign you see is the normal % sign for Computer Modern, which is the default font. – Thruston Oct 09 '15 at 14:17
  • @Max - Rather than tell us what you don't want, it might be easier to state what you do want. – Mico Oct 09 '15 at 14:18
  • @ Thruston Ok in this case i don't want the text to be in Helvetica, but i want the percentage sign to not have this little bow in the top. How can i continue this in the chat? – Max Oct 09 '15 at 14:19
  • @Mico I do want a percent sign without this little bow in the top, but i do not want to change anything else – Max Oct 09 '15 at 14:19
  • 1
    Getting a decent matcvh to computer modern might be tricky, as it's so light. The pdf samples at http://www.tug.dk/FontCatalogue/seriffonts.html do have the percent sign, from those you might try Literaturnaya, but it isn't included by default. – Chris H Oct 09 '15 at 15:05
  • @ChrisH thanks for your efforts! And yes, the literaturnaya percent sign looks quite good. i'm gonna try it out later and let you know. – Max Oct 09 '15 at 15:29
  • @max -- no problem. May I suggest you add an answer when you get it working? After all, I've left you the hard part due to not having the font here. – Chris H Oct 09 '15 at 16:01

3 Answers3

6

You can get the percent sign in whatever family you want by using

\DeclareRobustCommand{\%}{{%
  \mbox{%
    \fontencoding{\encodingdefault}%
    \fontfamily{<family>}%
    \selectfont
    \symbol{`\%}%
  }%
}}

and the only problem is to choose the right <family> name. For Helvetica it would be phv, but the percent symbol would stick out like a sore thumb in a serif font context.

The little bow is customary for serif fonts; among the free ones I can see the Kpfonts and Bookman without it, but the symbol would be again in a non compatible style with the default fonts.

Here's a possible choice for <family>:

enter image description here

If you plan to use \% in math mode, change \mbox into \text (and load amsmath).

And now that you can appreciate the differences in style, stick with the default.

egreg
  • 1,121,712
  • Quick question: why the double braces? – campa Oct 09 '15 at 15:30
  • 2
    @campa In the (unlikely) case it is used as $x_\%$ – egreg Oct 09 '15 at 15:32
  • thank you very much for your help. This seems to be an even mor appropriate solution than the one provided by mico. i'm going to experiment with that later. Do you know where i can find the <family> name for the literaturnaya font, that @ChrisH suggested? – Max Oct 09 '15 at 15:34
  • @Max That would require a quite complex installation on TeX Live. And all for getting this percent sign. Not much different from jkp – egreg Oct 09 '15 at 15:49
4

If you really want the matching % from the original font, but without the "little bow" (as I interpret your comment to Mico), then one option is to define a new \% that paints over the offending "bow". Here, I have made it work for different text size changes.

In the MWE, I define \overlayclr so that you can see what I am painting over (when I set it to red). I show the original \% at the far right, so you can see that the size of the revised glyph matches the original.

\documentclass[12pt, a4paper, twoside, %openright, 
toc=listof, BCOR=5mm, bibliography=totoc, parskip=half]{scrreprt}
\usepackage{helvet}
\usepackage[ngerman]{babel} 
%\usepackage[T1]{fontenc} 
\usepackage[utf8]{inputenc}
\usepackage{graphicx,xcolor,stackengine,scalerel}
\let\svpct\%
\def\overlayclr{white}
\renewcommand{\%}{\scalerel*{\stackon[0pt]{\stackon[0pt]{\normalsize\svpct}{\smash{%
  \textcolor{\overlayclr}{\rotatebox{56.8}{\rule[-4.55pt]{2.5pt}{1.5pt}}}}}}%
  {\smash{\textcolor{\overlayclr}{%
  \rotatebox{27}{\kern-.84pt\rule[-2.5pt]{1.5pt}{2.5pt}}}}}}{\svpct}}
\begin{document}
\Huge11-13\%\quad{\def\overlayclr{red}11-13\%\svpct}\par
\normalsize11-13\%\quad{\def\overlayclr{red}11-13\%\svpct}
\end{document}

enter image description here

  • Wow, this looks like a really sick solution! And it also looks like a lot of effort, thank you very much for that! And after all it fulfills my wishes even further than the other two solutions. – Max Oct 09 '15 at 16:08
1

If you want to render the default percent symbol in Helvetica, without changing any other aspect of the text font, you could proceed by inserting the following instructions in the preamble:

\usepackage{helvet}   % select Helvetica as the sans-serif font
\let\origpercent\%    % save the "original" "\%" macro
\renewcommand{\%}{\textsf{\origpercent}}
Mico
  • 506,678
  • Thank you very much, this is what i was looking for. After all the %-symbol now looks a little bit alien in the text. Is there maybe a percent-symbol that looks almost the same like the one in my image but only does not have that little bow? – Max Oct 09 '15 at 14:37
  • @Max you'll need to find one from a serif font similar to computer modern, but with separate components. Then you'll need to get it working. Unfortunately % isn't shown in the samples at http://www.tug.dk/FontCatalogue/seriffonts.html – Chris H Oct 09 '15 at 14:50