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

New answers tagged

1

You should use grouping to isolate the changes in font and line spacing, so you don't have to revert them afterwards. However, since these changes have to be done, you need to end the previous paragraph, if not already done and also to end a paragraph at the end of the special setup, so as not to influence the following paragraphs. %%%%% Preamble %%%%% \...


4

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 ...


3

The "indentation of a size of a space" actually isn't an indentation, it is a space at the start of the line: Look at This is wrong: \paragraphStyle{ First line\\ Second line } The newline after \paragraphStyle{ is converted to a space which results in the observed "indentation". You can avoid this by adding a % to comment the ...


1

Note that (as mentioned by Ulrike in the comments) if you just want to typeset a prime outside of maths mode all you need to do is load a font that contains that glyph: \documentclass{article} \usepackage{unicode-math} \setmainfont{texgyrepagella-regular.otf} \begin{document} This prime: ′ \end{document}


2

Here is a simple(-minded?) proposal. Make the margin on the left wider and put the picture as an overlay. (I am sorry, I cannot copy all these accented text in my editor so I stripped everything off but the parts relevant to make the point.) \documentclass[10pt]{book} \usepackage[a4paper]{geometry} \usepackage{lipsum} \usepackage{tikzpagenodes} \geometry{...


1

One option is to define a more-readable macro \typeII and \TypeII that expand to \mbox or \nobreakdash and prevent hyphenation. You might want to add the xspace package to avoid the need to write \typeII{} or {\TypeII}. Another is to \usepackage[shortcuts]{extdash}, which allows you to write type\=/II. Including microtype on LuaLaTeX or PDFLaTeX might ...


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 \...


2

To embed complete fonts you have to set the embedding mode to full rather than the default subset. You can do this in the patch_font callback of luaotfload. Be aware that most commercial fonts do not allow full embedding but only subset embedding in their license. \documentclass{article} \usepackage{fontspec} \usepackage{luacode} \begin{luacode} local ...


0

As @egreg pointed out, unicode-math redefines the prime character at begin document, so wrapping the \newunicodechar invocation in \AtBeginDocument solves the issue. An important note is that while I usually use the form \newunicodechar{α}{\ensuremath{\mathrm{α}}} for defining unicode characters, doing so with prime causes a crash. So make sure to use a ...


0

The correct behaviour in LuaTeX's letterspacing/tracking seems to have returned with the most recent version of luaotfload (v2.96 2019/02/14). From the documentation: In version 2.95 letterspacing was broken due to a change in the fontloader (issue 38). This has been repaired. At the same time a number of oddities and bugs in the letterspacing has ...


2

Your system most likely has pdffonts (or you could obtain it) running pdffonts on a typical luatex output produces name type encoding emb sub uni object ID ------------------------------------ ----------------- ---------------- --- --- --- --------- SJYSYS+TeXGyreTermes-Regular-Identity-H CID Type 0C ...


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) ...


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 ...


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 (...


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", ...


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 ...


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,...


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{...


1

Although this package is used very little, I can recommend a bold fake like \usepackage{amsbsy}. In some extreme cases I for example use it. \documentclass{article} \usepackage{fontspec} \usepackage{amsbsy} \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella}[% Numbers = {OldStyle, Proportional}, Ligatures = TeX, ] \setmathfont{TeX Gyre Pagella ...


0

The warnings are in the middle of the class loading. The class tries to use a bold and italic font to set some font dimens. Imho you can simply ignore it, fontspec will set its own fontdimens anyway when you load TeX Gyre Termes. But you should add before \documentclass this so that the class correctly tests for pdf output: \let\pdfoutput \outputmode


0

If you want to use the same 8bit fonts as pdftex, but just use luatex (eg to use some Lua features) you can revert to OT1 or T1 before loading the class, eg \RequirePackage[OT1]{fontenc} \documentclass[conference]{IEEEtran} \usepackage{mathtools} \begin{document} bla \end{document}


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{...


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, ...


1

You can explicitly set the italic font and bold italic font to the same as the upright fonts. This will stop the warning. \setmainjfont[ Path = \currfileabsdir, UprightFont = fonts/HGS_Mincho/HGRMB.ttc, ItalicFont = fonts/HGS_Mincho/HGRMB.ttc, BoldFont = fonts/HGS_Mincho/HGRME.ttc BoldItalicFont = fonts/HGS_Mincho/...


1

The short answer to your question is that, for a bitmap font like ulsy, the resolution used by pdftex is defined by the variable \pdfpkresolution, which is set to 600 in the usual default configuration. The resolution used by dvips and the wrapper script dvipdf is set by a line reading D 8000 in the file $TEXMF/dvips/config.pdf if it is not specified by a ...


1

I suggest to get the postscript version of the font (from https://ctan.org/tex-archive/fonts/ps-type1/ulsy), put the pfa into fonts/type1/public/ulsy/ulsy.pfa, the map-file into fonts/map, run mktexlsr and activate the map-file with updmap (or add a \pdfmapline command). \documentclass{article} \usepackage{graphicx} %\pdfmapline{=ulsy10 ulsy < ulsy.pfa}...


0

Thank you, David! https://tex.stackexchange.com/a/483873/185331 It works nice. I've modified it a bit \usepackage{plantuml} \def\pumlfile#1{% \directlua{% %texio.write_nl("Filename: \luatexluaescapestring{#1}") %texio.write_nl("Filename: " .. \luastring{#1}) local srcname = \luastring{#1} srcname = srcname:sub(2,-2) % trick with quotes in ...


2

You didn't supply a test file, but taking one from the manual... You can get lua to take a file with the markup, add the latex environment saving to a temporary file and then input (using a temporary file just simplifies the catcode handling) main document \documentclass{scrartcl} \usepackage{plantuml} \def\pumlfile#1{% \directlua{% local f = assert(io....


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 ...


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

\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}


1

sfdefault is not an option provided by the sourcesanspro package. My settings Tex Live 2018 sourcesanspro v2.6 (Dec 3, 2016) Pandoc v.2.7.1 Procedure Content of input.md (T1 is the default option for fontenc): --- geometry: margin=2cm papersize: a4paper toc: true fontfamily: sourcesanspro fontfamilyoptions: default --- # Introduction This is a sample ...


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 ...


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, ...


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

\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)} \...


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 ...


1

The sourcesanspro package uses an old version of the fonts; it's better to use the latest version of Source Sans Pro installed on your system, and use it directly with fontspec: pandoc -o test.pdf --pdf-engine=lualatex << EOT --- mainfont: Source Sans Pro --- Lorem ipsum dolor sit amet EOT


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}{\...


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 ...


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. ...


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, ...


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


Top 50 recent answers are included