# filecontentsdef: How to save a file data in a macro without creating a physical file in the working directory?

by Diaa   Last Updated October 09, 2019 20:23 PM - source

Following the description of filecontentsdefmacro environment in the manual of filecontentsdef, I understood that it can be used to save some data in a macro without the need to create a physical file in the working directory.

However, the following MWE doesn't work as I expected. So, my question is how can I store a *.bib file data in a macro without creating a physical file in the working directory?

% arara: lualatex: { options: [ '-synctex=1', '-shell-escape','-interaction=nonstopmode' ]}
% arara: biber
% arara: lualatex: { options: [ '-synctex=1', '-shell-escape','-interaction=nonstopmode' ]}
% arara: lualatex: { options: [ '-synctex=1', '-shell-escape','-interaction=nonstopmode' ]}

\documentclass[nonatbib]{elsarticle}

\makeatletter
\let\[email protected]\relax
\makeatother

\usepackage[backend=biber,hyperref=true]{biblatex}

\usepackage{filecontentsdef,hyperref}
\begin{filecontentsdefmacro}{\somemacro}
@Article{key,
author =    {author},
title =     {title},
journal = {journal}
}
\end{filecontentsdefmacro}