Fonts & Character SetsHow to keep original font format with fourier package?

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
ivan_hr
Posts: 18
Joined: Fri Dec 10, 2010 12:32 pm

How to keep original font format with fourier package?

Post by ivan_hr »

Hi,

I would like to insert a bomb symbol in my text (don't worry I'm not a terrorist :) ). In order to do so I have to use fourier package. But when I include fourier package in the preamble it changes my default font and I don't want this to happen. In order to solve this i tried adding

Code: Select all

\fontencoding{OT1}\selectfont
at the beginning of my document which didn't have the effect I was hoping for (boldface and italic commands don't work anymore).

Does anyone know how can I use the fourier package (for the bomb symbol) but keep my original i.e. default text format?
Here is my example code (notice that \textbf has no effect when fourier package is turned on):

Code: Select all

\documentclass[12pt]{article}
 
\usepackage{latexsym,amssymb}
\usepackage[croatian]{babel}
\usepackage{fourier}

\setlength{\parindent}{0pt}

\begin{document}

\fontencoding{OT1}\selectfont

{\textit{\textbf{Funkcija}} This is some text. It doesn't mean anything.\\
\textbf{Never divide by zero!!!} \bomb\\

\end{document}
Thanks in advance.
Last edited by ivan_hr on Fri Mar 18, 2011 8:36 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

How to keep original font format with fourier package?

Post by localghost »

You seem to use the standard Computer Modern (CM) font for your document. Just load the Latin Modern (LM) fonts by the lmodern package to override fourier. Afterwards you still can use the bomb symbol.

Code: Select all

\documentclass[12pt,a4paper,croatian]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}   % insert special characters directly, other encoding possible
\usepackage{babel}
\usepackage{fourier}
\usepackage{lmodern}

\setlength{\parindent}{0pt}

\begin{document}
  \textit{\textbf{Funkcija}} This is some text. It doesn't mean anything. \textbf{Never divide by zero!!!} \bomb
\end{document}

Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ivan_hr
Posts: 18
Joined: Fri Dec 10, 2010 12:32 pm

How to keep original font format with fourier package?

Post by ivan_hr »

First of all thanks a lot for your answer localghost.

I have copied your code exactly and it has helped in getting the boldface and italic back, but now I have lost some of the math symbols in my document like + and >?
Here is the example which doesn't work as it should:

Code: Select all

\documentclass[12pt,a4paper,croatian]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fourier}
\usepackage{lmodern}

\setlength{\parindent}{0pt}

\begin{document}
{\textit{\textbf{Funkcija}} This is some text. It doesn't mean anything.\\
\textbf{Never divide by zero!!!} $x>0$ \bomb\\
$ax^2+bx+c=0$
\end{document}
Do you have any ideas how to fix this maybe?
Thanks in advance.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

How to keep original font format with fourier package?

Post by localghost »

Which editor do you use? It is important that the file is saved with the same encoding as chosen in the option for the inputenc package. See the package manual for details.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ivan_hr
Posts: 18
Joined: Fri Dec 10, 2010 12:32 pm

Re: How to keep original font format with fourier package?

Post by ivan_hr »

I'm using TeXworks editor and MikTeX 2.9 distribution. utf-8 encoding was/is selected as my default encoding.

Ivan
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Re: How to keep original font format with fourier package?

Post by localghost »

Then the code I provided should work as is. What does the log file say? Any irregularities? I also use TeXworks and don't face this problem.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
ivan_hr
Posts: 18
Joined: Fri Dec 10, 2010 12:32 pm

How to keep original font format with fourier package?

Post by ivan_hr »

This is the exact code that I'm running:

Code: Select all

\documentclass[12pt,a4paper,croatian]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fourier}
\usepackage{lmodern}

\setlength{\parindent}{0pt}

\begin{document}

{\textit{\textbf{Funkcija}} This is some text. It doesn't mean anything.\\

\textbf{Never divide by zero!!!} $x>0$ \bomb}\\
$ax^2+bx+c=0$

\end{document}
I thought it might be something to do with my computer or operating system (Win 7) but on another machine running Windows XP I still get the same result. I've included the output example and log file. I can't make much of the log file.
Attachments
bomb_log.log
log file
(36.58 KiB) Downloaded 344 times
output example
output example
output.jpg (12.42 KiB) Viewed 11392 times
User avatar
shadgrind
Posts: 140
Joined: Thu Jul 16, 2009 12:39 am

How to keep original font format with fourier package?

Post by shadgrind »

There does seem to be a conflict between the fourier and lmodern packages. But you can get around this by using just the fourier-orns package (for the bomb and other special symbols), without having to use lmodern:

Code: Select all

\documentclass[12pt,a4paper,croatian]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fourier-orns}

\setlength{\parindent}{0pt}

\begin{document}

{\textit{\textbf{Funkcija}} This is some text. It doesn't mean anything.\\

\textbf{Never divide by zero!!!} $x+0$ \bomb}\\
$ax^2+bx+c=0$

\end{document}
When you do it this way, Computer Modern will still be the default and all its usual math symbols will show up, and Fourier gets used only for some special symbols.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2
ivan_hr
Posts: 18
Joined: Fri Dec 10, 2010 12:32 pm

Re: How to keep original font format with fourier package?

Post by ivan_hr »

Thanks shadgrind,

This solves the problem with the math symbols. The only problem is that some capital letters in my document have gone haywired. Notice the letters T, E and A :?
Attachments
LatexError.JPG
LatexError.JPG (4.63 KiB) Viewed 11384 times
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

How to keep original font format with fourier package?

Post by localghost »

I could comprehend the problem. Some how I didn't notice that you added some math stuff to the code. The suggestion of shadgrind does the trick. If not done yet, install the cm-super package by the package manager of your TeX distribution.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply