
Escribí una disertación con referencias bibliográficas en notas a pie de página y me gustaría organizarlas en una bibliografía al final de la disertación (usando Lyx).
Podría copiar cada nota a pie de página y pegarla en un documento de este tipo, pero llevaría mucho tiempo.
¿Conocería alguna forma de poner automáticamente el contenido de cada nota a pie de página en un solo documento, que podría organizar para presentarlo como mi bibliografía?
¡Muchas gracias por tu ayuda!
Respuesta1
Puede redefinir el comando interno \@footnotetext
para escribir su contenido en un archivo.
Aquí hay una solución simple que escribe notas a pie de página en un archivo file.ftn
, donde file
está el nombre de su .tex
archivo como referencias 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}
Aquí está el .ftn
archivo:
\begin{thebibliography}{99}
\bibitem: First footnote
\bibitem: Second footnote
\end{thebibliography}
Respuesta2
Ideas de solución
- Redefina
\footnote
el comando para que guarde el texto de la nota al pie en un archivo formateado para bibliografía. - Utilice las bibliografías guardadas al final.
La solución
\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}
Archivo de lista de notas al pie creado
\begin {thebibliography}{99}
\bibitem {fn1}\url {http://www.acm.org}
\bibitem {fn2}\url {http://ieeexplore.ieee.org}
\end {thebibliography}
La salida