我有这个代码:
\documentclass[11pt]{book}
%----------------------------------------------------------------------------------------
% VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
%----------------------------------------------------------------------------------------
\usepackage[top=3cm,bottom=3cm,left=3cm,right=3cm,headsep=10pt,a4paper]{geometry} % Page margins
\usepackage{tikz} % Required for drawing custom shapes
\usetikzlibrary{patterns,calc,matrix,intersections,circuits.logic.US}
\usepackage{booktabs} % Required for nicer horizontal rules in tables
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{ocre}{RGB}{243,102,25} % Define the orange color used for highlighting throughout the book
\usepackage{nicefrac} % For comparison
\usepackage{microtype} % for better kerning in narrow columns
\usepackage[bottom]{footmisc} % Place a footnote in an environment in the bottom of the page
%----------------------------------------------------------------------------------------
% FONTS
%----------------------------------------------------------------------------------------
\usepackage{avant} % Use the Avantgarde font for headings
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{textcomp}
\usepackage{eurosans}
% Removes the header from odd empty pages at the end of chapters
\makeatletter
%----------------------------------------------------------------------------------------
% THEOREM STYLES
%----------------------------------------------------------------------------------------
\usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc
\newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
\newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
\newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
% Boxed/framed environments
\newtheoremstyle{ocrenumbox}% % Theorem style name
{0pt}% Space above
{0pt}% Space below
{\normalfont}% % Body font
{}% Indent amount
{\small\bf\sffamily\color{ocre}}% % Theorem head font
{\;}% Punctuation after theorem head
{0.25em}% Space after theorem head
{\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
\thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}---\nobreakspace#3.}} % Optional theorem note
\renewcommand{\qedsymbol}{$\blacksquare$}% Optional qed square
\makeatother
% Defines the theorem text style for each type of theorem to one of the three styles above
\newcounter{dummy}
\numberwithin{dummy}{section}
\theoremstyle{ocrenumbox}
\newtheorem{definitionT}{Definizione}[section]
%----------------------------------------------------------------------------------------
% DEFINITION OF COLORED BOX
%----------------------------------------------------------------------------------------
\RequirePackage[framemethod=default]{mdframed} % Required for creating the definition box
% Definition box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=ocre,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=0pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=4pt,
innerbottommargin=0pt]{dBox}
% Creates the environment ---> @iacopo suggestion <---
\newenvironment{definition}[1]{\begin{dBox}\begin{definitionT}\item[\hskip \labelsep] {\bfseries #1}}{\end{definitionT}\end{dBox}}
\begin{document}
\begin{definition}
Nella teoria dei circuiti numerici, la logica sequenziale è un tipo di circuito logico dove l'uscita dipende non solo dal valore attuale dei suoi segnali di ingresso ma anche dalla sequenza degli ingressi passati: la cronologia degli ingressi stessi.
\footnote{Vai, M. Michael (2000). VLSI Design. CRC Press. p. 147. ISBN 0849318769. \\ Cavanagh, Joseph (2006). Sequential Logic: Analysis and Synthesis. CRC Press. pp. ix. ISBN 0849375649 \\ Lipiansky, Ed (2012). Electrical, Electronics, and Digital Hardware Essentials for Scientists and Engineers. John Wiley and Sons. p. 8.39. ISBN 1118414543. \\ Dally, William J.; Harting, R. Curtis (2012). Digital Design: A Systems Approach. Cambridge University Press. p. 291. ISBN 0521199506.}
\end{definition}
\end{document}
产生这样的结果:
但我希望它\footnote
不是在环境中,而是在页面的底部。
答案1
这是一个您可以使用的解决方案。
\documentclass[11pt]{book}
%----------------------------------------------------------------------------------------
% VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
%----------------------------------------------------------------------------------------
\usepackage[top=3cm,bottom=3cm,left=3cm,right=3cm,headsep=10pt,a4paper]{geometry} % Page margins
\usepackage{tikz} % Required for drawing custom shapes
\usetikzlibrary{patterns,calc,matrix,intersections,circuits.logic.US}
\usepackage{booktabs} % Required for nicer horizontal rules in tables
\usepackage{xcolor} % Required for specifying colors by name
\definecolor{ocre}{RGB}{243,102,25} % Define the orange color used for highlighting throughout the book
\usepackage{nicefrac} % For comparison
\usepackage{microtype} % for better kerning in narrow columns
\usepackage[bottom]{footmisc} % Place a footnote in an environment in the bottom of the page
%----------------------------------------------------------------------------------------
% FONTS
%----------------------------------------------------------------------------------------
\usepackage{avant} % Use the Avantgarde font for headings
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{textcomp}
\usepackage{eurosans}
% Removes the header from odd empty pages at the end of chapters
\makeatletter
%----------------------------------------------------------------------------------------
% THEOREM STYLES
%----------------------------------------------------------------------------------------
\usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc
\newcommand{\intoo}[2]{\mathopen{]}#1\,;#2\mathclose{[}}
\newcommand{\ud}{\mathop{\mathrm{{}d}}\mathopen{}}
\newcommand{\intff}[2]{\mathopen{[}#1\,;#2\mathclose{]}}
% Boxed/framed environments
\newtheoremstyle{ocrenumbox}% % Theorem style name
{0pt}% Space above
{0pt}% Space below
{\normalfont}% % Body font
{}% Indent amount
{\small\bf\sffamily\color{ocre}}% % Theorem head font
{\;}% Punctuation after theorem head
{0.25em}% Space after theorem head
{\small\sffamily\color{ocre}\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
\thmnote{\nobreakspace\the\thm@notefont\sffamily\bfseries\color{black}---\nobreakspace#3.}} % Optional theorem note
\renewcommand{\qedsymbol}{$\blacksquare$}% Optional qed square
\makeatother
% Defines the theorem text style for each type of theorem to one of the three styles above
\newcounter{dummy}
\numberwithin{dummy}{section}
\theoremstyle{ocrenumbox}
\newtheorem{definitionT}{Definizione}[section]
%----------------------------------------------------------------------------------------
% DEFINITION OF COLORED BOX
%----------------------------------------------------------------------------------------
\RequirePackage[framemethod=default]{mdframed} % Required for creating the definition box
% Definition box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=ocre,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=0pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=4pt,
innerbottommargin=0pt]{dBox}
\usepackage{footnote}
\usepackage{etoolbox}
\newtoggle{indefintion}
\togglefalse{indefintion}
\pretocmd{\footnote}{\iftoggle{indefintion}{\stepcounter{footnote}}{\relax}}{}{}
% Creates the environment ---> @iacopo suggestion <---
\newenvironment{definition}[1]{%
\savenotes
\begin{dBox}\begin{definitionT}
\toggletrue{indefintion}
\renewcommand{\thempfootnote}{\arabic{footnote}}
\item[\hskip \labelsep]
{\bfseries #1}}{\end{definitionT}\end{dBox}
\togglefalse{indefintion}
\spewnotes}
\begin{document}
\begin{definition}
Nella teoria dei circuiti numerici, la logica sequenziale è un tipo
di circuito logico dove l'uscita dipende non solo dal valore attuale
dei suoi segnali di ingresso ma anche dalla sequenza degli ingressi
passati: la cronologia degli ingressi stessi. \footnote{Vai,
M. Michael (2000). VLSI Design. CRC Press. p. 147. ISBN
0849318769. \\ Cavanagh, Joseph (2006). Sequential Logic: Analysis
and Synthesis. CRC Press. pp. ix. ISBN 0849375649 \\ Lipiansky, Ed
(2012). Electrical, Electronics, and Digital Hardware Essentials
for Scientists and Engineers. John Wiley and Sons. p. 8.39. ISBN
1118414543. \\ Dally, William J.; Harting, R. Curtis
(2012). Digital Design: A Systems Approach. Cambridge University
Press. p. 291. ISBN 0521199506.}
\end{definition}
\bigskip
Let us add some text here and add a footnote to it\footnote{Yes, this
footnote is to \textit{normal} text.}.
\bigskip
And then we add another definition without any footnote.
\bigskip
\begin{definition}
NO FOOTNOTE IS THIS ONE. The footnote counter must not misbehave.
Nella teoria dei circuiti numerici, la logica sequenziale è un tipo
di circuito logico dove l'uscita dipende non solo dal valore attuale
dei suoi segnali di ingresso ma anche dalla sequenza degli ingressi
passati: la cronologia degli ingressi stessi.
\end{definition}
\bigskip
And another definition with a footnote.
\bigskip
\begin{definition}
A FOOTNOTE IS THIS ONE. The footnote counter must be updated properly.
Nella teoria dei circuiti numerici, la logica sequenziale è un tipo
di circuito logico dove l'uscita dipende non solo dal valore attuale
dei suoi segnali di ingresso ma anche dalla sequenza degli ingressi
passati: la cronologia degli ingressi stessi. \footnote{TeXSE is a
wonderful site.}
\end{definition}
\end{document}
怎么运行的?
为了解决这个问题,我必须克服许多困难。我将逐一描述它们,希望这也能解释解决方案的具体工作原理:
- 为了显示发布的脚注
mdframed
(用于dBox
创作),我们实际上需要推迟脚注创作,直到我们出去的dBox
。我们通过使用 ,\savenotes
命令对来实现这一点\spewnotes
。我们使用\savenotes
before\begin{dBox}
开始保存脚注,使用\spewnotes
after 命令\end{dBox}
在最后执行所有脚注,从而将它们置于正常页面场景中。 - 上述方法运行良好,但我们随后注意到,在上述情况下,脚注计数器需要手动增加。这可以通过发出一个简单的
\stepcounter{footnote}
内部命令来实现dBox
。 - 这会产生另一个问题。即使该特定 中没有任何脚注,脚注计数器也会递增
dBox
。并且天真地为每个脚注递增脚注计数器将意味着混淆正常的文本脚注,因为计数器是自动处理的。 - 为了解决上述问题,我们定义了一个切换开关
indefintion
,在开始时将其设置为 false(默认,但仍然需要手动设置)。在定义开始时,它被设置为 true,在完成定义之前,我们将其重新设置为 false。 - 为了利用上述切换,我们在命令开头附加了条件检查,以测试我们是否在定义内 。为此,
\footnote
我们使用\pretocmd
命令 from 。etoolbox
我们已经针对三种情况测试了该功能:
- 带有脚注的定义,
- 没有脚注的定义,
- 普通文本中的脚注。
全部测试均成功。
要了解有关\savenotes
,\spewnotes
命令对的更多信息,请参阅footnote
包装文件。要了解有关该\pretocmd
命令的更多信息,请参阅记录
etoolbox
(3.4 修补),或者这个精彩答案。
答案2
这是一个解决方案,我只是\usepackage[bottom]{footmisc}
为了您的目的而添加它:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[bottom]{footmisc}
\begin{document}
\newenvironment{definition}[1][Definizione]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}}
\begin{definition}
Nella teoria dei circuiti numerici, la logica sequenziale è un tipo di circuito logico dove l' uscita dipende non solo dal valore attuale dei suoi segnali di ingresso ma anche dalla sequenza degli ingressi passati: la cronologia degli ingressi stessi.
\footnote{Vai, M. Michael (2000). VLSI Design. CRC Press. p. 147. ISBN 0849318769. \\ Cavanagh, Joseph (2006). Sequential Logic: Analysis and Synthesis. CRC Press. pp. ix. ISBN 0849375649 \\ Lipiansky, Ed (2012). Electrical, Electronics, and Digital Hardware Essentials for Scientists and Engineers. John Wiley and Sons. p. 8.39. ISBN 1118414543. \\ Dally, William J.; Harting, R. Curtis (2012). Digital Design: A Systems Approach. Cambridge University Press. p. 291. ISBN 0521199506.}
\end{definition}
\end{document}
这是我的结果:
你应该检查这里。