Hot answers tagged

6

Since you are loading fontspec, I presume you are using either xelatex or lualatex. In such a case, don’t load fontenc and declare the font for vietnamese in the following way: \documentclass{memoir} \usepackage[english]{babel} \babelfont[vietnamese]{rm}{TeX Gyre Pagella} \begin{document} Nguyen in English text. \foreignlanguage{vietnamese}{Nguy\~{\^{e}}...


5

Let’s suppose you are writing a book in French on the Arabic script. Here is a minimal setup: \documentclass[french]{book} \usepackage[bidi=basic]{babel} \babelfont[*arabic]{rm}{Amiri} \begin{document} Français \foreignlanguage{arabic}{العربية} français \foreignlanguage{persian}{فارسی} français \foreignlanguage{uyghur}{ئۇيغۇرچە} français. \end{document} ...


5

Is this what you're looking for? \documentclass{article} \usepackage[T1]{fontenc} \usepackage[french,italian,swedish,english]{babel} \ExplSyntaxOn \NewExpandableDocumentCommand{\langcase}{O{}m} { \str_case_e:nnF { \languagename } { #2 } { #1 } } \ExplSyntaxOff \begin{document} English: \langcase[??Unsupported??]{ {english}{start} {french}{début} ...


5

Babel Greek redefines \& in a way that the package does not like, you can save the original definition and restore it globally (if you do not need \& in a Greek section) or locally before starting the environment. \documentclass{article} \usepackage[utf8]{inputenc} \let\savedamp\& \usepackage[greek]{babel} \usepackage{karnaugh-map} \begin{...


4

French and/or physics amsmath seem to be upsetting bm. However without delving too deeply in to why you can protect \bm with extra braces, you get no error from \renewcommand{\vb}[1]{{\bm{#1}}} A more permanent fix could be made in amsmath by changing one instance of \boldsymbol to ##1 \documentclass[]{book} \usepackage{amsmath} \usepackage{bm} \...


3

Combining the comment advice together (language selection, plus font rendering) gives: with various fonts. MWE \documentclass{article}%[border=6pt]{standalone} \usepackage{xcolor} \usepackage[nil,bidi=default]{babel} \babelprovide[import=he]{hebrew} \babelfont{rm}{CMU Serif} \babelfont[hebrew]{rm}[Path=C:/Users/Public/fonts/1/, Extension=.ttf, UprightFont=*-...


3

I recommend not using physics. Anyway, it is not directly related to physics, but it's an interaction with amsmath. Here's a more minimal example: \documentclass[]{book} \usepackage[french]{babel} \usepackage{amsmath} \usepackage{bm} \newcommand{\vb}[1]{\bm{#1}} \begin{document} $\vb{L}\dots\vb{L}$ \end{document} You can work around the issue by using \...


2

I got it working by getting rid of the fontenc red herring (which I only put in there on suggestion of the VnTeX documentation), and using UTF-8 directly with my choice of \vnfont: \documentclass{memoir} \usepackage{fontspec} \usepackage[defaultsups]{newpxtext} \newfontfamily\vnfont{TeX Gyre Pagella} \begin{document} Nguyen, \vnfont Nguyễn, \normalfont and ...


2

Load babel with the option layout=lists: \usepackage[english, bidi = basic, layout=lists]{babel} babel assumes monolingual documents. This option readjusts lists internally to deal with multilingual documents.


2

The microtype also can help to reduce hyphens, and better distribute the interword spaces, but note that the abuse of shrink and stretch options could be worse that hyphens and the overfull \hbox. \documentclass[draft]{book} \usepackage[margin=0.5cm,paperwidth=5cm,paperheight=12 cm]{geometry} \usepackage[english,showlanguages]{babel} \usepackage[protrusion=...


1

TeX can set text in such narrow columns but you have to adjust things a bit, in particular allow more white space stretching, as even with hyphenation there simply are not enough breakpoints with the standard white space constraints. Here are three possibilities. \documentclass{book} \textwidth=4cm \oddsidemargin=.1cm \evensidemargin=.1cm \usepackage[...


1

The explanation is in lines 667–702 of babel.sty 667 \bbl@trace{Encoding and fonts} 668 \newcommand\BabelNonASCII{LGR,X2,OT2,OT3,OT6,LHE,LWN,LMA,LMC,LMS,LMU,PU,PD1} 669 \newcommand\BabelNonText{TS1,T3,TS3} 670 \let\org@TeX\TeX 671 \let\org@LaTeX\LaTeX 672 \let\ensureascii\@firstofone 673 \AtBeginDocument{% 674 \in@false ...


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