New answers tagged

5

The convertor from DVI to HTML doesn't support OpenType fonts, which is automatically selected when the Fontspec package is loaded. This is well known tex4ht bug and also one which is hardest to fix. There are two possible workarounds, both of them require modification of the document, unfortunately. First is to use conditionally luainputenc package: \...


4

If I compile the following example with LuaLaTeX from TeX Live 2015 \documentclass{beamer} \begin{document} \begin{frame} \begin{itemize} \item \'Angel \item Ángel \item Pedro Rodr\'{\i}guez \item Pedro Rodríguez \end{itemize} \end{frame} \end{document} I get which is expected. If I add also \usepackage[T1]{fontenc}, the output is but it is ...


2

Try this and see if it works for you \documentclass[mpinclude=true]{scrbook} \IfFileExists{luatex85.sty}{\usepackage{luatex85}}{} \usepackage{scrlayer-scrpage} \pagestyle{scrheadings} \usepackage{scrlayer-notecolumn} \begin{document} This is \makenote{margin note} test. \end{document}


0

Note this answer assumes you didn't add the TeX Live fonts to the system environment variables such that they are found when fontspec searches the system fonts. (either because you don't know how or because it isn't practical e.g. multi-client Version Control System situation) Assuming you are using XeLaTeX: To minimize maintenance with each sequential TeX ...


2

I am using the following python script. The result required some small tweaking. #!/usr/bin/env python3 import sys import fileinput import unicode_tex excluded_chars = ['\\', '&', '$', '{', '}', '%', ' ', '_', '~', '\'', '`', '^', '*', '#'] tex_replacements = unicode_tex.unicode_to_tex_map.copy() for char in excluded_chars: tex_replacements.pop(...


4

Here is a ConTeXt implementation of the command. I use a slightly different API call to get the reputation. ConTeXt has an inbuilt mechanism to download remote content. This content is cached in a directory inside texmf-cache. So, the idea is to simply download the content, unzip it, convert from json to lua table, and access the value of the key ...


4

@topskip: Start using ConTeXt again! Other TeX ligatures (-- and ---) are enabled by default, quotes are not! \setupbodyfont[dejavu] \starttext "Heading" \stoptext


7

The warning "pop empty color stack" is usually caused by color stack commands out of order. A typical scenario is the use of low level box set command \setbox instead of LaTeX box set macros (\sbox, environment lrbox, ...). When LaTeX sets a color, then the color reset command is issued after the current group. Therefore LaTeX box macros add a group layer ...


10

Well what it means is that's you've corrupted the colour stack. Unlike font changes colour is not an intrinsic attribute of a tex box, so colour changes are managed by nodes marking the change of state whatsit, Originally it was very hard to maintain colour correctly over page breaks, as the macro package needed to normalise colour in the page headings and ...


6

With the new luaotfload syntax for the definition of extra font features (from v2.7 on, I guess). Basically, we condone ligaturing the " to ”, but then have a font feature which substitutes ” back to ". It might also be possible to hook into the ligaturing callback to prevent this particular ligature. Disclaimer: I have no idea what I'm doing. \...


3

You want to disable the automatic Ligatures=TeX feature: \documentclass{article} \usepackage{fontspec} \defaultfontfeatures[\rmfamily]{} \setmainfont{DejaVu Serif} \begin{document} "Heading" \end{document}


25

If you just want the code, and not the explanation, look here. The trick is to use the Stack Exchange API to download the information on a user. For example, to get my own user information (regarding tex.se), I would go to http://api.stackexchange.com/2.2/users?inname=digitalis_&site=tex. For a different user, or a different site, you would change the ...


6

\documentclass{article} \makeatletter \let\pc\@percentchar \makeatother \newbox\zzz \newcommand{\measureme}[1]{% \sbox\zzz{#1}% \typeout{from TeX ht:\the\ht\zzz, dp:\the\dp\zzz, wd:\the\wd\zzz}% \directlua{ local n = tex.getbox('zzz') print(string.format("from Lua ht:\pc fpt, dp:\pc fpt, wd:\pc fpt", n.height/65536, ...


6

It's not much different from things like \chapter{abc \eqref{def}} (\eqref is one of the few fragile commands). The macro \luaexec is fragile, so it should be protected; burying it into another command is not sufficient, unless the other command is protected. \documentclass{book} \usepackage{luacode} \newcommand\CalculusResult{% \luaexec{Calculus = 1/3 ...


5

If for some reason you don't want to use luacode after having loaded the package then you can do \documentclass{article} \usepackage{luacode} \makeatletter \let\percent\@percentchar \makeatother \begin{luacode*} function foo(myStr) tex.print("\\begin{verbatim}"..myStr.."\\end{verbatim}") end \end{luacode*} \begin{document} \directlua{foo("\...


7

If you change the line --print("\begin{verbatim}".."\end{verbatim}") to --print("\\begin{verbatim}".."\\end{verbatim}") your code will compile just fine whether you employ the luacode or the luacode* environment. In the luacode environment, TeX macros are expanded. Since Lua and TeX "see" the backslash character differently, you need to write \\, ...


7

The luacode package manual lists which constructs work in which form in a table on page 2. (lucode and luacode* are both documented as supporting -- comments.) The problem is occurring before lua is being called as you have not prevented \begin and \end expanding in TeX while the chunk to be passed to lua is constructed. You need \string\begin and \string\...


7

Crimson is useful for experimenting with the new approach, because it’s free and defines few of the features it could support. Here are the features defined in its latest version: | r | i | b | bi | sb si | |------+---+---+---+----+-------| | c2sc | ✓ | ✓ | ✓ | | | | kern | ✓ | ✓ | ✓ | ✓ | ✓ | | liga | | | | ✓ | | | onum | ✓...


3

luatex has removed the fontforge libraries and with them dfont support. https://github.com/lualatex/luaotfload/blob/master/NEWS there seem to be many sites and applications offering free dfont conversions, so if the font licence allows it that is a possibility, or you could use one of the many Helvetica style fonts such as Tex gyre heros or URW Nim­bus ...


3

Before fontspec is loaded the document class defines all font sizes, the reason why Latin Modern is used here as a default. However, after loading fontspec and using \setmainfont everything is redefined. Compare the output: in the left column there is Minion Pro and in the right Latin Modern. \documentclass[twocolumn]{article} \usepackage{fontspec} \...


4

Section 8.6 of the fontspec manual says: [...] OpenType fonts with optical scaling will exist in several discrete sizes, and these will be selected by XETEX and LuaTEX automatically determined by the current font size [...] But it can only do so, if it gets the information it needs to make this automatical selection. What information does it need? ...


2

It is indeed an issue with luatoftload as Mico said. But unfortunately the fix is not as simple as he shows. Mico's answer will not help the font loader to properly use the correct optical sized fonts (MinionPro-BoldCapt, etc.). And at the moment there's no fix from the fontspec end. Instead, you will need to patch the name database generated by luaotfload. ...


2

I'm guessing this is a luaotfload issue. At any rate, using the instruction \setmainfont[BoldFont={Minion Pro Bold}]{Minion Pro} instead of \setmainfont{Minion Pro} fixes the problem. A full MWE: \documentclass{article} \usepackage{fontspec} \setmainfont[BoldFont={Minion Pro Bold}]{Minion Pro} \begin{document} \huge huge \textbf{huge} \Huge Huge \...


6

Here is an update for bm in luatex using classic math font setup. It does not do the right thing for opentype math fonts with unicode-math (where it is not always clear what the right thing should be as most such setups do not include a bold font) \documentclass{article} \usepackage{bm} \makeatletter \def\bm@test@token#1{% \let\bm@next\@empty \ifx#1\@...


1

This is a bug introduced by lualatex shipped with TexLive 2016. The next version of pgfplots will fix the incompatibility (will be 1.14).


3

You can use the UprightFeatures to limit the effect only to the upright fonts. \documentclass{article} \usepackage{fontspec} \directlua{ fonts.handlers.otf.addfeature { name = "ktest", { type = "kern", data = { ["A"] = { ["V"] = -1000 }, } }, "extra kerns" } } \setmainfont[UprightFeatures={RawFeature=+...


4

If you only need to export a value as a macro, i.e. a macro without a signature, then you could also use the token library of LuaTeX. The same as in Joseph's answer applies here: Because luacode* is grouping you have to add the "global" specifier. \documentclass{article} \usepackage{luacode} \begin{luacode*} MyVal = 123 token.set_macro("MyVal",MyVal,"...


5

Just update to the latest version of luatex85 package and remove: \edef\pdfcreationdate{\pdffeedback creationdate} \pdfcreationdate is (now) defined in a way compatible with dviluatex.


5

% !TeX program = lualatex \documentclass[11pt]{scrbook}%ext \usepackage{luatex85} %needed else gets an error with lualatex in 2016 \edef\pdfcreationdate {\pdffeedback creationdate} \usepackage[us,12hr]{datetime} \begin{document} \currenttime \end{document} http://github.com/josephwright/luatex85/issues/2


4

The file /usr/local/texlive/2016/texmf-dist/tex/generic/tex4ht/html4.4ht contains a spurious character <A0> in line 1267 1265 \let\sv:etoc\e:tableofcontents 1266 % 1267 <A0>\Configure{tableofcontents} 1268 {\IgnorePar\EndP\HCode{<div class="\sec:typ TOCS">}\IgnorePar} The output was obtained with LESSCHARSET=ascii less -...


3

It's a misfeature, but a workaround is to load again the main math font for the \mathscr range; you also have to declare anew the main math font. \documentclass{article} \usepackage{mathtools} \usepackage{ fontspec, unicode-math, } \setmathfont{Latin Modern Math} \setmathfont{XITS Math}[ range = \mathcal, ] \setmathfont{Latin Modern Math}[ ...


3

Your MWE works just fine here, with LuaLaTeX as well as with XeLaTeX. With identical, correctly typeset results. Obviously you do have a faulty version of Minion Math fonts. From where did you get the fonts? Please do send me (as I'm the creator of Minion Math fonts) your font file and your resulting PDF.


6

The easiest way is to load luatex85 package. You probably will need to load it before documentclass, using RequirePackage The longer story is that luatex now no longer defines many primitives with pdf prefix. The luatex85 package defines aliases of primitives which have the same names as in pdftex and earlier versions of luatex.


7

The fix is easy: add \RequirePackage{luatex85} as the very first line, a temporary workaround until standalone is updated. It should do no harm even after the update. \RequirePackage{luatex85} \documentclass{standalone} \begin{document} hi \end{document}


5

[This is not a solution but a workaround] You say, that there is an upcoming deadline and there might be no fix available until then. Here is a workaround, which requires the amsmath package (which you most probably use). It defines \bm to use the \boldsymbol macro from amsbsy (loaded automatically by amsmath). Keep in mind that there are certain ...


0

Partial solution for XML export In the case of information retrieval, @DavidCarlisle advised me to take a look at LaTeXML. On the website of the project I have found a link to an outdated experiment on exporting ~730k scientific preprints from arXiv.org into XML format. This experiment ended in 2013, but at that moment Result count % ---...


5

I'm a little hesitant to post this as I'm not sure how adaptable it would be to your case, but with the hope that it might point you in the right direction, here it is. I have been developing a system that allows me to write documents using LaTeX and writes output files as text files in a variety of formats. My current primary use-case is to output HTML5 ...


18

\write18 no longer means execute system commands in luatex. add \usepackage{shellesc} to re-enable it. That package will also allow the clearer syntax \ShellEscape{...} instead of \write18{...} or since you are writing code specifically for luatex you could avoid using shellesc and use \directlua{os.execute("\luaescapestring{...}")} which ...


4

It's better to minimize the example. The error appears also with \documentclass[10pt, xcolor=svgnames, x11names, t]{beamer} \usepackage{fontspec} \usepackage[listings,theorems,skins, raster, breakable]{tcolorbox} \newtcblisting{mydocument}{% left skip=-4.2pt,width=1.01\linewidth, sharp corners,% beforeafter skip=0.5\baselineskip,% leftlower=0pt,...


1

This can help until issue will be fixed and uploaded to distributions. \documentclass{book} \usepackage{fontspec} \setmainfont{arial}[ %Need such long loading because of luaotfload issue Extension = .ttf, UprightFont = *, BoldFont = *bd, ItalicFont = *i, BoldItalicFont = *bi] \newfontfamily\cyrillicfont{arial}[ %for Cyrillic users ...


1

Don't mix the package fontenc and fontspec! Use only one of them! Running xelatex or lualatex then use fontspec. If running pdflatex then use fontenc: Here is a working example for xelatex/lualatex: \documentclass[a4paper,12pt]{report} \usepackage[scaled=.90]{helvet}% Helvetica, served as a model for arial \usepackage{fontspec} \setmainfont{Times New Roman}...


3

You could make use of the selnolig package. Its main purpose is to let users suppress ligatures selectively, e.g., to suppress ligatures if they cross morpheme boundaries in composite words. (For instance, in the TeXbook, Don Knuth mentions the word "shelfful" as a word in which the ff ligature shouldn't be used.) However, the selnolig package can also be ...


3

I used OPmac trick 0153, so I needed to define the \eapply macro only: \def\tmp#1{}\edef\nb{\expandafter\tmp\string\\} % \nb is normal backslash \def\luaescapestring#1{\etoksA #1{\end}} \def\etoksA#1#{\etokssB#1 {\end} } \def\etokssB#1 #2 {\etoksC#1\end \ifx\end#2\empty\expandafter\etoksD\else\space\fihere{\etokssB#2 }\fi} \def\etoksC#1{\ifx\end#1\...


2

I tried your example but did not find the issue you described. I am using the stock TeXLive 2016, updated just today. The fonts are the versions from Adobe Font Folio 11 (but I don't think the versions of the fonts are issues here). Though I do have the patch in https://github.com/wspr/fontspec/pull/231 applied to fontspec. I am not sure if that is the issue....


1

As long as LuaTeX suffers from bugs, install Adobe Cronos Pro for pdftex following this manual and support: https://github.com/sebschub/FontPro There are some discussion how to get it all to work here: Myriad Pro Condensed undefined


1

There are many things that have changed in TL 2016 with repect to luatex: First of all of course that many primitives have been changed, but also that the font loader has been rewritten in lua instead of using the fontforge libraries. While this is in principle a good idea, there surely are many bugs lurking and you are asked to report them to the bug ...


0

microtype has defaults which can take care of most of the text in memoir. I tried the defaults with LuaLaTeX as well as XeLaTeX. And then I tried it with pdfLaTeX. I liked the output of pdfLaTeX as well as LuaLaTeX. Takeaway: LuaLaTeX seems to work better with microtype, when compared with XeLaTeX.


3

It should work using \r or just using m̊ \documentclass{article} \usepackage{fontspec} \setmainfont{Charis SIL} \begin{document} \r{m}abcdefgh m̊abcdefgh \end{document} (Using luatex from texlive 2016)


4

Although NotoSansCJK-Regular.ttc has a .ttc extension, this is actually an Open Type Collection format font as Google says here. Support for OTC format was added to LuaTeX in LuaTeX beta-0.81.0 (please refer to Revision 5330). So, if you are using older version of LuaTeX (e.g. Version beta-0.80.0, which is in TeX Live 2015), you cannot use OTC fonts with ...


3

LuaTeX has changed quite a lot this year. Among other things the LuaTeX developers removed a lot of known (pdf)primitives from pdfTeX. Thus several packages that make use of these primitives need to be updated. Alternatively you can add the luatex85 package, which will reintroduce thise "missing" primitives.



Top 50 recent answers are included