Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

12

Here's some reasons why I prefer babel over polyglossia for lualatex. babel's base is part of the LaTeX core packages actively developed, but poyglossia is only getting a few minor updates. babel's RTL and BiDi support is really nice for lualatex now. But polyglossia only supports RTL text with xelatex. babel's new ini system for setting up languages is ...


11

There are 79 language definition files (gloss-XX) in the polyglossia folder. For a thorough comparision you would have to compare for every language how good the gloss-file is, if it works with lualatex, if babel provide definitions for this language too and how good it works with lualatex. And naturally you also need to check if babel knows language which ...


10

I don’t have the patience to type more than the first letter, but here’s the principle: enter the letter first, then the diacriticals above it, starting with the one closest to the letter and working out, and after that the diacriticals below it, again starting from the closest and working out. Here I’ve done it entering the combining diacriticals directly (...


10

The XeTeX behavior is a combination of HarfBuzz “features” and font limitations. Unicode has something called canonical equivalence. When a certain code point sequence is said to be canonically equivalent with another one, Unicode specify that both sequences should be rendered the same. One example of this is ḍ (U+1E0D LATIN SMALL LETTER D WITH DOT BELOW) ...


8

With a current luaotfload (version 2.96) you can disable the ligatures in the SmallCapsFeatures: \documentclass[% a4paper, DIV=9, fontsize=14pt, parskip=half- ]{scrartcl} \usepackage[ngerman]{babel} \usepackage{fontspec} \setmainfont{TeX Gyre Termes}[% Ligatures=Common, SmallCapsFeatures= {Letters=UppercaseSmallCaps, ...


8

The problem is that you are at the end of the math and luatex doesn't insert the italic correction at the boundary between math and text. You can avoid the problem by inserting some invisible char but it is not quite clear which char is the best choice, in the chat we discussed this a few times and suggestions were \Uchar"200B and 🦆: \documentclass{...


7

\documentclass[12pt,a4paper]{article} \directlua{ function prod(a,b) tex.print("$" .. a .. "\string\\times" .. b .. "=" .. a*b .. "$") end } \begin{document} The product of 2 and 3: \directlua{prod(2,3)}. \end{document} One tricky thing is getting the backslash escaping game right: LuaTeX: How to handle a Lua function that prints TeX macros....


6

Just for completeness, here's a solution that shows how to (a) write the Lua code to an external file, (b) load the Luacode via a \directlua{dofile("...")} directive, and (c) set up a LaTeX "wrapper" macro (called \showprod in the example below) whose function (pun intended) is to invoke the Lua function. Note that with this setup, one can write \\ rather ...


6

\documentclass[12pt,a4paper]{article} \begin{document} \directlua{ function prod(a,b) tex.print(a.. "$\string\\times$".. b.. "$=$".. a*b) end } The product of 2 and 3: \directlua{prod(2,3)}. \end{document}


6

Here is an automated approach that reconditions the arguments of \section to look for specified ligatures, such as fl and to replace them with, for example, f\kern0ptl. In the MWE, look for the lines between \makeatletter and \makeatother for the approach. As an aside, I actually used the same method to also increase the default kern of the space character ...


6

The lmodern package should not be used with XeLaTeX or LuaLaTeX. Also, support for Icelandic in babel has not yet been updated for using the TU encoding. Moreover the Latin Modern font does not support Cyrillic. Here's the same with fontspec and polyglossia, using the CMU fonts (which are Unicode clones of Computer Modern). \documentclass[11pt,a4paper]{...


6

[(i) Added an extra operation in the Lua function 'conv' to address the OP's follow-up request. (ii) Implemented Ulrike Fischer's suggestion to use ^^^^ notation to typeset 4-byte characters. ] Since you're using LuaLaTeX, here's a solution that employs a Lua function to convert strings of the form '<U%+(.-)>' to '^^^^%1'; here, %+ represents the ...


5

The undefined control sequence is \Users which is part of the path. Even though here \ is meant to be the path separator, LuaTeX doesn't know that and just feeds the path with the currently active catcodes back to TeX, where \ happens to be the escape characters. Luckily, you can tell tex.sprint to use a different catcode table using an optional argument. ...


5

Those symbols are in fact available from the text font, which is already loaded in bold, so if it is just one or two symbols needed it's probably simpler to access the text font, and then use \mathbin to set the right math spacing. I did it inline here but you could define a local \boldwedge command. \documentclass{article} \usepackage{amsmath} \usepackage{...


4

\filename@parse is defined in lualatex, the example document that you reference at Extract filename from path gives the same results in pdflatex or lualatex.


4

You can easily get the basename in LuaTeX using the FFI and a platform-dependent function. On POSIX-based systems you can use the basename() function. Because it uses the FFI you have to enable --shell-escape. In tex.sprint I use the first argument -2 to switch to verbatim catcodes, in case the path contains any characters which are treated special by TeX,...


4

Solution As @marmot (let’s say) suggested, the multicols indeed works with tikzpicture, however, at first I did not manage to make it work. After some trials and errors, I made it work in combination with some other tweaks. In comparison with the MWE from the question, I made the following changes: added \usepackage{multicol}; modified the \rubrics and \...


3

The lfs library is available out-of-the-box in LuaTeX. As such, you do not need to do anything special: it will 'just work'. A very minimal demo for both plain LuaTeX and LuaLaTeX: \directlua{print(lfs.currentdir())} \csname @@end\endcsname \end


3

You can manually specify the script with fontspec. This should work (although I don't have the font to test). \setmainjfont[ Path = \ProjectAbsolutePath, UprightFont = fonts/HGS_Mincho/HGRMB.ttc, BoldFont = fonts/HGS_Mincho/HGRME.ttc, ItalicFont = fonts/HGS_Mincho/HGRMB.ttc, BoldItalicFont = fonts/HGS_Mincho/HGRME.ttc, ...


3

\ifx only looks at the first level expansion when comparing two control sequences and cannot compare strings. \documentclass{article} \usepackage{fontspec} \setmainfont[Script=Arabic]{Amiri} \ExplSyntaxOn \NewExpandableDocumentCommand{\ifdirTLT}{mm} { \str_if_eq:eeTF { TLT } { \lua_now:n { tex.print(tex.textdir) } } { #1 } { #2 } } \ExplSyntaxOff ...


3

You need to expand the \directlua before the test. E.g. \documentclass{article} \usepackage{fontspec} \setmainfont[Script=Arabic]{Amiri} \ExplSyntaxOn \cs_generate_variant:Nn\tl_if_eq:nnTF {xn} \def\foo{\tl_if_eq:xnTF{\directlua{tex.print(tex.textdir)}}{TLT}{TLT}{TRT}} \ExplSyntaxOff \begin{document} % \foo ; \directlua{tex.print(tex.textdir)} \...


3

I'm still not 100 percent sure what you are trying to do; I don't find your intention completely clear from the code. So far as using Lua is concerned, I think you will, on balance, be better off setting up a command that does each line, rather than trying to do something that does the whole table. That leaves you setting up the table, but using your ...


3

You can substituate glyphs conditionally. The main problem is to find out the correct name. In EBGaramond I found e.g. a variant called sinf: \documentclass[12pt]{article} \usepackage{fontspec} \directlua{ fonts.handlers.otf.addfeature{ name = "apo-sc", type = "chainsubstitution", lookups = { { type = "substitution", ...


3

As Marcel pointed out, there is a stray space in your input. You can remove that space, as Marcel suggests, or you can add \ignorespaces, within your macro definition, to your argument of \textbf, prior to #1. Also, there is no need for the \textbf{} to be in its own braces, so I removed it. Note: an alternative for that part of the definition that now ...


2

The result of your test file is with tl19 and the next luaotfload version for automatichyphenmode=1 is: Glyph Glyph Glyph Glyph Glyph Glyph Disk > Subtype 2 Glyph with automatichyphenmode=0 I get: Glyph Glyph Glyph Disk > Subtype 2 Glyph Glyph Disk > Subtype 2 Glyph This is imho identical to your table, and it is also the ...


2

Your code fails as the backslash used on windows in the path is in lua also the escape char. As the path is passed on to the lua backend one need to escape the backslash with another backslash. You can use \luaescapestring for this. \edef\currfileabsdir{\luaescapestring{\directlua{tex.sprint(-2,lfs.currentdir())}}/} Or if you want to use \currfileabsdir ...


2

Don't use T1 encoding and newpxtext math with luatex. You can do something like this: \documentclass[size=a4, 12pt]{scrartcl} % Math \usepackage{amsmath} \usepackage{faktor} % Fonts \usepackage{newpxmath} \usepackage{fontspec} \setmainfont{TeX Gyre Pagella} \DeclareSymbolFont{operators}{TU}{\rmdefault}{m}{n} \SetSymbolFont{operators}{bold}{TU}{\...


2

The undefined control sequence is the thing just before the line break: \documentclass{article} \begin{document} \quad\acommandthatdoesntexist\quad \end{document} Has the output: ! Undefined control sequence. <*> \quad\acommandthatdoesntexist \quad In your case, that appears to be \Users, which may suggest that TeX is trying to ...


2

pdfx with x-a loads hyperref with the option draft and this disables the link colors. There is no user level setting to get them back. You will either have to redefine \ref to add the colors, or redefine internal hyperref commands: \documentclass{article} \usepackage[x-4]{pdfx} %option x-4 for print, a-1b for archive (also display) \hypersetup{colorlinks, ...


2

I don't have the font to actually check this approach, so what I did as a surrogate is to print apostrophes in bold red those which should be output as \textup{'}, and those in black will be output as \scshape'. I use listofitems to redefine \textsc. Here I search for all combinations of capital letters followed by an apostrope. While all the rest of the ...


Only top voted, non community-wiki answers of a minimum length are eligible