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













3















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.










share|improve this question


























    3















    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.










    share|improve this question
























      3












      3








      3








      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      KcFnMiKcFnMi

      443413




      443413




















          1 Answer
          1






          active

          oldest

          votes


















          4














          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


          output






          share|improve this answer

























          • 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












          • @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











          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
          );



          );













          draft saved

          draft discarded


















          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









          4














          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


          output






          share|improve this answer

























          • 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












          • @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















          4














          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


          output






          share|improve this answer

























          • 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












          • @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













          4












          4








          4







          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


          output






          share|improve this answer















          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


          output







          share|improve this answer














          share|improve this answer



          share|improve this answer








          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, 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












          • @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

















          • 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












          • @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
















          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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

          Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

          Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її