How to get file name from inside a latex file?What is the difference between def and newcommand?Citations and bibliography style for literatureRelated field in biblatex : pageSome fields don't show up or are missing formatting in the bibliography even though I have entries for themOpen brace in BibTeX fieldsBibtex/Biber: how to cite an author using Ethiopian conventions?How to sort references by the lastname of the first author and citation style should be <Name, year>Biblatex entries with acute accent have wrong format in citationDifferent style of citation for two and more author biblatexHow to embed a review in biblatex?Extract entry keys from bib file and create a file for each entry key
Convert Numbers To Emoji Math
Why did Dr. Strange keep looking into the future after the snap?
Do the Zhentarim fire members for killing fellow members?
Why is there a cap on 401k contributions?
TikZ/PGF draw algorithm
Many one decreasing function?
Does this website provide consistent translation into Wookiee?
Would a legitimized Baratheon have the best claim for the Iron Throne?
Why doesn't increasing the temperature of something like wood or paper set them on fire?
Justification of physical currency in an interstellar civilization?
How could a humanoid creature completely form within the span of 24 hours?
Extracting the parent, leaf, and extension from a valid path
Does restarting the SQL Services (on the machine) clear the server cache (for things like query plans and statistics)?
No game no life what were the two siblings referencing in EP 5
Is it safe to keep the GPU on 100% utilization for a very long time?
Is throwing dice a stochastic or a deterministic process?
Why doesn't a particle exert force on itself?
Employee is self-centered and affects the team negatively
shebang or not shebang
Why is the episode called "The Last of the Starks"?
How do I minimise waste on a flight?
Which "exotic salt" can lower water's freezing point by 70 °C?
What is more safe for browsing the web: PC or smartphone?
What wise choice does Varys intends to make?
How to get file name from inside a latex file?
What is the difference between def and newcommand?Citations and bibliography style for literatureRelated field in biblatex : pageSome fields don't show up or are missing formatting in the bibliography even though I have entries for themOpen brace in BibTeX fieldsBibtex/Biber: how to cite an author using Ethiopian conventions?How to sort references by the lastname of the first author and citation style should be <Name, year>Biblatex entries with acute accent have wrong format in citationDifferent style of citation for two and more author biblatexHow to embed a review in biblatex?Extract entry keys from bib file and create a file for each entry key
In the context of biblatex its possible to bibstyle=reading
, this will produce bibliography including abstract
and annotation
fields.
The annotation might come from a file named like bibannotation-TheBook2019.tex
where TheBook2019
is the bib file entry key.
@bookTheBook2019,
author = The Author,
title = The Book Title
The annotation file bibannotation-TheBook2019.tex
can contain latex formated text. One might then inputbibannotation-TheBook2019.tex
somewhere in a document. And so might be appropriate to include a citation in the bibannotation-TheBook2019.tex
. Is this case it willl be self citation, I mean that file will refer to the respective entry key:
citeTheBook2019
Since this information is in the file name. Can I automate it some way? So that I can just type something like:
citeSelfCite
And it will be converted to citeTheBook2019
grabbing the entry key from file name.
biblatex bibliographies xetex pdftex biber
add a comment |
In the context of biblatex its possible to bibstyle=reading
, this will produce bibliography including abstract
and annotation
fields.
The annotation might come from a file named like bibannotation-TheBook2019.tex
where TheBook2019
is the bib file entry key.
@bookTheBook2019,
author = The Author,
title = The Book Title
The annotation file bibannotation-TheBook2019.tex
can contain latex formated text. One might then inputbibannotation-TheBook2019.tex
somewhere in a document. And so might be appropriate to include a citation in the bibannotation-TheBook2019.tex
. Is this case it willl be self citation, I mean that file will refer to the respective entry key:
citeTheBook2019
Since this information is in the file name. Can I automate it some way? So that I can just type something like:
citeSelfCite
And it will be converted to citeTheBook2019
grabbing the entry key from file name.
biblatex bibliographies xetex pdftex biber
add a comment |
In the context of biblatex its possible to bibstyle=reading
, this will produce bibliography including abstract
and annotation
fields.
The annotation might come from a file named like bibannotation-TheBook2019.tex
where TheBook2019
is the bib file entry key.
@bookTheBook2019,
author = The Author,
title = The Book Title
The annotation file bibannotation-TheBook2019.tex
can contain latex formated text. One might then inputbibannotation-TheBook2019.tex
somewhere in a document. And so might be appropriate to include a citation in the bibannotation-TheBook2019.tex
. Is this case it willl be self citation, I mean that file will refer to the respective entry key:
citeTheBook2019
Since this information is in the file name. Can I automate it some way? So that I can just type something like:
citeSelfCite
And it will be converted to citeTheBook2019
grabbing the entry key from file name.
biblatex bibliographies xetex pdftex biber
In the context of biblatex its possible to bibstyle=reading
, this will produce bibliography including abstract
and annotation
fields.
The annotation might come from a file named like bibannotation-TheBook2019.tex
where TheBook2019
is the bib file entry key.
@bookTheBook2019,
author = The Author,
title = The Book Title
The annotation file bibannotation-TheBook2019.tex
can contain latex formated text. One might then inputbibannotation-TheBook2019.tex
somewhere in a document. And so might be appropriate to include a citation in the bibannotation-TheBook2019.tex
. Is this case it willl be self citation, I mean that file will refer to the respective entry key:
citeTheBook2019
Since this information is in the file name. Can I automate it some way? So that I can just type something like:
citeSelfCite
And it will be converted to citeTheBook2019
grabbing the entry key from file name.
biblatex bibliographies xetex pdftex biber
biblatex bibliographies xetex pdftex biber
asked 5 hours ago
KcFnMiKcFnMi
443413
443413
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can do this with a couple of helper functions.
KcFnMiinput
saves the name of the key using filenametokey
then inputs the file.
documentclassarticle
usepackagefilecontents
beginfilecontentsjobname.bib
@bookTheBook2019,
author = The Author,
title = The Book Title
endfilecontents
beginfilecontentsannotation-TheBook2019.tex
This file contains an annotation for verb|TheBook2019|. It's also possible to
cite it: citeselfcitekey.
endfilecontents
usepackagebiblatex
addbibresourcejobname.bib
deffilenametokey annotation-#1.tex#1
newcommandKcFnMiinput[1]%
edefselfcitekeyfilenametokey #1%
input#1
begindocument
KcFnMiinputannotation-TheBook2019.tex
printbibliography
enddocument
Please, could you update answer so that I can also refer to bib files in another folder, likeinputbib/bibannotation-TheBook2019.tex
?
– KcFnMi
2 hours ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
1 hour ago
@KcFnMi It's not possible to usenewcommand
forfilenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just usedeffilenametokey bib/annotation-#1.tex#1
and thenKcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, sincefilecontents
can't output to a subdirectory without--shell-escape
to create the subdirectory first if it doesn't exist.)
– David Purton
1 hour ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f489534%2fhow-to-get-file-name-from-inside-a-latex-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can do this with a couple of helper functions.
KcFnMiinput
saves the name of the key using filenametokey
then inputs the file.
documentclassarticle
usepackagefilecontents
beginfilecontentsjobname.bib
@bookTheBook2019,
author = The Author,
title = The Book Title
endfilecontents
beginfilecontentsannotation-TheBook2019.tex
This file contains an annotation for verb|TheBook2019|. It's also possible to
cite it: citeselfcitekey.
endfilecontents
usepackagebiblatex
addbibresourcejobname.bib
deffilenametokey annotation-#1.tex#1
newcommandKcFnMiinput[1]%
edefselfcitekeyfilenametokey #1%
input#1
begindocument
KcFnMiinputannotation-TheBook2019.tex
printbibliography
enddocument
Please, could you update answer so that I can also refer to bib files in another folder, likeinputbib/bibannotation-TheBook2019.tex
?
– KcFnMi
2 hours ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
1 hour ago
@KcFnMi It's not possible to usenewcommand
forfilenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just usedeffilenametokey bib/annotation-#1.tex#1
and thenKcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, sincefilecontents
can't output to a subdirectory without--shell-escape
to create the subdirectory first if it doesn't exist.)
– David Purton
1 hour ago
add a comment |
You can do this with a couple of helper functions.
KcFnMiinput
saves the name of the key using filenametokey
then inputs the file.
documentclassarticle
usepackagefilecontents
beginfilecontentsjobname.bib
@bookTheBook2019,
author = The Author,
title = The Book Title
endfilecontents
beginfilecontentsannotation-TheBook2019.tex
This file contains an annotation for verb|TheBook2019|. It's also possible to
cite it: citeselfcitekey.
endfilecontents
usepackagebiblatex
addbibresourcejobname.bib
deffilenametokey annotation-#1.tex#1
newcommandKcFnMiinput[1]%
edefselfcitekeyfilenametokey #1%
input#1
begindocument
KcFnMiinputannotation-TheBook2019.tex
printbibliography
enddocument
Please, could you update answer so that I can also refer to bib files in another folder, likeinputbib/bibannotation-TheBook2019.tex
?
– KcFnMi
2 hours ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
1 hour ago
@KcFnMi It's not possible to usenewcommand
forfilenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just usedeffilenametokey bib/annotation-#1.tex#1
and thenKcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, sincefilecontents
can't output to a subdirectory without--shell-escape
to create the subdirectory first if it doesn't exist.)
– David Purton
1 hour ago
add a comment |
You can do this with a couple of helper functions.
KcFnMiinput
saves the name of the key using filenametokey
then inputs the file.
documentclassarticle
usepackagefilecontents
beginfilecontentsjobname.bib
@bookTheBook2019,
author = The Author,
title = The Book Title
endfilecontents
beginfilecontentsannotation-TheBook2019.tex
This file contains an annotation for verb|TheBook2019|. It's also possible to
cite it: citeselfcitekey.
endfilecontents
usepackagebiblatex
addbibresourcejobname.bib
deffilenametokey annotation-#1.tex#1
newcommandKcFnMiinput[1]%
edefselfcitekeyfilenametokey #1%
input#1
begindocument
KcFnMiinputannotation-TheBook2019.tex
printbibliography
enddocument
You can do this with a couple of helper functions.
KcFnMiinput
saves the name of the key using filenametokey
then inputs the file.
documentclassarticle
usepackagefilecontents
beginfilecontentsjobname.bib
@bookTheBook2019,
author = The Author,
title = The Book Title
endfilecontents
beginfilecontentsannotation-TheBook2019.tex
This file contains an annotation for verb|TheBook2019|. It's also possible to
cite it: citeselfcitekey.
endfilecontents
usepackagebiblatex
addbibresourcejobname.bib
deffilenametokey annotation-#1.tex#1
newcommandKcFnMiinput[1]%
edefselfcitekeyfilenametokey #1%
input#1
begindocument
KcFnMiinputannotation-TheBook2019.tex
printbibliography
enddocument
edited 4 hours ago
answered 4 hours ago
David PurtonDavid Purton
11.5k2944
11.5k2944
Please, could you update answer so that I can also refer to bib files in another folder, likeinputbib/bibannotation-TheBook2019.tex
?
– KcFnMi
2 hours ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
1 hour ago
@KcFnMi It's not possible to usenewcommand
forfilenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just usedeffilenametokey bib/annotation-#1.tex#1
and thenKcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, sincefilecontents
can't output to a subdirectory without--shell-escape
to create the subdirectory first if it doesn't exist.)
– David Purton
1 hour ago
add a comment |
Please, could you update answer so that I can also refer to bib files in another folder, likeinputbib/bibannotation-TheBook2019.tex
?
– KcFnMi
2 hours ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
1 hour ago
@KcFnMi It's not possible to usenewcommand
forfilenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just usedeffilenametokey bib/annotation-#1.tex#1
and thenKcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, sincefilecontents
can't output to a subdirectory without--shell-escape
to create the subdirectory first if it doesn't exist.)
– David Purton
1 hour ago
Please, could you update answer so that I can also refer to bib files in another folder, like
inputbib/bibannotation-TheBook2019.tex
?– KcFnMi
2 hours ago
Please, could you update answer so that I can also refer to bib files in another folder, like
inputbib/bibannotation-TheBook2019.tex
?– KcFnMi
2 hours ago
Can
newcommand
be used instead of def
? Considering tex.stackexchange.com/questions/655/….– KcFnMi
1 hour ago
Can
newcommand
be used instead of def
? Considering tex.stackexchange.com/questions/655/….– KcFnMi
1 hour ago
@KcFnMi It's not possible to use
newcommand
for filenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just use deffilenametokey bib/annotation-#1.tex#1
and then KcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, since filecontents
can't output to a subdirectory without --shell-escape
to create the subdirectory first if it doesn't exist.)– David Purton
1 hour ago
@KcFnMi It's not possible to use
newcommand
for filenametokey
. It (essentially) uses the technique explained in tex.stackexchange.com/a/662/87678. You can modify the template however you want. Just use deffilenametokey bib/annotation-#1.tex#1
and then KcFnMiinputbib/annotation-TheBook2019.tex
. (This isn't so easy to do in the MWE though, since filecontents
can't output to a subdirectory without --shell-escape
to create the subdirectory first if it doesn't exist.)– David Purton
1 hour ago
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f489534%2fhow-to-get-file-name-from-inside-a-latex-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown