我有一个 .bib 文件,它显示在文档末尾,但我想将引用的部分(带有\cite(ref1)
)自动添加到每个相应的页脚。可以吗?
母语:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,ngerman]{babel}
\usepackage{lastpage}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0.1pt}
\setlength{\headheight}{16pt}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{blindtext}
\begin{document}
\setcounter{page}{1}
\tableofcontents
\thispagestyle{empty}
\clearpage
\section{first section}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna \cite{einstein} aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\footnote{\let\cite=\footcite} % <------- this is the second try
\subsection{first subsection}
\blindtext
\blindtext
\subsubsection{first subsubsection}
\blindtext
\paragraph{first paragraph}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna \cite{latexcompanion} aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\let\cite=\footcite %<---------- this is the first try
\newpage
\thispagestyle{empty}
\section{References}
\begin{thebibliography}{9}
\bibitem{latexcompanion}
Michel Goossens, Frank Mittelbach, and Alexander Samarin.
\textit{The \LaTeX\ Companion}.
Addison-Wesley, Reading, Massachusetts, 1993.
\bibitem{einstein}
Albert Einstein.
\textit{Zur Elektrodynamik bewegter K{\"o}rper}. (German)
[\textit{On the electrodynamics of moving bodies}].
Annalen der Physik, 322(10):891–921, 1905.
\end{thebibliography}
\end{document}
答案1
好的...这是 WE:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@article{einstein,
author = {Albert Einstein},
title = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]},
journal = {Annalen der Physik},
volume = {322},
number = {10},
pages = {891--921},
year = {1905},
DOI = {http://dx.doi.org/10.1002/andp.19053221004},
}
@misc{mozart:KV183,
author = {Mozart, Wolfgang Amadeus},
title = {Sinfonie g-Moll},
year = {1773},
address = {Salzburg},
note = {New K{\"o}chelverzeichnis Nr. 183, old version Nr. 25;
Erster Satz: Allegro con brio, Zweiter Satz: Andante,
Dritter Satz: Menuetto, Vierter Satz: Allegro},
}
\end{filecontents*}
\documentclass{article}
\usepackage[backend=biber, style=numeric, defernumbers]{biblatex}
\usepackage{lipsum}
\addbibresource{\jobname.bib}
\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\cite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\addtocategory{skipbibliography}{\thefield{entrykey}}%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
This is text with \cite{Goossens} and \cite{adams}.
And \cite{mozart:KV183}.
\lipsum[1-8]
here is a last footcite \cite{einstein}
\printbibliography[notcategory=skipbibliography]
\pagebreak %<- Remove these lines if you dont nead a bibliography at the end
\printbibliography %<- 2md line to remove
\end{document}
来源:https://tex.stackexchange.com/a/222622/120578来自用户@moewe。
输出:
遵循新页面中的普通参考书目,您可以将其删除(请参阅代码的 lias 行)
附言:\let\cite=\footcite 不起作用……抱歉!(以为这样更简单)
答案2
koleygr 在聊天过程中为我提供的答案是:
\documentclass{article}
\usepackage[backend=bibtex, style=numeric, defernumbers]{biblatex}
\usepackage{lipsum}
\addbibresource{./latexfiles/ref.bib}
\DeclareBibliographyCategory{skipbibliography}
\DeclareCiteCommand{\cite}[\mkbibfootnote]
{\usebibmacro{prenote}}
{\addtocategory{skipbibliography}{\thefield{entrykey}}%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\begin{document}
This is text with \cite{Goossens} and %\cite{adams}.
\lipsum[1-8]
here is a last footcite \cite{einstein}
\printbibliography[notcategory=skipbibliography]
\pagebreak %<- Remove these lines if you dont nead a bibliography at the end
\printbibliography %<- 2md line to remove
\end{document}
在子文件夹中有一个名为“latexfiles/ref.bib”的文件
@Book{Goossens,
author = {Goossens, Michel and Mittelbach, Frank and
Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
year = {1994},
}
@Book{adams,
title = {The Restaurant at the End of the Universe},
author = {Douglas Adams},
series = {The Hitchhiker's Guide to the Galaxy},
publisher = {Pan Macmillan},
year = {1980},
}
@article{einstein,
author = {Albert Einstein},
title = {{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]},
journal = {Annalen der Physik},
volume = {322},
}
这将为文档中的所有参考文献生成参考书目和脚注引文。并且只有引用的参考文献才会\cite{ref1}
出现在最后的参考书目中。这是我的下一个问题。->完整参考书目不显示文档中未引用的引文