0

I am new to TexStudio. I want to create a new project so I can compose all the projects files inside a single directory or folders. When I open the File menu, it create a new file and there is no option to create a new directory. I also looked at the tool bar and all the icons. I can not see anything that allow me create a new project (directory or folder). Can you help me please? this is important to me. There is no way I can make the projecs files mixed in one place.

  • 1
    Projects are implicit in TeXstudio's philosophy. See here – Troy Aug 30 '18 at 18:14
1

The TeXstudio team has already covered this in their FAQ.

The short answer is that the option to explicitly "create a project" is not available (not necessary) because projects are implicit in their philosophy: TeXstudio automatically infers the relations between your project files, and if that fails, there are alternatives like using "Magic commands" to specify project root files etc.

0

If you want to create a project in TeXstudio for some reason, you can do with a hack. Add the following to your "main" project file:

% !TeX TXS-SCRIPT = openproj
% //Trigger = ?load-this-file
% files = [
%   "./file1.tex",
%   "./file2.tex",
% ]
% for (i in files) {
%   files[i] = app.getAbsoluteFilePath(files[i]);
% }
% for (i in files) {
%   app.load(app.getAbsoluteFilePath(files[i]));
% }
% TXS-SCRIPT-END

This script opens the specified files, as soon as the main file is opened. It is pretty much self-explanatory javascript code. To explain the non-obvious parts:

  • The //Trigger statement activates the script (when it is loaded).
  • The separation in two for loops is needed in case the project files are in separate directories. If you merge the loops and give files = ["./foo/bar.tex", "./baz.tex"], it will try to load ./foo/bar.tex and ./foo/baz.tex

In case you are looking for further info for the scripting, have a look at their docs

This should not be necessary, if TeXstudio correctly recognizes your project. I'd advise against this script if it is not necessary, you'll save yourself some headache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.