3

I am trying to write an article with Palatino font. I loaded the following packages, among others:

\usepackage{mathpazo}
\usepackage{avant}

In my first attempt of writing the letter $\Omega$ it worked. But when I attempted to write this letter inside of a table cell, I obtained the following output:

Code output

Where instead of the black squares in the middle column, it should appear the letter $\Omega$. The piece code I wrote for this table is the following:

\begin{table}[ht!]
\centering
\begin{tabular}{|c|c|c|}
   \hline
   Filtre & Resistència & Condensador\\
   \hline
   1 &  $R_1=10\hspace{1mm} \mathrm{k\Omega}$ & $C_1=1\hspace{1mm}\mathrm{nF}$\\
   2 & $R_2=100\hspace{1mm} \mathrm{\Omega}$ & $C_2=100\hspace{1mm} \mathrm{nF}$\\
   3 & $R_3=1\hspace{1mm} \mathrm{M\Omega}$ & $C_3=10\hspace{1mm} \mathrm{pF}$\\
   \hline
\end{tabular}
\end{table}

So there's my question. I don't know how to fix this, maybe I should load a package that allows me to use greek letters in a table when using this font, or something different. If I write greek letters out of a table, it works perfectly.

3 Answers 3

4

\mathrm{\Omega} is wrong as it points to a non existent character. You should use siunitx, instead of doing manual markup.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[catalan]{babel}
\usepackage[sc]{mathpazo}
\usepackage{siunitx}

\begin{document}

\begin{tabular}{|c|c|c|}
\hline
Filtre & Resistència & Condensador\\
\hline
1 & $R_1=  \SI{10}{\kilo\ohm}$ & $C_1=\SI{1}{\nano\farad}$ \\
2 & $R_2= \SI{100}{\ohm}$      & $C_2=\SI{100}{\nano\farad}$ \\
3 & $R_3=   \SI{1}{\mega\ohm}$ & $C_3=\SI{10}{\pico\farad}$ \\
\hline
\end{tabular}

\end{document}

enter image description here

2
  • Thank you! I see it's more comfortable to do that by using the units package instead of typing the units everytime. Good answer, and well seen that the text was written in Catalan!
    – Airman01
    Nov 8, 2015 at 14:01
  • @Airman01 I guessed from Resistència; the grave accent was revealing.
    – egreg
    Nov 8, 2015 at 14:16
2

Remove \mathrm command and simply use \Omega command alone. You will get omega symbol

1
  • Thank you, this is a simple solution and it worked perfectly as well!
    – Airman01
    Nov 8, 2015 at 14:01
1

I propose two solutions based on siunitx and some improvements with the makecell and booktabs packages:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo, avant}
\usepackage{booktabs, caption, makecell, siunitx}
\setlength\defaultaddspace{1ex}
\renewcommand\theadfont{\normalsize}
\setcellgapes{3pt}
\begin{document}

\begin{table}[!ht]
  \centering\makegapedcells
  \begin{tabular}{|c|l|l|}
    \hline
    Filtre & \thead{Resistència} & \thead{Condensador} \\
    \hline
    1 & $R_1=10 \SI{10}{\kilo\ohm}$ &
    $C_1= \SI{1}{\nano F}$\\
    2 & $R_2=\SI{100}{\ohm}$ & $C_2=\SI{100}{\nano F}$ \\
    3 & $R_3=\SI{1}{\mega\ohm}$ & $ C_3=\SI{10}{\pico F}$ \\
    \hline
  \end{tabular}
\end{table}

\begin{table}[!ht]
  \centering
  \begin{tabular}{cll}
    \toprule
    Filtre & \thead{Resistència} & \thead{Condensador} \\
    \cmidrule(lr){1-1} \cmidrule(lr){2-2} \cmidrule(lr){3-3}
    1 & $R_1=10 \SI{10}{\kilo\ohm}$ &
    $C_1= \SI{1}{\nano F}$\\
    \addlinespace
    2 & $R_2=\SI{100}{\ohm}$ & $C_2=\SI{100}{\nano F}$ \\
    \addlinespace
    3 & $R_3=\SI{1}{\mega\ohm}$ & $ C_3=\SI{10}{\pico F}$ \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document} 

enter image description here

You must log in to answer this question.

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