I need to use Slovak ľ once in text and I do not want to use [slovak]{babel}
Is there a command (like \soft{l}) which would produce it?
I need to use Slovak ľ once in text and I do not want to use [slovak]{babel}
Is there a command (like \soft{l}) which would produce it?
It would be easiest, I think, if you could compile your document using either XeLaTeX or LuaLaTeX. That way, you won't have to deal with the vagaries of competing and conflicting font encodings.
\documentclass{article}
\usepackage{ifluatex,ifxetex}
\ifluatex\else\ifxetex % do nothing special ...
\else % must be pdftex...
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\fi\fi
\usepackage{ebgaramond} % font package that works with pdfLaTeX, XeLaTeX, and LuaLaTeX :-)
\begin{document}
l ľ
\end{document}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\DeclareTextCompositeCommand{\v}{OT1}{l}{l\nobreak\hspace{-.1em}'}
\DeclareTextCompositeCommand{\v}{T2A}{l}{l\nobreak\hspace{-.1em}'}
\begin{document}
{\fontencoding{OT1}\selectfont
\v{l} or just ľ
}
{\fontencoding{T1}\selectfont
\v{l} or just ľ
}
{\fontencoding{T2A}\selectfont
\v{l} or just ľ
}
\end{document}
\usepackage[T2A,T1]{fontenc}, i.e., invert the order of the options.
– Mico
Apr 06 '17 at 19:49
ľ and \v{l} will always produce the same thing. in OT1 (and apparently T2A) there is no ľ character so you get the default v accent 9this can be fixed) but T1 does have a ľ so you get that.
– David Carlisle
Apr 06 '17 at 19:51
If your default encoding is T2A, you can do like this:
\documentclass{article}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\DeclareTextSymbolDefault{\softL}{T1}
\DeclareTextSymbolDefault{\softl}{T1}
\DeclareTextCommand{\softL}{T1}{\v{L}}
\DeclareTextCommand{\softl}{T1}{\v{l}}
\DeclareUnicodeCharacter{013D}{\softL}
\DeclareUnicodeCharacter{013E}{\softl}
\begin{document}
Москва \softl{} Москва ľ Москва
Москва \softL{} Москва Ľ Москва
\end{document}
Note that you can input the character directly with Ľ and ľ.
On the other hand, if you use russian-babel (or another language using the Cyrillic script), you can exploit \textlatin for the occasional word with diacritics in the Latin alphabet.
\documentclass{article}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}
\begin{document}
Москва \textlatin{\v{l}} Москва \textlatin{ľ} Москва
Москва \textlatin{\v{L}} Москва \textlatin{Ľ} Москва
\end{document}
The output is the same as above.
inputencpackage with the optionutf8, and thefontencpackage with the optionT1? If so, there should be nothing stopping you from entering the character in question directly, i.e., asľ, right? – Mico Apr 06 '17 at 19:34l\kern-0.035cm\char39\kern-0.03c(you can find a few occurrences online) for ľ and a similar macro for ť. I guess there are more experienced users on this site which would probably be able to say whether this approach is acceptable - and if not why it is bad. – Martin Apr 07 '17 at 05:43