Fonts & Character SetsMath capital characters

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

Good morning,
This is a test example:
************************************************************

Code: Select all

\documentclass{book}

\usepackage{amsmath,amssymb,amsthm,mathrsfs,amsfonts,xfrac,pifont,bbold,physics}

\title{MATH CAPITALS TEST}
\author{Jon A. Gomez}
\date{March 2024}

\begin{document}

This is mathcal test:

$\mathcal{A,H,L}$

This is mathscr test:

$\mathscr{A,H,L}$
\end{document}
***********************************************************************
The compiled text that I get corresponds with fonts \mathcal and \mathsrc

Nevertheless, on my document, in which I have coded in the preamble:

Code: Select all

\usepackage{amsmath,amssymb,amsthm,mathrsfs,amsfonts,xfrac,pifont,bbold,physics}
But, when I compile, the compiler gives the wrong font for

Code: Select all

\mathcal
: it gives a font corresponding to

Code: Select all

\mathscr
Can anyone help me on this issue?

Thanks so much,
Jon

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Math capital characters

Post by Stefan Kottwitz »

Hi Jon,

try this:

Code: Select all

\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
Stefan
LaTeX.org admin
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

Hi Stefan,
I've included

Code: Select all

\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
before

Code: Select all

\usepackage{amsmath,amssymb,amsthm,mathrsfs,amsfonts,xfrac,pifont,bbold,physics}
And the problem still continues.
On the other hand, I've made a test with

Code: Select all

\usepackage[mathscr]{euscript}
and the command

Code: Select all

$\mathscr{A}$
and have get an A letter in Euler type, which in fact is different to calligraphic type, the one I am trying to use (and so getting the good Lagrangian font).

Thanks again for your help. Hope you will finally get the right solution!

Best reghards,
Jon
Last edited by Jongomez on Sat Mar 23, 2024 8:54 pm, edited 1 time in total.
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

.../.. sorry, Stefan, I've forgot to say that your proposal didn't work.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Math capital characters

Post by Stefan Kottwitz »

Hi Jon,

Your example in the first post works correctly when I click on "Run LaTeX here." You said it doesn't work in your document, but don't show what you are doing differently there.

My proposal is a fix for some cases, like when another font, such as mathptmx, causes such a problem. I suggest that instead of describing some things you do (that I cannot emulate here), post a small example that has the issue so it can be fixed there.

Stefan
LaTeX.org admin
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

Hi Stefan,
I'll try to to as you suggest. Anyway, I supposse that I must include most of the preamble and a small part of the document, since the error could come from the configuration og the preamble. What do you think?

Jon
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

Here is the example, When compiled you will see that in the third line it appears the wrong character A. (text taken from my document).
*********************************************************************************************

Code: Select all

\documentclass[11pt,a4paper,oneside,openright,]{book}
\usepackage{graphicx,scalerel} % Required for inserting images +  anchura hat
\usepackage[margin=1.2in]{geometry} 
\usepackage[toc,page]{appendix}
\usepackage{enumitem}
\usepackage{natbib}
\usepackage{lipsum}
\usepackage{caption}
\usepackage[T1]{fontenc}
\usepackage{titlesec, blindtext, color}

\usepackage{amsmath,amssymb,amsthm,mathrsfs,amsfonts,xfrac,pifont,bbold,physics}

\usepackage [utf8]{inputenc}
\usepackage[breakable, theorems, skins]{tcolorbox}
\usepackage{mathtools}
\usepackage[spanish]{babel} % español

\usepackage[breakable, theorems, skins]{tcolorbox}
\usepackage[colorlinks = true,
            linkcolor = red,
            urlcolor  = blue,
            citecolor = red,
            anchorcolor = red]{hyperref}

\usepackage{booktabs}
\usepackage{soul}
\usepackage{frcursive}
\usepackage{enumitem}
\usepackage{fouriernc}  %% Type of font
\newcounter{micontador}
\usepackage{float}
\usepackage[section]{placeins}
\usepackage{imakeidx}

\makeindex[columns=2, title=Índice de términos]
\usepackage{relsize}
\usepackage{nicefrac}
\usepackage{engord}
\spanishdecimal{.}
% --
\usepackage{footnote}
\makesavenoteenv{tabular}

%**SEPARACION PARRAFOS**
\setlength{\parskip}{0.5\baselineskip plus2pt minus2pt}
\newcommand{\cmark}{\ding{51}}
\newcommand{\xmark}{\ding{55}}
%%%%%%%*multicolumnas%%%%%%%
\usepackage{multirow} 
\usepackage{array}

\DeclareCaptionLabelFormat{custom}
{#1 \textbf{#2}}
% Separator style
\DeclareCaptionLabelSeparator{custom}{colon}
% Caption format 

\DeclareCaptionFormat{custom}
{ #1\textbf{#2}\small{#3}}
\makeatletter
\makeatother
\usepackage{emptypage}

\begin{document}
Vamos a exponer una suposición oculta que no tuvimos en cuenta en el \textit{Volumen I}. Un experimento implica algo más que un sistema a estudiar. \textbf{También implica un aparato} $\mathcal{A}$ para hacer mediciones y registrar los resultados de las mediciones.
\end{document}
Good luck!

Jon
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Math capital characters

Post by Stefan Kottwitz »

Hi Jon,

with this example that shows the issue, it's clear; it's because of loading the fouriernc font; just use my proposed line after that.

Stefan
LaTeX.org admin
Jongomez
Posts: 48
Joined: Tue Nov 28, 2023 9:29 pm

Math capital characters

Post by Jongomez »

Perfect Stephan, it worked!

Thanks a lot for your support.
Best regards,
Jon
Post Reply