Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving references to relative paths outside of the project #3714

Open
padrecedano opened this issue Oct 30, 2024 · 3 comments · May be fixed by #3749
Open

Resolving references to relative paths outside of the project #3714

padrecedano opened this issue Oct 30, 2024 · 3 comments · May be fixed by #3749
Labels
enhancement New feature or (non bug related) change to the program.
Milestone

Comments

@padrecedano
Copy link

padrecedano commented Oct 30, 2024

First of all, thank you for this excellent project. I have moved from a Linux device to an Apple M1 (Silicon) device and I couldn't find a native LaTeX project editor on this new infrastructure. Combining IntelliJ IDEA with TeXify seems to solve that difficulty.

I would like to raise the following question. Considering the following directory tree:

.
└── IdeaProjects/
    ├── biennal/
    │   └── common/
    │       ├── template/
    │       │   └── main-template.tex
    │       ├── biblical/
    │       │   ├── Gn/
    │       │   │   ├── Gn_01_01-20.tex
    │       │   │   └── Gn_01_21-27.tex
    │       │   └── Ex/
    │       │       ├── Ex_01_01-15.tex
    │       │       └── Ex_02_08-22.tex  
    │       └── patres/
    │           ├── Agustin/
    │           │   ├── Agustin_PL038_0636.tex
    │           │   └── Agustin_PL038_1016.tex
    │           └── Ambrosio/
    │               ├── Ambrosio_CCL014_0165.tex
    │               └── Ambrosio_CCL064_0052.tex 
    ├── volume-01/
    │   └── src/
    │       └── main.tex
    ├── volume-02/
    │   └── src/
    │       └── main.tex
    ├── volume-03/
    │   └── src/
    │       └── main.tex
    └── volume-04/
        └── src/
            └── main.tex 

This structure would represent a project consisting of 4 volumes in which I would like to share certain content that is repeated:

  • Document type settings, commands to be used throughout the content, some environments. I plan to define that within the file biennal/common/template/main-template.tex

  • Other content that could be repeated in some of the volumes, both in the biblical folder and in the patres folder. In addition, the idea is to be able to have the content organized alphabetically in these folders to detect duplicates or missing content from the directory tree and to provide a global index of the texts used in the 4 volumes.

For testing purposes, I created a project called volume-01 with the following file src/main.tex

%! Author = cedano
%! Date = 30/10/24

\input{../../biennal/common/template/main-template}

% Document
\begin{document}
    \input{../../biennal/common/biblical/Gn/Gn_01_21-27}
    \input{../../biennal/common/patres/Agustin/Agustin_PL038_0636}
    \lipsum
\end{document}

The code compiles and creates a document with the content, but in the IDE I have an error:

Command requires lipsum package

My questions are: Is this possible using IntelliJ IDEA and TeXify? If so, how could I achieve this? Would I have to use modules or something similar? Would I have to use Gradle? Are there any examples of projects similar to what I want to achieve so I can get an idea of ​​the setup? Why does it not recognize the lipsum package and yet it works?

@padrecedano padrecedano added enhancement New feature or (non bug related) change to the program. untriaged Issue type still needs to be triaged or verified. labels Oct 30, 2024
@PHPirates
Copy link
Collaborator

Thanks for raising this issue! First of all, the document compiles but TeXiFy complains, so I think that is a bug that should be fixed.

In the meantime, you can either make one project containing all directories (this is what I would do), or you could set TEXINPUTS environment variables so that you can \input{Agustin_PL038_0636} without needing to figure out how many ../ you needed in the relative path. You can do this in your run configuration (template): https://hannah-sten.github.io/TeXiFy-IDEA/run-configuration-settings.html#environment-variables

@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Oct 31, 2024
@padrecedano
Copy link
Author

@PHPirates

Thank you for your answer.

I have tried to define an environment variable by following the steps below:

  1. Go to Run option in the main menu

  2. Select Edit Configurations

  3. Select Edit configurations templates at the bottom of the left panel

  4. Select LaTeX in the left panel

  5. In the Environment Variables input put the following: TEXINPUTS=~/IdeaProjects/bienal//:

  6. Press Apply and OK

Doing all that, it still doesn't work. Do the environment variables need to be defined somewhere else?

@PHPirates
Copy link
Collaborator

Did you create an actual run configuration from the template and ran it? Also make sure there are no typos. above it was biennal

@PHPirates PHPirates changed the title How to reuse content across multiple documents? Resolving references to relative paths outside of the project Nov 13, 2024
@PHPirates PHPirates added this to the Next milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or (non bug related) change to the program.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants