将输出 \theoremstyle{remark} 从斜体转换为粗体

将输出 \theoremstyle{remark} 从斜体转换为粗体

我正在使用它\theoremstyle{remark}来制作我的备忘单。

的输出\theoremstyle{remark}正是我需要的,因为它不会在定义之间产生任何空格。问题是的简介\theoremstyle{remark}是斜体,而我希望将其加粗。

图像

在这种情况下,T 3.51;D 3.52 和 T3.53 应该以粗体显示。

这是代码

\documentclass[9pt,landscape,a4paper]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage[landscape]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{color,graphicx,overpic}
\usepackage{hyperref}
\usepackage{graphicx,amsmath,amssymb,amsthm,latexsym,ifthen}
\usepackage[compact]{titlesec}
\usepackage{titlesec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% useful macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{remark}
\newtheorem{theorem}{T}[section]

\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{C}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{definition}[theorem]{D}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{example}{Example}%[section]
\newtheorem*{remark}{Remark}
\newtheorem*{notation}{Notation}
\newtheorem{question}{Question}

\theoremstyle{remark}
\newtheorem*{solution}{Solution}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{{\lVert#1\rVert}}

\def\NN{\mathbb{N}}
\def\ZZ{\mathbb{Z}}
\def\QQ{\mathbb{Q}}
\def\RR{\mathbb{R}}

\newcommand{\fat}[1]{\text{\boldmath$#1$}}


\renewcommand{\thefootnote}{[\arabic{footnote}]}

\pdfinfo{
  /Title (example.pdf)
  /Creator (TeX)
  /Producer (pdfTeX 1.40.0)
  /Author (Seamus)
  /Subject (Example)
  /Keywords (pdflatex, latex,pdftex,tex)}

% This sets page margins to .5 inch if using letter paper, and to 1cm
% if using A4 paper. (This probably isn't strictly necessary.)
% If using another size paper, use default 1cm margins.

    \ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
        {\geometry{top=0.2cm,left=0.2cm,right=0.2cm,bottom=0.2cm} }
        {\geometry{top=0.2cm,left=0.2cm,right=0.2cm,bottom=0.2cm} }
    

\titleformat*{\section}{\normal\bfseries}
\titleformat*{\subsection}{\Small\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titlespacing\section{0pt}{5pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{5pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}

% Turn off header and footer
\pagestyle{empty}


\setcounter{section}{1}


\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}


\begin{document}
\raggedright
\footnotesize
\begin{multicols}{4}


% multicol parameters
% These lengths are set only within the two main columns
%\setlength{\columnseprule}{0.25pt}
\setlength{\premulticols}{1pt}
\setlength{\postmulticols}{1pt}
\setlength{\multicolsep}{1pt}
\setlength{\columnsep}{1.5cm}
\setlength{\columnseprule}{0.2pt}

\section*{1 Numbers}
\subsection*{Natural Numbers}

\iffalse
\begin{definition}
We denote the set of \emph{natural numbers} by $\NN:=\{1,2,3,\dots\}$.
\end{definition}
\fi

\textbf{PeanoAxioms}\\
- 1 is natural number\\
- If n is a natural number, then its also $n'=n+1$\\
- 1 is not the successor of any natural number\\
- two natural numbers have same successor, then $n = m$\\
- a subset that contains 1 and successor $n'$ of any of its elements n, must be n itself.

\iffalse
\begin{definition}\label{definition:n-factorial}
For $n\in\NN$, the product of the numbers from 1 to $n$ is called ``\emph{n factorial}'',
$
  n! := \prod_{k=1}^n k.
$
\end{definition}
\fi

\begin{definition}\label{definition:binomial-coefficient}
For $n\in\NN$ and $k=0,1,\dots,n$, we define the \emph{binomial coefficient}
$
  \binom{n}{k} := \frac{n!}{k!(n-k)!}.
$
\end{definition}

\begin{definition}
\emph{integers} $\ZZ:=\{0,1,-1,2,-2,\dots\}$.
\end{definition}
\rule{0.3\linewidth}{0.25pt}
\scriptsize
\bibliographystyle{abstract}
\bibliography{refFile}
\end{multicols}
\end{document}

有没有办法将注释的斜体转换为粗体?我不能使用普通或其他,因为它们在每个字前后都会插入空格。

谢谢

答案1

Andrew Swann 的回答可能也是我实际会做的。话虽如此,我认为,为了将来参考,也应该提到阿姆斯特丹包允许您通过命令定义新的定理样式\newtheoremstyle。从“理论”的角度来看,这种方法可能更简洁,而且肯定更通用。

有关该命令的完整参考\newtheoremstyle,请参阅阿姆斯特丹包。以下代码说明了如何在我们的案例中使用它:

\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsthm}

\newtheoremstyle{boldremark}
    {\dimexpr\topsep/2\relax} % space above
    {\dimexpr\topsep/2\relax} % space below
    {}          % body font
    {}          % indent amount
    {\bfseries} % theorem head font
    {.}         % punctuation after theorem head
    {.5em}      % space after theorem head
    {}          % theorem hed spec. (empty = "normal")

\theoremstyle{boldremark}
\newtheorem{brem}{T}[section] % remarks are numbered within sections



\begin{document}
\section{\emph{Very} elementary mathematics}
Some text before the remark.
\begin{brem}
    It is well known that\[1+1=2\mbox{.}\]
\end{brem}
Some text after the remark.
\end{document}

输出结果如下:

在此处输入图片描述

答案2

amsthm.sty包含

\def\th@remark{%
  \thm@headfont{\itshape}%
  \normalfont % body font
  \thm@preskip\topsep \divide\thm@preskip\tw@
  \thm@postskip\thm@preskip
}

因此您可以复制此代码并将其替换\itshape\bfseries。您必须在宏名称中包含结果代码,\makeatletter...\makeatother因为@宏名称中有。

示例输出

\documentclass[9pt,landscape,a4paper]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage[landscape]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{color,graphicx,overpic}
\usepackage{hyperref}
\usepackage{graphicx,amsmath,amssymb,amsthm,latexsym,ifthen}
\usepackage[compact]{titlesec}
\usepackage{titlesec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% useful macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\makeatletter
\def\th@remark{%
  \thm@headfont{\bfseries}%
  \normalfont % body font
  \thm@preskip\topsep \divide\thm@preskip\tw@
  \thm@postskip\thm@preskip
}
\makeatother

\theoremstyle{remark}
\newtheorem{theorem}{T}[section]

\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{C}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{definition}[theorem]{D}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{example}{Example}%[section]
\newtheorem*{remark}{Remark}
\newtheorem*{notation}{Notation}
\newtheorem{question}{Question}

\theoremstyle{remark}
\newtheorem*{solution}{Solution}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{{\lVert#1\rVert}}

\def\NN{\mathbb{N}}
\def\ZZ{\mathbb{Z}}
\def\QQ{\mathbb{Q}}
\def\RR{\mathbb{R}}

\newcommand{\fat}[1]{\text{\boldmath$#1$}}


\renewcommand{\thefootnote}{[\arabic{footnote}]}

\pdfinfo{
  /Title (example.pdf)
  /Creator (TeX)
  /Producer (pdfTeX 1.40.0)
  /Author (Seamus)
  /Subject (Example)
  /Keywords (pdflatex, latex,pdftex,tex)}

% This sets page margins to .5 inch if using letter paper, and to 1cm
% if using A4 paper. (This probably isn't strictly necessary.)
% If using another size paper, use default 1cm margins.

    \ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
        {\geometry{top=0.2cm,left=0.2cm,right=0.2cm,bottom=0.2cm} }
        {\geometry{top=0.2cm,left=0.2cm,right=0.2cm,bottom=0.2cm} }


\titleformat*{\section}{\normalsize\bfseries}
\titleformat*{\subsection}{\small\bfseries}
\titleformat*{\subsubsection}{\large\bfseries}
\titlespacing\section{0pt}{5pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}
\titlespacing\subsection{0pt}{5pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}

% Turn off header and footer
\pagestyle{empty}


\setcounter{section}{1}


\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}


\begin{document}
\raggedright
\footnotesize
\begin{multicols}{4}


% multicol parameters
% These lengths are set only within the two main columns
%\setlength{\columnseprule}{0.25pt}
\setlength{\premulticols}{1pt}
\setlength{\postmulticols}{1pt}
\setlength{\multicolsep}{1pt}
\setlength{\columnsep}{1.5cm}
\setlength{\columnseprule}{0.2pt}

\section*{1 Numbers}
\subsection*{Natural Numbers}

\iffalse
\begin{definition}
We denote the set of \emph{natural numbers} by $\NN:=\{1,2,3,\dots\}$.
\end{definition}
\fi

\textbf{PeanoAxioms}\\
- 1 is natural number\\
- If n is a natural number, then its also $n'=n+1$\\
- 1 is not the successor of any natural number\\
- two natural numbers have same successor, then $n = m$\\
- a subset that contains 1 and successor $n'$ of any of its elements n, must be n itself.

\iffalse
\begin{definition}\label{definition:n-factorial}
For $n\in\NN$, the product of the numbers from 1 to $n$ is called ``\emph{n factorial}'',
$
  n! := \prod_{k=1}^n k.
$
\end{definition}
\fi

\begin{definition}\label{definition:binomial-coefficient}
For $n\in\NN$ and $k=0,1,\dots,n$, we define the \emph{binomial coefficient}
$
  \binom{n}{k} := \frac{n!}{k!(n-k)!}.
$
\end{definition}

\begin{definition}
\emph{integers} $\ZZ:=\{0,1,-1,2,-2,\dots\}$.
\end{definition}
\rule{0.3\linewidth}{0.25pt}
\scriptsize
\bibliographystyle{abstract}
\bibliography{refFile}
\end{multicols}
\end{document}

相关内容