我对 LaTeX 脚注中的缩进有一个小问题:
\documentclass[draft,12pt,a4paper]{article}
\usepackage[footnote,printonlyused]{acronym}
\begin{document}
foo\footnote{foo: this footnotetext explaines what foo is}
bar\footnote{bar: this very very very very very very very long text explains in two lines what bar is, it would be nice if this line is indented behind the colon, starting below the 'this'}
\end{document}
如您在示例中所见,我再次在脚注中重复了附有脚注的单词,到目前为止一切正常。但如果脚注中的文本过多,以至于它在脚注中产生多行,则看起来“错误”:第二行中的文本从行首开始,而不是在冒号和随后的空格后的第一个字母下方。我如何调整第二行前面的空间,以便文本更靠近页面中间开始?
目前的示例:
foo¹
bar²
-----------
¹ foo: this footnotetext explaines what foo is
² bar: this very very very very very very very long text explains in two lines what bar
is, it would be nice if this line is indented behind the colon, starting below the 'this'
例如应该如下所示:
foo¹
bar²
-----------
¹ foo: this footnotetext explaines what foo is
² bar: this very very very very very very very long text explains in two lines what bar
is, it would be nice if this line is indented behind the colon, starting below
the 'this'
答案1
也许这有帮助。这里。这是该命令的完整定义。
\deffootnote[<width of mark>]
{<indent of footnote text>}
{<paragraph indent in the footnote text>}
{<definition of mark>}
代码:
\documentclass[draft,12pt,a4paper]{article}
\usepackage[footnote,printonlyused]{acronym}
\usepackage{scrextend}
\deffootnote[1.0em]{3.2em}{10em}
{\textsuperscript{\thefootnotemark}\,\enskip}
\begin{document}
foo\footnote{foo: this footnotetext explaines what foo is}
bar\footnote{bar: this very very very very very very very long text explains in two lines what bar is, it would be nice if this line is indented behind the colon, starting below the 'this'.}
\end{document}
答案2
你可以使用 lockstep 的答案来这个问题:
\documentclass{article}
\usepackage{scrextend}
\deffootnote{0em}{1.6em}{\thefootnotemark.\enskip}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\blindtext\footnote{\blindtext}\\
foo\footnote{foo: this footnotetext explaines what foo is}\\
bar\footnote{bar: this very very very very very very very long text explains in two lines what bar is, it would be nice if this line is indented behind the colon, starting below the 'this'}
\end{document}
答案3
评论太长:我尝试写一些取决于评论长度的内容描述标签(如果你想这样称呼它)。正如我在评论中提到的,结果看起来会很奇怪。我建议使用固定缩进,这将使您的文章/报告/书籍/...看起来更统一。
\documentclass[draft,12pt,a4paper]{article}
\usepackage{showframe}
\usepackage{scrextend}
\deffootnote[1.0em]{3.2em}{10em}
{\textsuperscript{\thefootnotemark}\,\enskip}
\newlength{\desclngth}
\newlength{\colonlngth}
\newcommand{\myfootnote}[2]{\settowidth{\desclngth}{#1:}%
\begingroup%
\addtolength{\desclngth}{1em}%
\deffootnote[1.0em]{\desclngth}{10em}%
{\textsuperscript{{\thefootnotemark}}\,\enskip}%
#1\footnote{#1: #2}%
\endgroup%
}
\usepackage{blindtext}
\begin{document}
foo\footnote{foo: this footnotetext explaines what foo is}
bar\footnote{foobar: this very very very very very very very long text explains in two lines what bar is, it would be nice if this line is indented behind the colon, starting below the 'this'}
\myfootnote{baz}{\blindtext}
\myfootnote{foobar}{\blindtext}
\end{document}
您可能会注意到,缩进并不真正匹配,这是由于初始数字的宽度不同(我认为)。但由于结果看起来所以奇怪,我没有进一步调查。
答案4
这是一个定义\explain
命令的解决方案,它有两个参数:要解释的文本或单词和解释。它创建一个脚注,第一个参数为粗体(就像在字典中一样),后面是解释。如果解释有几行长,则后续行会缩进,就好像要定义的单词是三个字母的单词一样,以便在整个文档中缩进一致。
它使用enumitem
环境,更具体地说是其description*
内联环境。
\documentclass[draft,12pt,a4paper]{article}
\usepackage[inline]{enumitem}
\makeatletter
\renewcommand\@makefntext[1]{%
\noindent\makebox[0.5em][l]{\@makefnmark}#1}
\makeatother
\setlength\footnotesep{2ex}
\newcommand\explain[2]{#1\footnote{%
\settowidth{\hangindent}{\textbf{foo}:\hspace{0.83em}\mbox{}}\hangafter = 1
\begin{description*}[mode=unboxed]%
\item[#1\mdseries:] #2
\end{description*}}%
}
\begin{document}
bar\footnote{this standard footnotetext explains what bar is.}
\explain{foo}{this footnotetext explains what foo is.}
\explain{long bar}{this very very very very very very very long text explains in two lines what bar is; this line is indented behind the position of a colon for a three letters word. }
\end{document}