レイアウトを調整するための \footnote の代替の定義

レイアウトを調整するための \footnote の代替の定義

これは次の質問の続きです脚注番号と定理のタイトルの距離

を定義するのに問題があります。問題は、MEWで見られるように、コマンド\thfootnoteのオプション引数に関するものです。\footnote

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\newtheorem{theorem}{Theorem}
\newcommand{\thfootnote}[2][]{\hspace{-0.4em}\footnote[#1]{#2}\hspace{0.3em}}
\begin{document}
\section{Something}
\begin{theorem}[Something]\footnote{Something}
Blah blah.
\end{theorem}
\begin{theorem}[Something]\thfootnote{Something}
Blah blah.
\end{theorem}
\end{document}

答え1

によるとあなたのコメント、これがあなたが望んでいることだと私は信じています:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{etoolbox}

\newtheorem{theorem}{Theorem}

\newcommand{\thfootnote}[2][]{%
  \hspace{-0.4em}%
  \ifstrempty{#1}{\footnote}{\footnote[#1]}%
  {#2}\hspace{0.3em}}

\begin{document}

\section{Something}

\begin{theorem}[Something]\footnote{Something}
Blah blah.
\end{theorem}

\begin{theorem}[Something]\thfootnote{Something}
Blah blah.
\end{theorem}

\end{document}

スクリーンショット

{#2}( TeXはマクロ言語なので、どちらの選択肢にもを含める必要はありません。できたただし、害なく含めることができます。

のオプション引数内でスペースを許容したい場合\thfootnote(空白のオプション引数を空として扱う場合)は、\ifstremptyを に置き換えるだけです\ifblank

答え2

の目的が何なのかはわかりません\thfootnoteが、定理の各脚注の前に と書かずにスペースを取り除きたい場合は\hspace{-0.4em}、新しい脚注を 1 つの引数だけで定義できます。その後、他の脚注の番号付けに関連付けます。MWE を参照してください。目的が異なる場合は、質問を詳しく説明してください。

複数の脚注シリーズが必要な場合は、以下を参照してください。ビッグフットまたはメニーフットまた、標準の article クラスでは脚注がページの下部に配置されず、テキストから一定の距離に配置されることにも注意してください。そのため、オプション で footmisc を読み込むかbottomKOMA スクリプトクラス。

ここに画像の説明を入力してください

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\newtheorem{theorem}{Theorem}
\newcommand{\thfootnote}[1]{\hspace{-0.4em}\footnote{#1}\hspace{0.3em}}
\begin{document}
\section{Something}
\begin{theorem}[Something]\footnote{Something}
Blah blah.
\end{theorem}
\begin{theorem}[Something]\thfootnote{Something}
Blah blah.
\end{theorem}

\begin{theorem}[\footnote{Something}]
Blah blah.
\end{theorem}

\end{document}

関連情報