Teoremas de formatação

Teoremas de formatação

Esta é minha melhor tentativa de alcançar o formato que desejo em LaTeX:

\documentclass{article}

\usepackage[a4paper, total={160mm, 247mm}]{geometry}

\usepackage{color}
\definecolor{medred}{rgb}{0.75, 0, 0} % medium red

\usepackage{amsfonts, amsmath, amsthm}

\newtheoremstyle{definition}
    {12pt} % Space above
    {12pt} % Space below
    {\sffamily} % Body font
    {0pt} % Indent amount
    {\sffamily\bfseries} % Theorem head font
    {: } % Punctuation after theorem head
    {0pt} % Space after theorem head
    {} % Theorem head spec (can be left empty, meaning ‘normal’
\theoremstyle{definition}
\newtheorem{definition}{\textcolor{medred}{Definition}}

\begin{document}
    
    \begin{definition}{$\mathbb{N}^+$}\\
        $\mathbb{N}^+$ is the set of all positive natural numbers:
        \begin{equation*}
            \mathbb{N}^+:=\{1, 2, 3, \ldots\}
        \end{equation*}
    \end{definition}

    \begin{definition}{$\mathbb{N}_0$}\\
        $\mathbb{N}_0$ is the set of natural numbers including $0$:
        \begin{equation*}
            \mathbb{N}_0:=\{0, 1, 2, 3, \ldots\}
        \end{equation*}
    \end{definition}

    \begin{definition}{Collatz sequence}\\
        A \textit{Collatz sequence} is a mapping of all numbers from the set $\mathbb{N}_0$, called indices, to numbers from the set $\mathbb{N}^+$, called sequence members …
    \end{definition}

\end{document}

Isto é o que eu recebo:
formato resultante


Mas é isso que eu realmente quero. (Foi criado com Microsoft Word. Infelizmente, isso requer numeração manual das definições, mas preciso de numeração automática, por isso prefiro escrever o documento com LaTeX.)
formato desejado

Pelo que sei, uma definição tem 5 partes:

  1. tipo= A sequência Definition. É definido na linha 20 junto com sua cor vermelha como argumento do comando \newtheorem. (O caractere de espaço no final da string não deve fazer parte desse argumento, pois o latex o adiciona automaticamente.)
  2. número sequencial= O número que aparece imediatamente após o tipo e é aumentado automaticamente a cada nova definição. Consegui obter números em negrito (acho que porque fazem parte da 'cabeça do teorema'), mas não consegui torná-los vermelhos e não tenho ideia de como fazer isso.
  3. pontuação= a sequência :. É o sétimo argumento do comando \newtheoremstyle que começa na linha 10. Novamente: posso deixar esta string em negrito, mas não posso torná-la vermelha.
  4. título= a string que nos meus exemplos está na mesma linha dos elementos mencionados anteriormente. É o nome da coisa que será definida. Mas obviamente este título e o próximo elemento que chamo'corpo'pertencem tanto ao que é chamado'corpo do teorema'nos manuais. Posso deixar o título e o corpo em negrito ou sem negrito alterando o quarto argumento do comando \newtheoremstyle. Mas quero que esta parte fique em negrito e vermelho e o próximo elemento seja preto e normal.
  5. corpo= Esta é a definição da coisa nomeada no elemento title. Quero que apareça em um formato diferente do título (preto e normal)

Como posso conseguir esses formatos?


Tenho dois desejos adicionais, ambos menos importantes ("é bom ter", mas não "obrigatório"):

  1. Quero especificar uma determinada fonte (como Arial, Calibiri ou Libertine), não apenas uma família de fontes (como \sffamily). Onde posso encontrar uma documentação curta, mas boa, que descreva isso?

  2. Também quero que $\mathbb{N}^+$ e outras expressões matemáticas que aparecem no título de uma definição também estejam em negrito. Eu também não consegui fazer isso no MS-Word (bem, eu poderia formatar em negrito no word, mas só o subscrito 0 em N₀ ficou em negrito, mas nem o N nem o + mudaram de aparência), então acho que é um problema com as fontes matemáticas que não fornecem símbolos em negrito. Existe uma solução alternativa para resolver esse problema?

Responder1

Como disse @John Kormylo, algumas fontes não possuem versão em negrito.

\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\definecolor{medred}{rgb}{0.75,0,0}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[bb=boondox]{mathalpha}
\newtheoremstyle{definition}
{12pt}
{12pt}
{\fontspec{Arial}}
{0pt}
{\fontspec{Arial}\bfseries\boldmath\color{medred}}
{\newline}
{0pt}
{\thmname{#1}\space\thmnumber{#2}:\space\thmnote{#3}}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\begin{document}
\begin{definition}[$\mathbb{N}^+$]
$\mathbb{N}^+$ is the set of all positive natural numbers:
\begin{equation*}
\mathbb{N}^+:=\{1, 2, 3, \ldots\}
\end{equation*}
\end{definition}
\begin{definition}[$\mathbb{N}_0$]
$\mathbb{N}_0$ is the set of natural numbers including $0$:
\begin{equation*}
\mathbb{N}_0:=\{0, 1, 2, 3, \ldots\}
\end{equation*}
\end{definition}
\begin{definition}[Collatz sequence]
A \textit{Collatz sequence} is a mapping of all numbers from the set $\mathbb{N}_0$, called indices, to numbers from the set $\mathbb{N}^+$, called sequence members …
\end{definition}
\end{document}

insira a descrição da imagem aqui

Responder2

Não acho que você queira usar a fonte “qualquer” nas declarações de definições. Se você quiser usar sans serif para eles, tudo bem, mas deve haver uma única fonte sans serif em um documento, ou ela aparecerá como uma colcha de retalhos.

Aqui eu defino uma fonte sans serif diferente, ou seja, Source Sans Pro. Use fontspeccom XeLaTeX ou LuaLaTeX se quiser ter mais liberdade nessa escolha, com \setsansfont.

Adicionei exemplos de definições não numeradas ou sem título, onde você provavelmente deseja omitir os dois pontos.

\documentclass{article}

\usepackage[a4paper, total={160mm, 247mm}]{geometry}
\usepackage{xcolor}
\usepackage{amsfonts, amsmath, amsthm}
\usepackage[default]{sourcesanspro}

\definecolor{medred}{rgb}{0.75, 0, 0} % medium red

\newtheoremstyle{mydef}
  {12pt} % Space above
  {12pt} % Space below
  {\sffamily} % Body font
  {0pt} % Indent amount
  {\color{medred}\sffamily\bfseries} % Theorem head font
  {} % Punctuation after theorem head (the spec below take care)
  {\newline} % Space after theorem head
  {\thmname{#1}\thmnumber{ #2}\thmnote{: #3}}

\theoremstyle{mydef}

\newtheorem{definition}{Definition}
\newtheorem*{definition*}{Definition}% just to test

\begin{document}
    
\begin{definition}[$\mathbb{N}^+$]
  $\mathbb{N}^+$ is the set of all positive natural numbers:
  \begin{equation*}
    \mathbb{N}^+:=\{1, 2, 3, \dotsc\}
  \end{equation*}
\end{definition}

\begin{definition}[$\mathbb{N}_0$]
  $\mathbb{N}_0$ is the set of natural numbers including $0$:
  \begin{equation*}
    \mathbb{N}_0:=\{0, 1, 2, 3, \dotsc\}
  \end{equation*}
\end{definition}

\begin{definition*}[Collatz sequence]
  A \textit{Collatz sequence} is a mapping of all numbers from 
  the set $\mathbb{N}_0$, called indices, to numbers from the set 
  $\mathbb{N}^+$, called sequence members …
\end{definition*}

\begin{definition}
  This definition has no title
\end{definition}

\begin{definition*}
  This definition has no title and no number
\end{definition*}

\end{document}

insira a descrição da imagem aqui

informação relacionada