
Escrevi uma dissertação com referências bibliográficas em notas de rodapé, e gostaria de organizá-las em uma bibliografia no final da dissertação (usando Lyx).
Eu poderia copiar cada nota de rodapé e colá-la em tal documento, mas levaria muito tempo.
Você saberia uma forma de colocar automaticamente o conteúdo de cada nota de rodapé em um único documento, que eu pudesse organizar para apresentá-lo como minha bibliografia?
Muito obrigado por sua ajuda!
Responder1
Você pode redefinir o comando interno \@footnotetext
para gravar seu conteúdo em um arquivo.
Aqui está uma solução simples que grava notas de rodapé em um arquivo file.ftn
, onde file
está o nome do seu .tex
arquivo como referências bibliográficas:
\documentclass{article}
\newwrite\footaux
\immediate\openout\footaux\jobname.ftn
\immediate\write\footaux{\string\begin{thebibliography}{99}}
\AtEndDocument{
\immediate\write\footaux{\string\end{thebibliography}}
\closeout\footaux
}
\makeatletter
\let\@footnotetextorig\@footnotetext
\long\def\@footnotetext#1{\@footnotetextorig{#1}\immediate\write\footaux
{\string\bibitem: #1}}
\makeatother
\begin{document}
This is the text\footnote{First footnote}.
\clearpage
This is the text\footnote{Second footnote}.
\end{document}
Aqui está o .ftn
arquivo:
\begin{thebibliography}{99}
\bibitem: First footnote
\bibitem: Second footnote
\end{thebibliography}
Responder2
Ideias de soluções
- Redefina
\footnote
o comando para que salve o texto da nota de rodapé em um arquivo formatado para bibliografia. - Use as bibliografias salvas no final.
A solução
\documentclass{article}
\usepackage{lipsum}
\usepackage{url}
\let\originalfootnote\footnote
\newwrite\footnotelist
\immediate\openout\footnotelist\jobname.bls
\immediate\write\footnotelist{\unexpanded{\begin{thebibliography}{99}}}
\def\savefootnote#1{\immediate\write\footnotelist{\unexpanded{\bibitem}{fn\thefootnote}\unexpanded{#1}}}
\def\footnote#1{%
\originalfootnote{#1}%
\savefootnote{#1}}
\AtEndDocument{\immediate\write\footnotelist{\unexpanded{\end{thebibliography}}}%
\immediate\closeout\footnotelist%
\IfFileExists{\jobname.bls}{\input{\jobname.bls}}{\relax}}
\begin{document}
\lipsum[1-10]
Put a footnote here.\footnote{\url{http://www.acm.org}}
\lipsum[11-20]
Put another footnote here.\footnote{\url{http://ieeexplore.ieee.org}}
\lipsum[21-30]
\end{document}
Arquivo de lista de notas de rodapé criado
\begin {thebibliography}{99}
\bibitem {fn1}\url {http://www.acm.org}
\bibitem {fn2}\url {http://ieeexplore.ieee.org}
\end {thebibliography}
A saída