1

I recently changed from Windows to Ubuntu because I'm learning to code. I used to write my class assignments in LaTeX using vscode and Latex Workshop. However, I've tried to set it up in Ubuntu and I've run into multiple errors. I have been able to solve (or at least I think I have) every of them, but I'm unable to solve this last one.

The problem is the following: when trying to build the latex proyect the terminal shows this:

[19:17:56.309][Commander] BUILD command invoked.
[19:17:56.310][Commander] The document of the active editor: file://%WS1%/main
[19:17:56.310][Commander] The languageId of the document: latex
[19:17:56.310][Manager] Current workspace folders: ["file://%WS1%"]
[19:17:56.311][Manager] Found root file from active editor: %WS1%/main
[19:17:56.311][Manager] Keep using the same root file: %WS1%/main
[19:17:56.312][Event] ROOT_FILE_SEARCHED
[19:17:56.312][Commander] Cannot find LaTeX root file. See https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#the-root-file
[19:17:58.322][Cacher] Error loading cache: %WS1%/main . Forcing.
[19:17:58.328][Structure][LaTeX] Error loading content during structuring: %WS1%/main .
[19:17:58.330][Structure] Structure updated with 0 root sections for %WS1%/main .
[19:17:58.333][Event] STRUCTURE_UPDATED

and nothing happens. When I open vscode, it shows this:

[19:17:31.034][Logger] New log placeholder %WS1% registered for /home/alejandro/Documentos/latex/tfm .
[19:17:31.034][Config] latex-workshop.latex.tools: a-lot-of-things-that-flagged-the-question-as-spam
[19:17:31.044][Config] latex-workshop.latex.outDir: "%DIR%/build" .
[19:17:31.085][Manager] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[19:17:31.093][Server] Creating LaTeX Workshop http and websocket server.
[19:17:31.142][Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":41019} .
[19:17:31.164][Extension] Initializing LaTeX Workshop.
[19:17:31.164][Extension] Extension root: /home/alejandro/.vscode/extensions/james-yu.latex-workshop-9.15.0
[19:17:31.164][Extension] $PATH: /home/alejandro/anaconda3/envs/latex/bin:/home/alejandro/anaconda3/condabin:/usr/local/texlive/2023/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
[19:17:31.165][Extension] $SHELL: /bin/bash
[19:17:31.165][Extension] $LANG: en_US.UTF-8
[19:17:31.165][Extension] $LC_ALL: undefined
[19:17:31.165][Extension] process.platform: linux
[19:17:31.165][Extension] process.arch: x64
[19:17:31.165][Extension] vscode.env.appName: Visual Studio Code
[19:17:31.166][Extension] vscode.env.remoteName: undefined
[19:17:31.166][Extension] vscode.env.uiKind: 1
[19:17:31.166][Extension] LaTeX Workshop initialized.
[19:17:31.173][Format][Bib] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":false,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[19:17:31.174][Extension] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[19:17:31.176][Manager] Current workspace folders: ["file://%WS1%"]
[19:17:31.176][Manager] Found root file from active editor: %WS1%/main
[19:17:31.177][Manager] Root file changed: from undefined to %WS1%/main
[19:17:31.177][Manager] Start to find all dependencies.
[19:17:31.177][Manager] Root file languageId: undefined
[19:17:31.177][Event] ROOT_FILE_CHANGED: "%WS1%/main"
[19:17:31.178][Cacher][Watcher] Reset.
[19:17:31.183][Cacher] Adding %WS1%/main .
[19:17:31.185][Cacher][Watcher] Watched %WS1%/main with a new watcher on %WS1% .
[19:17:31.185][Event] FILE_WATCHED: "%WS1%/main"
[19:17:31.186][Event] ROOT_FILE_SEARCHED
[19:17:31.187][Cacher][Path] Non-existent .fls for %WS1%/main .
[19:17:31.298][Server] valdOrigin is http://127.0.0.1:41019
[19:17:35.047][Cacher] Error loading cache: %WS1%/main . Forcing.
[19:17:35.055][Structure][LaTeX] Error loading content during structuring: %WS1%/main .

Now I will enumerate the things I have done to get to this point:

  1. I first tried to follow TexLive documentation for quick install
    1. I created a texlive directory in home
    2. I executed there all the commands in the docs until I got an error on cd install-tl-*, which for I had to write its full name.
    3. I tried to update the PATH without success.
  2. Updating PATH: I saw here people having the same problem. I followed the instructions from some of them without success. I tried to do it via the tlmgr gui, again echo $PATH was not showing texlive.
  3. I followed Ubuntu's doc for encitomental variables and created a myenvsvars.sh in /etc/profile.d/ and put export PATH=$PATH:/my/which/pdflatex/ there. I finally got texlive in PATH, as shown here:
/home/alejandro/anaconda3/envs/latex/bin:/home/alejandro/anaconda3/condabin:/usr/local/texlive/2023/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
  1. Installed latexmk via sudo apt install latexmk.
  2. After solving this, I ran into the error I am posting, and tried (just in case) to add the PATH to the env latexworkshop as shown here. Now my latex-workshop.latex.tools looks like this:
            "command": "latexmk",
            "args": [
                "--shell-escape",
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "-outdir=%OUTDIR%",
                "%DOC%"
            ],
            "env": {"PATH": "/usr/local/texlive/2023/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"}

for every env. This didn't really alter the output.

I think this is pretty much all I have to say. I have used some commands in between from the pages I posted, but I don't really know how those could have messed up the later ones. I'm using Ubuntu 23.10 and I'd highly appreciate some help. Thank you.

2
  • In 1. you say you got error while installing? Did you setup your texlive successfully. Can you compile latex document from command line using pdflatex doc.tex?
    – davidt930
    Commented Nov 29, 2023 at 6:33
  • Yes, I can compile documents from terminal! @davidt930 Commented Nov 29, 2023 at 16:54

1 Answer 1

0

Here I cannot get a TeXLive-install interacting with LibreOffice or Inkscape if they are installed in the snap package format. Do you have vscode installed as a snap? Check with snap list --all. If yes, try the deb-package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .