"Error: LaTeX failed to compile" output when using TinyTex; error running pdflatex (exit code 1) - latex

I'm using an R Sweave doc and trying to compile a pdf from RStudio using TinyTex. Let's assume my Sweave file is titled "Example.Rnw" and my file path to the .tex output is "Path/Example.tex." After hitting "Compile PDF" in my Sweave doc, I get the following error:
[1] "Example.tex"
Compiling document with tinytex ... Error: LaTeX failed to compile /Path/Example.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Execution halted
failed
Error running /usr/local/bin/pdflatex (exit code 1)
When I copy and paste the resulting .tex file into Overleaf, the pdf looks fine. My guess is there's some issue with pdflatex and TinyTex, but I'm not sure what. After a few hours I'm still stumped. Any advice for how to compile this pdf? I've already updated and reinstalled TinyTex, and set my PATH to the TinyTex distribution folder. Thanks in advance.

Related

The system cannot find the file specified error Lua

I have a folder containing main.lua opened in Sublime Text, but when I try to compile it in the text editor, it gives me this error. I have no problem running the code in the game engine. Can someone tell me what I am doing wrong and how to fix it in layman's terms? I am new to coding. Here is the full error:
[WinError 2] The system cannot find the file specified
[cmd: ['lua', 'C:\\Users\\eshig\\Desktop\\pong-0\\main.lua']]
[dir: C:\Users\eshig\Desktop\pong-0]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;C:\Program Files\Java\jdk-13.0.2\bin;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;]
[Finished]

Inkscape can't find the file for includesvg

Having a nightmare including an svg file in my document. It's just a picture of Tux.
Code:
\svgpath{{C:/Users/me/Google\ Drive/foo}}
\includesvg[width = 200pt]{tux}
Error:
** (inkscape.exe:27228): WARNING **: 20:52:43.840: Can't open file: tux.svg (doesn't exist)
** (inkscape.exe:27228): WARNING **: 20:52:43.840: Can't open file: tux.svg (doesn't exist)
** (inkscape.exe:27228): WARNING **: 20:52:43.840: Specified document tux.svg cannot be opened (does not exist or not a valid SVG file)
The system cannot find the file specified.
The system cannot find the file specified.
I wish it would give me more debugging information so I could tell what directory is being used. I've enabled --shell-escape. I've tried various combinations with no success.
EDIT: Minimal example
\documentclass{article}
\usepackage{svg}
\begin{document}
\includesvg{tux}
\end{document}
I created a directory c:\latex
My command line is texify --pdf --engine=luatex --synctex=1 --tex-option=--shell-escape --clean foo
I noticed that it also says there's a log file, but I cannot find a log file with more information
Package svg Warning: The export with Inkscape failed for file
(svg) `tux.svg'
(svg) Troubleshooting: Please check in the log file how
(svg) the invocation of Inkscape took place and try to
(svg) execute it yourself in the terminal on input line 5.
I would love to get my hands on that mythical log file. There's a foo.log file but that just says what my console output was. There's another log file at C:\Users\james\AppData\Local\MiKTeX\2.9\miktex\log\texify.log, but that doesn't have any information about the inkscape command either.
The docs (http://mirror.its.dal.ca/ctan/graphics/svg/doc/svg.pdf) say that I should see runsystem ....
The problem is the --clean option. I figured this out by selected pdflatex in TeXWorks and it suddenly built. Taking out options one by one helped me get to the bottom of this. Going back to post on some other questions.
As #samcarter pointed out, if you don't have to use texify, try not to. One of my packages requires LuaLaTex to typeset, so I selected the LuaLaTeX +MakeIndex +BibTex when I only needed the LuaLaTex plain option. Using that one fixed the issue.
If you have to use texify, though, try removing the --clean.

knitr error when using lua-filter/task-list.lua

I am trying to use task-list.lua to create square checkboxs. The following codes were included in yaml.
output:
html_document:
pandoc_args:
- --lua-filter=task-list.lua
When I run the file in R-studio on a mac, everything works fine. However, I couldn't manage to make it work on Windows. I updated R-Studio, R markdown, markdown, knitr and other dependicies, and placed the lua filter task-list.lua in ~/.pandoc/filters/task-list.lua.
Here is the error Error: pandoc document conversion failed with error 5.
By the way, without
pandoc_args:
- --lua-filter=task-list.lua
it works fine.
With
pandoc_args:
- --filter
- --lua-filter=task-list.lua
it says
Error running filter --lua-filter=task-list.lua:
Could not find executable --lua-filter=task-list.lua
Any suggestion why it doesn't work and how to make this work on windows using knitr? Thank you!

fatal error: zbar.h: No such file or directory

I downloaded the zbar library and cloned the opencv-zbar repo in my home directory. Then I ran the following command $cmake . which gave my the error
-- Could NOT find ZBAR (missing: ZBAR_LIBRARIES ZBAR_INCLUDE_DIR)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ZBAR_LIBRARIES
linked by target "zbar_opencv" in directory /home/surabhi/opencv-zbar
-- Configuring incomplete, errors occurred!
See also "/home/surabhi/opencv-zbar/CMakeFiles/CMakeOutput.log".
I then made two changes in my CMakeCache.txt as follows
//Path to a file.
ZBAR_INCLUDE_DIR:PATH=/usr/include/zbar
//Path to a library.
ZBAR_LIBRARIES:FILEPATH=/usr/lib/libzbar.so
because the were set to NOTFOUND.
It then gave me no errors
-- Found ZBAR: /usr/lib/libzbar.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/surabhi/opencv-zbar
But when I run make
It gives the error:
fatal error: zbar.h: No such file or directory
#include <zbar.h>
^
compilation terminated.
I don't understand why I get this error as It says Found ZBAR when I run cmake.
Thanks in advance
You need to do actually use the include dirs somewhere in your CMakeLists.txt so CMake knows that you actually want to use these include paths.
Examples:
include_directories(${ZBAR_INCLUDE_DIR})
Or the more modern, recommended way:
target_include_directories(zbar_opencv PRIVATE ${ZBAR_INCLUDE_DIR})

scons: source directory does not get copied into build directory

Part of my build process is to create a tar file of an input directory, located at src/bundle/bundle. In src/bundle/SConscript:
Import('*')
bundleDir = Dir("bundle")
jsontar = Command("bundle.tar", bundleDir,
"/home/dbender/bin/mkvgconf $SOURCE $TARGET")
in my SConstruct:
SConscript(Split('src/bundle/SConscript'),
exports='bin_env lib_env', build_dir='tmp/bundle')
When attempting to build:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/home/dbender/bin/mkvgconf tmp/bundle/bundle tmp/bundle/bundle.tar
Input directory tmp/bundle/bundle not found!
scons: *** [tmp/bundle/bundle.tar] Error 1
scons: building terminated because of errors.
Clearly scons is not copying the src/bundle/bundle to tmp/bundle/bundle, but I am stumped as to why.
Footnotes:
Using absolute pathname for mkvgconf is bad practice but just intermediate until I have this problem solved.
SCons doesn't know anything about the contents of your input src/bundle/bundle - only the program mkvgconf knows what it does with that directory.
One solution is to add an explicit dependency in the SConscript:
import os
Depends('bundle.tar', Glob(str(bundleDir) + os.path.sep + '*'))
That also means that when you update the contents of the bundle directory, the mkvgconf script will be rerun.
PS. you might want to change the build_dir argument name to variant_dir, as the former is deprecated in favor of the latter in recent SCons releases.

Resources