4
  1. I have parent(main) document which includes (through \include command) many (more then 100) small files. I want to use find and replace in all these latex files once (as it will take lots of time to go into all those 100 files). How can I do that?

  2. Further (and related to above question), can I make a one big latex file which combines all the 'included' files in to one big latex document? Thanks in advance.

David Carlisle
  • 757,742
Tash
  • 433
  • 1
    Perhaps it depends on the editor. In Texstudio I think there's an option that you can choose to automatically load all included files in main once its open. – hesham Apr 01 '20 at 03:48
  • 1
    While it's certainly possible to make one big file that represents the entire document, that means you won't be able easily to work on different parts independently, as the entire file will have to be compiled every time you make a change. When using \include, you gain the benefit of using \includeonly to concentrate on a particular part. – barbara beeton Apr 01 '20 at 03:54
  • 1
    you are asking about how to edit multiple files but don't say which editor you are using. I assume most editors will allow you to specify the replacement (I quite regularly edit several thousand files at once in emacs) but you could also use commandline editors such as sed or perl if it is a simple replacement. The question isn't really related to tex, just to the editor you use. – David Carlisle Apr 01 '20 at 12:18
  • @hesham: I am using Texstudio. Can you please let me know to do that? – Tash Apr 01 '20 at 14:26
  • @barbarabeeton: I want to keep the files separate but I want to search and replace from the main document which \include them. – Tash Apr 01 '20 at 14:27
  • @DavidCarlisle: I am using Texstudio and hesham(first comment) says it can be done in that editor. I will check and hesham may get back to me. – Tash Apr 01 '20 at 14:29
  • 1
    I have still not found any solution. I really think there should be a way to do this because when latex generates the final output, it actually puts all the included files in the main code (just like a code for a function is put (during compiling/linking) in all the places where it is called) before it could generate the final pdf. – Tash Apr 23 '20 at 03:34
  • It is answered here: https://tex.stackexchange.com/a/306248/272545 – A. J. Pan-Collantes Jan 03 '23 at 12:21

0 Answers0