New answers tagged

7 votes
Accepted

Redirect tex.print output to a file

You can overwrite the function definition (see https://stackoverflow.com/a/4510038/): function to_file ( x ) local file_name = "Foo" out = io.open( file_name .. ".tex", 'w'...
user avatar
  • 30.5k
1 vote
Accepted

How to change font from old pdflatex packages to new lualatex definitions

As a replacement of your current fonts you could try this (uncommenting the set of fonts to test): \documentclass[a4paper,openany]{scrbook} \usepackage{amsmath} \usepackage{unicode-math} % -> ...
user avatar
  • 1,027
0 votes
Accepted

LuaLaTeX - Table (tabularx) Can't get rid of underfull hbox (badness 10000)

You can fill the underfull box to remove the warning \begin{tabularx}{\linewidth}{@{\extracolsep{\fill}} >{\hsize=1.05\hsize\RaggedRight}X| >{\hsize=1.15\hsize\RaggedRight}X >{\hsize=0.9\...
user avatar
4 votes
Accepted

How to pass the content of a TeX variable to Lua without luastring and luacode?

You need a Lua string assignment so JobName = "\jobname" or \directlua{ JobName = "\luaescapestring{\jobname}" } If you need exotic filenames
user avatar
3 votes

Understanding implicit error on a recursive function

If I start from a directory $ ls -lR .: total 15 -rwxrw-r--+ 1 davidc davidc 652 Aug 12 08:30 aa.log -rwxrw-r--+ 1 davidc davidc 596 Aug 12 08:30 aa.lua -rwxrw-r--+ 1 davidc davidc 9639 Aug 12 08:30 ...
user avatar
4 votes
Accepted

Dealing with curly braces in LuaLaTeX

You can not start an environment in one cell and end it in another, so (as is often the case) \begin{luacode} isn't helping here. Your Lua code works fine though: \documentclass{article} \begin{...
user avatar
0 votes

In Luatex, how to know effective output directory?

The value is stored in the global variable output_directory in the C source file, unfortunately it's not exported to Lua. I thought it would be possible to do something like kpse.find_file("a.log&...
user avatar
  • 3,006
0 votes

Lualatex windows system calls not functioning

It wasn't a package issue. apparently, it was a command line issue, that I wasn't aware of. doesnt work: lualatex my.tex --shell-escape does work: lualatex --shell-escape my.tex Here it looks like the ...
user avatar
1 vote

Soft hyphens with priority don't change style with their environment but should do so

This post isn’t an answer (at least directly) to the original question, but to a comment. It’s a full answer because the explanation is a bit large and, on the other hand, it provides an alternative ...
user avatar
  • 7,569
3 votes

mathbf font does not show in LuaLaTeX

For unicode-math to automatically sync the text fonts into math mode, don't explicitly set \setmathrm, \setboldmathrm, \setmathsf, etc. MWE \documentclass{article} \usepackage{xcolor} \...
user avatar
  • 7,686
3 votes

Recovering discarded items in the output routine

See \savingvdiscards in the e-tex manual. All engines use e-tex extensions (disabled in dvi plain tex)
user avatar
2 votes

Troubles with listings and polish characters (lualatex)

Just for comparison. What we can do with OpTeX: \fontfam[lm] \hsize=10cm \noindent Przetestujmy możliwości języka C++, oraz wiszące litery na końcu zdania i coś tam jeszcze: \verbinput \hisyntax{C} (...
user avatar
  • 54.2k
5 votes
Accepted

Troubles with listings and polish characters (lualatex)

A few bugs here. In pdflatex the transforms = oneletter.nobreak babel option is not supported. So you must use lualatex (or remove that feature) In lualatex do not use fontenc or inputenc. (by the ...
user avatar
  • 3,006
2 votes
Accepted

Trying to assign priorities to different breaking points in a word. Discretionary broken?

This is an engine level bug in the luatex source (texlang.c) Hans is testing a fix which looks good so far: So this will be fixed at source in the next day or so, so in texlive 2023 (probably earlier ...
user avatar
2 votes
Accepted

Soft hyphens with priority don't change style with their environment but should do so

This looks like a bug at the engine level so not really fixable in babel it is losing the font if the fields in the discretionary are empty as shown by this plain TeX example. The workaround is to ...
user avatar
1 vote

Fontsetup - switch fonts

You cannot change the one (main) font defined by fontsetup. But you can define new font families to change the font in the middle of the document. % !TeX TS-program = lualatex \documentclass{article}...
user avatar
  • 28.2k
3 votes
Accepted

Make4HT - Required Output HTML File specific Name

You can use the -j or --jobname option to rename the output file. It works with both tex4ebook and make4ht. Your command can look like this: tex4ebook -j 9780132132-fm02 -m draft -a -debug -f epub3 ...
user avatar
  • 45.6k
0 votes
Accepted

Passing tex value to a lua function

The expansion (=replacement text) passes to lua, as the comment attests. A function in a programming language would have a return value (like in lua); in a macro language (like TeX or SAS macro), the ...
user avatar
  • 7,686
1 vote
Accepted

How to Prevent Titlesec from Automatically Producing an Entry in the TOC

It's almost always a bad idea to do things manually. And the sectioning commands provide built-in methods for distinguishing what goes into the TOC from what goes into the section heading itself. ...
user avatar
  • 203k
2 votes

Accents with eulervm and LuaLaTeX in beamer with sans font

Compiling your example on a TeXLive (linux), I get Fira Sans (Light weight) fonts for text and indeed CM (serif) fonts for maths. You can choose the matching Fira maths fonts (sans serif only ...
user avatar
  • 1,027
2 votes

Accents with eulervm and LuaLaTeX in beamer with sans font

I had the same problem and found an answer using this question Eulervm and LuaLaTeX results in wrong front for math operators. This is not very elegant, but it does work for Windows fonts as well (I'm ...
user avatar
1 vote
Accepted

Centering an Arabic Section Number Above Justified Title Text

You want display style and, of course, to add the formatting instructions to the \titleformat code, not to the section title. \documentclass{book} \usepackage{lipsum} \usepackage{titlesec} \...
user avatar
  • 1.0m
2 votes
Accepted

Intersection line not correct in PSTricks (3D) and warning "transparency ignored"

Use \psSolid[object=surfaceparametree, linecolor=blue, base=Pi neg Pi -3 3, fillcolor=red, function=plane2,ngrid=0.05 0.05,action=none,name=firstplane] see also for -dNOSAFER ...
user avatar
  • 12.9k

Top 50 recent answers are included