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













2















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


























    2















    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
























      2












      2








      2








      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 3 hours ago









      KcFnMiKcFnMi

      438413




      438413




















          1 Answer
          1






          active

          oldest

          votes


















          3














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











          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









          3














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















          3














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













          3












          3








          3







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












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

















          • 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












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
















          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

















          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

          Log på Navigationsmenu

          Creating second map without labels using QGIS?How to lock map labels for inset map in Print Composer?How to Force the Showing of Labels of a Vector File in QGISQGIS Valmiera, Labels only show for part of polygonsRemoving duplicate point labels in QGISLabeling every feature using QGIS?Show labels for point features outside map canvasAbbreviate Road Labels in QGIS only when requiredExporting map from composer in QGIS - text labels have moved in output?How to make sure labels in qgis turn up in layout map?Writing label expression with ArcMap and If then Statement?

          Nuuk Indholdsfortegnelse Etyomologi | Historie | Geografi | Transport og infrastruktur | Politik og administration | Uddannelsesinstitutioner | Kultur | Venskabsbyer | Noter | Eksterne henvisninger | Se også | Navigationsmenuwww.sermersooq.gl64°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.75064°10′N 51°45′V / 64.167°N 51.750°V / 64.167; -51.750DMI - KlimanormalerSalmonsen, s. 850Grønlands Naturinstitut undersøger rensdyr i Akia og Maniitsoq foråret 2008Grønlands NaturinstitutNy vej til Qinngorput indviet i dagAntallet af biler i Nuuk må begrænsesNy taxacentral mødt med demonstrationKøreplan. Rute 1, 2 og 3SnescootersporNuukNord er for storSkoler i Kommuneqarfik SermersooqAtuarfik Samuel KleinschmidtKangillinguit AtuarfiatNuussuup AtuarfiaNuuk Internationale FriskoleIlinniarfissuaq, Grønlands SeminariumLedelseÅrsberetning for 2008Kunst og arkitekturÅrsberetning for 2008Julie om naturenNuuk KunstmuseumSilamiutGrønlands Nationalmuseum og ArkivStatistisk ÅrbogGrønlands LandsbibliotekStore koncerter på stribeVandhund nummer 1.000.000Kommuneqarfik Sermersooq – MalikForsidenVenskabsbyerLyngby-Taarbæk i GrønlandArctic Business NetworkWinter Cities 2008 i NuukDagligt opdaterede satellitbilleder fra NuukområdetKommuneqarfik Sermersooqs hjemmesideTurist i NuukGrønlands Statistiks databankGrønlands Hjemmestyres valgresultaterrrWorldCat124325457671310-5