
Ich möchte die Standardschriftart in allen Tabellen meines Dokuments ändern. Statt der Schriftart Computer Modern Roman bevorzuge ich Bitstream Charter Mathdesign (dieselbe Familie), die „kondensiert“ ist:
\documentclass{article}
\usepackage[charter, uppercase=upright]{mathdesign}
\makeatletter
\renewcommand{\sfdefault}{cmr}
\g@addto@macro{\table}{\fontencoding{T1}\fontfamily{mdbch}\selectfont}
\makeatother
\begin{document}
\begin{table}
\caption{My Table}\label{tab:table}
\centering
\begin{tabular}{cc}\hline
X & Y \\ \hline
x1 & y1 \\
x2 & y2 \\ \hline
\end{tabular}
\end{table}
Some short text outside a table in a current font.
\end{document}
Mit dem folgenden Code wird die Schriftart Mathdesign für das gesamte Dokument verwendet :-(
Vielen Dank für Ihre Hilfe.
Antwort1
Vermutlich anders gelöst, mit dem Umgebungsbefehl und einem anderen Spitznamen:
\documentclass{article}
\makeatletter
\renewenvironment{table}
{\renewcommand\familydefault{mdbch}
\@float{table}}
{\end@float}
\makeatother
\begin{document}
\begin{table}
\caption{My Table}\label{tab:table}
\centering
\begin{tabular}{cc}\hline
X & Y \\ \hline
x1 & y1 \\
x2 & y2 \\ \hline
\end{tabular}
\end{table}
Some short text outside a table in a current font.
\end{document}
Vielleicht hilft es....