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
All of my Firefox add-ons have been disabled suddenly, how can I re-enable them?
Would a legitimized Baratheon have the best claim for the Iron Throne?
How do I give a darkroom course without negs from the attendees?
Can a player choose to add detail and flavor to their character's spells and abilities?
How to get the decimal part of a number in apex
Why doesn't increasing the temperature of something like wood or paper set them on fire?
How to get file name from inside a latex file?
Was there a dinosaur-counter in the original Jurassic Park movie?
The unknown and unexplained in science fiction
Why were the rules for Proliferate changed?
What is more safe for browsing the web: PC or smartphone?
How can I finally understand the confusing modal verb "мочь"?
why it is 2>&1 and not 2>>&1 to append to a log file
call() a function within its own context
TikZ/PGF draw algorithm
Extracting the parent, leaf, and extension from a valid path
How can I test a shell script in a "safe environment" to avoid harm to my computer?
Are modes in jazz primarily a melody thing?
Did any early RISC OS precursor run on the BBC Micro?
Why always 4...dxc6 and not 4...bxc6 in the Ruy Lopez Exchange?
Is it safe to keep the GPU on 100% utilization for a very long time?
A♭ major 9th chord in Bach is unexpectedly dissonant/jazzy
Scaling rounded rectangles in Illustrator
How does "politician" work as a job/career?
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 3 hours ago
KcFnMiKcFnMi
438413
438413
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
34 mins ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
28 mins 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
13 mins 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
34 mins ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
28 mins 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
13 mins 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
34 mins ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
28 mins 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
13 mins 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 2 hours ago
answered 3 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
34 mins ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
28 mins 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
13 mins 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
34 mins ago
Cannewcommand
be used instead ofdef
? Considering tex.stackexchange.com/questions/655/….
– KcFnMi
28 mins 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
13 mins ago
Please, could you update answer so that I can also refer to bib files in another folder, like
inputbib/bibannotation-TheBook2019.tex
?– KcFnMi
34 mins ago
Please, could you update answer so that I can also refer to bib files in another folder, like
inputbib/bibannotation-TheBook2019.tex
?– KcFnMi
34 mins ago
Can
newcommand
be used instead of def
? Considering tex.stackexchange.com/questions/655/….– KcFnMi
28 mins ago
Can
newcommand
be used instead of def
? Considering tex.stackexchange.com/questions/655/….– KcFnMi
28 mins 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
13 mins 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
13 mins 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