question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot compile .tex files on MacOS

See original GitHub issue

Description

Compiling of the .tex files will not work, so I am not able to use the workflow in my VSCode on MacOS. I suspect this might be related to the location of my files, which are on iCloud Drive, so the path might be a bit ‘ugly’.

This is the error message I get:

Latexmk: applying rule 'pdflatex'...
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `"/Users/ahmet/Library/Mobile Documents/com"'.
<to be read again> 
                   \protect 
<*> "/Users/ahmet/Library/Mobile Documents/com~
                                               apple~CloudDocs/Southampton/P...
(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<to be read again> 
                   \protect 
<*> "/Users/ahmet/Library/Mobile Documents/com~
                                               apple~CloudDocs/Southampton/P...
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
=== TeX engine is 'pdfTeX'
Latexmk: Errors, so I did not complete making targets

I have tried quite a few things:

  • removing all whitespace from the complete path to the file
  • creating a symbolic link, so ~/Paper/ is the directory where all .tex files are located
  • tried hardcoding the path in the workflow in settings
  • tried creating an alias command and just putting that in the workflow settings without any arguments

Whatever I do, the error appears. I am able to run the command for latexmk manually from the terminal, so if I run latexmk -synctex=1 -interaction=nonstopmode -file-line-error -pdf -f ~/Paper/Thesis.tex the file gets built.

Expected behavior

I expect a PDF to be generated, that the compiling process is completed.

Actual behavior

There is an error message, with the log that I have showed above.

Log messages

LaTeX Workshop Output file: 'file:///Users/ahmet/Library/Mobile%20Documents/com~apple~CloudDocs/Southampton/ProjectPrep/MScProject/Code/novelchain/Paper/Thesis.tex' severity: 'Error' message: 'I can't find file `"/Users/ahmet/Library/Mobile Documents/com"' <to be read again> \protect <*> "/Users/ahmet/Library/Mobile Documents/com~ apple~CloudDocs/Southampton/P... (Press Enter to retry, or Control-D to exit) Please type another input file name ! Emergency stop. <to be read again> \protect <*> "/Users/ahmet/Library/Mobile Documents/com~ apple~CloudDocs/Southampton/P... ! ==> Fatal error occurred, no output PDF file produced! Transcript written on texput.log. === TeX engine is 'pdfTeX' Latexmk: Errors, so I did not complete making targets ' at: '1,1' source: 'LaTeX'
Developer Tools Console

Additional Information

I am using MacOS X, latest version, 10.12.6.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:29 (14 by maintainers)

github_iconTop GitHub Comments

9reactions
rben01commented, Sep 16, 2018

Here’s mine:

"latex-workshop.latex.recipes": [
	{
		"name": "latexmk",
		"tools": ["cd_to_cwd", "latexmk"]
	},
	{
		"name": "pdflatex -> bibtex -> pdflatex*2",
		"tools": ["cd_to_cwd", "pdflatex", "bibtex", "pdflatex", "pdflatex"]
	}
],
"latex-workshop.latex.tools": [
	{
		"name": "cd_to_cwd",
		"command": "cd",
		"args": ["%DIR%"]
	},
	{
		"name": "latexmk",
		"command": "latexmk",
		"args": [
			"-synctex=1",
			"-interaction=nonstopmode",
			"-file-line-error",
			"-pdf",
			"%DOCFILE%"
		]
	},
	{
		"name": "pdflatex",
		"command": "pdflatex",
		"args": [
			"-synctex=1",
			"-interaction=nonstopmode",
			"-file-line-error",
			"%DOCFILE%"
		]
	},
	{
		"name": "bibtex",
		"command": "bibtex",
		"args": ["%DOCFILE%"]
	}
],

The key is that a) the first recipe listed is used by default; b) the recipe used has to contain the cd tool.

7reactions
leafaccommented, Oct 7, 2019

Another Workaround

  1. Create a symbolic link to the iCloud folder, for example:

    $ ln -s "~/Library/Mobile Documents/com~apple~CloudDocs/" iCloud
    
  2. Open Visual Studio Code on that folder without following the symbolic link (a feature new to 1.28), for example:

    $ code iCloud/Research/papers
    
Read more comments on GitHub >

github_iconTop Results From Across the Web

Compile .tex file to a pdf on os X
I installed mactex and I wrote a resume in Vim, but I can't figure out how to compile the ...
Read more >
LaTeX Setup and Tutorial
The Windows LaTeX compiler is called MiKTeX and it will give your computer the power to compile .tex files. It also manages LaTeX...
Read more >
How to edit LaTeX on Mac
Getting your Mac set up to edit LaTeX documents can sometimes be confusing. Follow this simple step-by-step guide and start editing .tex files...
Read more >
Install LaTeX Workshop and compile PDF in VSCode LaTeX ...
How to install LaTeX workshop extension in VSCode and how to compile your LaTeX documents on your Mac. LaTeX Workshop is a Visual...
Read more >
Texmaker : User manual
Texmaker can't compile yours documents if the paths to the LaTeX related commands are wrong. The default settings should work with the recent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found