I have the following LuaLaTeX code that I want to be able to have coupled with the functionality of the LaTeX Previewer addon on Windows
documentclass[letterpaper,12pt]{article}
usepackage{microtype}
usepackage[left=1.5cm, right=1.5cm, top=1.5cm, bottom=1.5cm]{geometry}
usepackage{mhsetup}
usepackage{empheq}
usepackage{mathtools} % loads amsmath and graphicx
usepackage{newfloat} % use first over float
usepackage{float}
usepackage{indentfirst}
usepackage{amsthm}
usepackage{amssymb} % already loads amsfonts
usepackage{enumitem}
newlist{checkboxlist}{itemize}{1}
setlist[checkboxlist]{label=$square$}
newlist{alphabetization}{enumerate}{1}
setlist[alphabetization]{label=alph*.)}
setlist{nosep}
usepackage{cancel}
usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
setmainfont[Ligatures=TeX, BoldFont=Timesbd.ttf, ItalicFont=Timesi.ttf, BoldItalicFont=Timesbi.ttf]{Times.ttf}
setmathfont{STIXTwoMath-Regular.otf}
makeatletter
renewcommand{maketitle}
{{centering
normalsize{@title} \ smallskip
normalsize{@author} \ smallskip
normalsize{@date} \ vspace{baselineskip}
}}
makeatother
AtBeginDocument{%
setlengthabovedisplayskip{0pt}%
setlengthabovedisplayshortskip{0pt}%
setlengthbelowdisplayskip{0pt}%
setlengthbelowdisplayshortskip{0pt}%
}
showoutput
% Environments And Counters
newcounter{problemcounter}
NewDocumentEnvironment{problem}{o}{
IfNoValueTF{#1}
{refstepcounter{problemcounter}}
{setcounter{problemcounter}{#1}}
{centering textsc{Problem arabic{problemcounter}.}par}}{
}
newenvironment{solution}{
{par centering textsc{Solution:}par}}{
}
newenvironment{justification}{
{centering textsc{Justification:}par}}{
}
setlengthparindent{.25cm}
% Commands
newcommand{ds}{displaystyle}
newcommand{blk}{vspace{baselineskip}}
title{Homework}
author{Félix Maldonado Ramírez}
date{today}
begin{document}
maketitle
begin{problem} % 1
begin{solution}
end{solution}
end{problem}
begin{problem} % 2
begin{solution}
end{solution}
end{problem}
begin{problem} % 3
begin{solution}
end{solution}
end{problem}
begin{problem} % 4
begin{solution}
end{solution}
end{problem}
begin{problem} % 5
begin{solution}
end{solution}
end{problem}
begin{problem} % 6
begin{solution}
end{solution}
end{problem}
begin{problem} % 7
begin{solution}
end{solution}
end{problem}
begin{problem} % 8
begin{solution}
end{solution}
end{problem}
begin{problem} % 9
begin{solution}
end{solution}
end{problem}
begin{problem} % 10
begin{solution}
end{solution}
end{problem}
end{document}
What I have installed already: TeX Live, VSCode with LaTeX Workshop, LaTeX Utilities, and Zotaro LaTeX
The instructions for getting the extension setup go like this:
- Search for LaTeX Previewer in VS Code Extensions or Open VSX and click Install
- Go to the extension settings and set the LaTeX font diretory for your LaTeX distribution e.g. for MiKTeX on Windows C:UsersAppDataLocalProgramsMiKTeXfonts or for TeXLive native on Linux /usr/share/texmf/fonts
- The system font path will also be searched for font files
- Open a LaTeX file and run LaTeX Preview: Show Preview from the Command Palette or click the Preview icon
When I find the font folder inside texmf-local, I click on properties, look at Location and see “C:texlivetexmf-local”. I then copied and pasted this into the box needed as shown in the picture.
Though, when I go to the .TeX file and do Ctrl+Shift+L, it does not show the preview. instead I get this error.
dvilualatex --halt-on-error --interaction=nonstopmode --synctex=-1 c:UsersPanolaDocumentsLuaLaTeX Calculus 1HomeworkSetter.tex
This is LuaTeX, Version 1.18.0 (TeX Live 2024)
restricted system commands enabled.
! Undefined control sequence.
<*> c:Users
PanolaDocumentsLuaLaTeX Calculus 1HomeworkSetter.tex
! ==> Fatal error occurred, bad output DVI file produced!
No pages of output.
Error: Command failed: dvilualatex --halt-on-error --interaction=nonstopmode --synctex=-1 c:UsersPanolaDocumentsLuaLaTeX Calculus 1HomeworkSetter.tex
Could not generate dvi file - review the log for errors.
And when I enable debug mode to enable debug messages, I get a list of windows fonts (all five fonts that I have in the code appear in the list)
Can someone help me figure out why my setup doesn’t work? I don’t know why this doesn’t work, but if someone could help me, it would be a huge help. Thank you for reading. Have a nice day!
Felix Maldonado is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.