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

Hover preview breaks when loading common packages #2740

Open
LorentsL opened this issue Dec 7, 2022 · 2 comments
Open

Hover preview breaks when loading common packages #2740

LorentsL opened this issue Dec 7, 2022 · 2 comments

Comments

@LorentsL
Copy link

LorentsL commented Dec 7, 2022

Environment

  • TeXstudio: 4.4.0
  • Qt: 6.4.1
  • OS: Windows 11
  • TeX distribution: texlive

Expected behavior

Expected to see the tooltip popup previews of mathematical formulas, in documents using luacode and loading microtype.

Actual behavior

When I switched to LuaLaTeX the previews couldn't compile properly. The problem occurs when loading microtype.

I tried the workaround of keeping pdfLaTeX just for the previews, but this does not work when loading luacode.

How to reproduce

Change the settings to Preview -> Command: Preview with lualatex.
Make sure that the checkbox "Show preview as tooltip on formulas in editor" is ticked.

Minimal non-working example:

\documentclass{article}
\usepackage{microtype}
\begin{document}
	$A$ $B$
\end{document}

Hover over a dollar sign in $A$. The preview works as expected. Do the same with $B$. The preview doesn't show. The message "Process exited with error(s)" is displayed.

Similar problem (perhaps less surprising):

Change the settings to Preview -> Command: Preview with pdflatex.
Minimal non-working example:

\documentclass{article}
\usepackage{luacode}
\begin{document}
	$A$
\end{document}

The preview doesn't show up. The message "Process exited with error(s)" is displayed.

@octaeder
Copy link
Contributor

octaeder commented Dec 7, 2022

lua can make problems, f. ex. with tikz. In this case unset adv. option for preview as follows:

grafik

Of course this will slowdown preview depending on the size/amount of code of the preamble.

@octaeder
Copy link
Contributor

For a description on how to find the temp files s. #2785.

The 1rst case (with code given above) doesn't run with option precompile preamble. There is nothing we can do. So deactivate precompile preamble, then inline preview and tooltip preview work:

image

Details: Compiling with precompiled preamble shows messages like this:

File: mt-LatinModernRoman.cfg 2021/02/21 v1.1 microtype config. file: Latin Mod
ern Roman (RS)
[\directlua]:1: attempt to index a nil value (global 'microtype')
stack traceback:
	[\directlua]:1: in main chunk.
MT@ifstreq ...{microtype.if_str_eq([[#1]],[[#2]])}
                                                  endcsname 
l.111    }

The lua interpreter ran into a problem, so the
remainder of this lua chunk will be ignored.

The 2nd case will succeed when switching to preview with lualatex. You can't use pdflatex here.

@sunderme From my point of view this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants