Hot answers tagged

33

For UTF-8 input, use soulutf8; don't forget fontenc! \documentclass[a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{soulutf8} \usepackage{color} \definecolor{y}{RGB}{245, 255, 189} \sethlcolor{y} \begin{document} \hl{\'e} \hl{é} \end{document} There is no 15pt option for article.


29

If you load inputenc with the utf8 encoding option (make sure that your editor is also configured to use Unicode), you can input those characters directly from your keyboard: \documentclass{article} \usepackage[utf8]{inputenc} \begin{document} Ç et ç \end{document} A few comments (added by herve): If your keyboard has not a french layout, the way to ...


26

If you want to use kerning=french, then you need to disable the punctuation settings made by babel and leave no space before punctuation symbols. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[english,french]{babel} \frenchbsetup{AutoSpacePunctuation=false} \usepackage[babel=true, kerning=french]{microtype} \begin{...


26

Your problem is with the Babel shorthand for :. To disable this shorthand use \shorthandoff{:} inside your \begin{document}. It will not work when loaded in the preamble. To re-enable the shorthand, use \shorthandon{:}. \documentclass{article} \usepackage[french]{babel} \begin{document} \shorthandoff{:} Il est 20:20. \shorthandon{:} Il est 20:20. \end{...


24

Just for fun: \documentclass{article} \usepackage{xparse} \usepackage{fontspec} \setmainfont{Libre Bodoni} \NewDocumentCommand{\frabbr}{sm}{% \IfBooleanTF{#1}{\dofrabbr{}{#2}}{\dofrabbr{\hfil}{#2}}% } \newcommand{\dofrabbr}[2]{% \vbox to\fontcharht\font`T {% \ialign{% #1##\hfil\cr \relscriptsize#2\cr \noalign{\nointerlineskip\...


22

The following should produce what you want. You can use an optional argument to specify another letter than T (e.g. t): \documentclass[]{article} \newsavebox\myboxA \newsavebox\myboxB \newcommand\saint[1][T] {% \begingroup \sbox\myboxA{S}% \usebox\myboxA \sbox\myboxB{\tiny#1}% \rlap{\raisebox{\dimexpr\ht\myboxA-\ht\myboxB}{\usebox\...


21

The semicolon is made active by the french babel option, which throws the TikZ parser off. You can say \shorthandoff{;} in your tizpicture to fix this. You can do this either by manually putting \shorthandoff{;} at the start of each tikzpicture, or you can use a TikZ style for inserting the code automatically into each tikzpicture by setting \tikzset{ ...


17

TikZ 3.0 introduced a new babel tikzlibrary to solve these kind of problems. A tiny library that make the interaction with the babel package easier. Despite the name, it may also be useful in other contexts, namely whenever the catcodes of important symbols are changed globally. Normally, using this library is always a good idea; it is not always ...


17

The spacing is already inserted by \og and \fg, so you shouldn't type the ~. You can consider changing the definition of the Unicode character as \DeclareUnicodeCharacter{AB}{\og\ignorespaces} \DeclareUnicodeCharacter{BB}{\unskip\fg} so that inputting Ces simulations «directes» sont ainsi Ces simulations « directes » sont ainsi will be equivalent. ...


15

Languages including: Amharic, Arabic, Asturian, Azerbaijani, Belarusianm Bulgarian, Bengali, Breton, Catalan, Czech, Kashubian, Welsh, Danish, German, Greek, English, Spanish, Estonian, Persian, Faroese, French, Frisian, Irish, Scottish, Galician, Ancient Greek, Gujarati, Manx Gaelic, Hebrew, Hindi, Hiligaynon, Croatian, Upper Sorbia, Hungarian, Huastec, ...


13

I'm not sure this is the usual way to denote time in French; here's a workaround: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[french]{babel} \edef\hc{\string:} % \hc prints a normal colon \begin{document} Il est 20\hc20. \end{document} Alternatively, use datetime: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[french]{...


12

Simply \c{c}, no space. I believe you are trying a space between \c and {c}.


12

Load babel before unicode-math: \documentclass{minimal} \usepackage[frenchb]{babel} \usepackage{unicode-math} \setmathfont{XITS Math} \begin{document} a: ba : b $a:b$ \end{document} The difference lies in the fact that XeLaTeX and LuaLaTeX use different methods for typesetting the colon French style, that is with equal spaces on either side. If you ...


12

There is a bug in gloss-french (or more precisely it hasn't been updated to the new xetex yet). The space/boundary has in the newer xetex versions another class. This avoids the break: \documentclass[12pt]{memoir} \usepackage{polyglossia} \setdefaultlanguage{french} \makeatletter \XeTeXinterchartoks 4095 \french@punctthin = {\xpg@unskip\nobreak\thinspace}% \...


12

There's currently an oversight here in the code. For the present, use \documentclass[10pt,letterpaper]{article} \usepackage{siunitx} \ExplSyntaxOn \cs_set_protected:Npn \__siunitx_unit_format_power_aux: { \str_if_eq:VnTF \l__siunitx_per_mode_tl { repeat } { \__siunitx_unit_format_power_repeat: } { \__siunitx_unit_format_power_per: } \str_if_eq:...


11

The problem is that french makes : into an active character (after \begin{document}. Solutions. Define your own list processor in the preamble \makeatletter \newcommand{\bflist}[1]{\@for\next:=#1\do{\textbf{\next}}} \makeatother and use \bflist{\names} Force : to have the correct category code: \documentclass{article} \usepackage[francais]{babel} \begin{...


10

As with the question that Claudio links to, the problem is in some extra code that TikZ loads which doesn't have the same amount of checking for active characters as the main TikZ parser does. As Babel doesn't change the catcode of ; until the start of the document all of the semicolons involved in the declare function routine are inactive and thus don't ...


10

It's not the colon, it's a buried non-active semi-colon. TikZ is super-clever with regard to active semi-colons. When it starts a \tikz command (or a \draw or whatever) then it calls a certain macro to gather in the rest of the command. The rest of the command is everything up to the next semi-colon ("up to" with the usual proviso of TeX groupings). ...


10

As suggested by PatrickT and mentioned in French internationalisation, override babel default spacing, \NoAutoSpacing is the easiest solution in modern (post-2011) TeX distributions. \documentclass{article} \usepackage[french]{babel} \begin{document} Il est {\NoAutoSpacing 20:20}. \end{document}


10

À propos du problème des noms d'auteurs en petites capitale, on peut dire à frenchb (module de babel pour le français) de ne pas adopter ce comportement en ajoutant la ligne suivante au préambule. Regarding the problem of author names in small capital, one can tell frenchb (the babel module for French) not to do it by adding the following line to the ...


10

You are explicitly asking to LaTeX to do this in your preamble: \renewcommand{\&}{et} Just remove this line and \& will print & Edit: If you are absolutely, completely, 100% sure you want all instances of & replaced by et, except in this sentence you can put \let\oldamp\& before the \renewcommand and write: Barker and Cornacchia ont ...


9

If you compile your document using a UTF-8 aware engine such as LuaTeX or XeTeX, the code works: % Compile with LuaLaTeX or XeLaTeX \documentclass[french]{article} \usepackage{fontspec} \usepackage{babel} \usepackage[]{qrcode} \begin{document} \qrcode[]{ààààççççééééùùùùïïï}% produces no error: accented characters \bigskip \qrcode[]{Are accented characters ...


9

Add \frenchbsetup{IndentFirst=false} to your preamble (p. 6 of the documentation): \documentclass{article} \usepackage[french]{babel} \usepackage{lipsum} \frenchbsetup{IndentFirst=false} \begin{document} \section{Zzzzz} \lipsum[1] \end{document}


8

The package babel with the language francais loads the file frenchb.ldf with the following defintion: \def\figurename{{\scshape Figure}}% The combination of \itshape\scshape is defined with the current font so you will get the odd result. I can't understand why babel influences the format. However you have the following possibilities to solve the issue: 1. ...


8

When using the babel package with the french option, semicolons (and colons, exclamation marks and question marks) are made active so the spacing around these punctuation symbols can be corrected for the French style of putting space before and after the symbol: "Normal" spacing: French spacing: If you use the semicolon as the field separator in your data ...


8

If you want to get the correct spacing between \fg and a word following it, you have to add an empty statement {} after it. This because the definition of \fg in frenchb.ldf resorts to the definition of \FB@fg which is \DeclareRobustCommand*{\FB@fg}{\ifdim\lastskip>\z@\unskip\fi \FBguill@spacing\guillemotright\xspace} As you ...


8

You should use the modern replacement for bibtex: biblatex with its biber backend. It is fully unicode capable. If you want to take it one more step further, you might also want to switch to a native unicode-enginge: xelatex or lualatex. You just have to change a few packages in the preamble. The combination of \usepackage[utf8]{inputenc} and \usepackage[T1]...


8

Here's a semiautomatic version, where you have to add the suffix by hand. \documentclass{article} \makeatletter \newcommand{\numpar}[1][]{% \par\addvspace{\medskipamount}% \if\relax\detokenize{#1}\relax \refstepcounter{numpar}% \def\thisnumpar{\thenumpar}% \else \edef\@currentlabel{\thenumpar\noexpand~#1}% \def\thisnumpar{\thenumpar~#...


7

This is because french babel makes colon active, it inserts space before the colon. You can switch of this behaviour with command \shorthandoff{:} placed at the beginning of the document. Of course, it will suppress automatic inserting of spaces before colon in the whole document.


7

Apparently there is not comment agreement on whether such strings should be latin or french, see for example the discussion on the biblatex github https://github.com/plk/biblatex/pull/1022 (thanks to Moewe for pointing this out). Should you wish to override the current default latin with a french equivalent you can do that in your document using \...


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