mdframed 环境中的旁注,Tufte-LateX

mdframed 环境中的旁注,Tufte-LateX

我正在寻找一种在 Tufte-LaTeX 上的 mdframed 环境中放置旁注的方法。文本将在框内引用,注释位于边距中。

我已经找到了一种在文章文档类中使用脚注来做同样的事情的奇特方法(在页面底部的环境中放置脚注)下面是我针对此案例的最小工作版本:

\documentclass{article}

\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{amsmath,amsthm}
\usepackage{xcolor}
\usepackage{etoolbox} % Necessary for the toggle 
\usepackage{footnote}
\usepackage[framemethod=default]{mdframed} % Required for creating the definition box


%----------------------------------------------------------------------------------------
%   THEOREM STYLES
%----------------------------------------------------------------------------------------

\definecolor{thmcolor}{rgb}{0.71,0.14,0.07}

% Boxed/framed environments
\newtheoremstyle{redThm}  % Theorem style name
{0pt}                     % Space above
{0pt}                     % Space below
{\normalfont}             % Body font
{}                        % Indent amount
{\small\bf\sffamily\color{thmcolor}}% % Theorem head font
{\;}                      % Punctuation after theorem head
{0.25em}                  % Space after theorem head
{\small\sffamily\color{thmcolor}\thmname{#1}\nobreakspace\thmnumber{#2}% Theorem text (e.g. Theorem 2.1)
    \thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}---\nobreakspace#3.}} % Optional theorem note

\theoremstyle{redThm}
\newtheorem{defn}{Définition}[section]

%----------------------------------------------------------------------------------------
%   DEFINITION OF COLORED BOX
%----------------------------------------------------------------------------------------

% Definition box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=thmcolor,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=0pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=4pt,
innerbottommargin=0pt]{vBar}    

\newtoggle{indefintion}
\togglefalse{indefintion}
\pretocmd{\footnote}{\iftoggle{indefintion}{\stepcounter{footnote}}{\relax}}{}{}

% Creates the environment ---> @iacopo suggestion <---
\newenvironment{definition}[1]{%
  \savenotes
  \begin{vBar}\begin{defn}
      \toggletrue{indefintion}
      \renewcommand{\thempfootnote}{\arabic{footnote}}
    \item[\hskip \labelsep]
      {\bfseries #1}}{\end{defn}\end{vBar}
  \togglefalse{indefintion}
\spewnotes}

\begin{document}

\begin{definition}
  My definition.\footnote{My footnote.}
\end{definition}

\bigskip

My text.\footnote{Core text footnote}.  

\end{document}

通过侧注更改脚注不足以使其在 tufte-latex 文档类中工作:我想将 /savenote、/spewnote 技巧应用于侧注,同时使用切换技巧保持页面内的一致编号(当定理中没有侧注时允许不增加计数器)。

相关内容