11

I want to use some shortcuts to produce special character in Romanian. One of them is to use the command \c but also I know that is possible to use the following character: ' .

example \c si or 'si produce same word.

How can I use ' ?

It is written that I used an old interface to call babel.

6
  • Are you asking how you can do to type the character ' which is not available in your keyboard? Jun 7, 2013 at 13:07
  • no. that character is like a command. like in example: \c si or 'si is same word.
    – Iuli
    Jun 7, 2013 at 13:09
  • I know because I saw last year a latex document where it was used in whole document '. I don't know how to use it. I usually use \c, \^, \u, but now I want to know how to use ' to produce same word. EXAMPLE: 'si=\c si.
    – Iuli
    Jun 7, 2013 at 13:15
  • 1
    Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.
    – Xavier
    Jun 7, 2013 at 14:27
  • Try this : blypt.blogspot.ro/2011/07/romanian-diacritics-in-latex.html It worked for me...
    – user36376
    Sep 8, 2013 at 14:22

2 Answers 2

11

The babel style for Romanian provides no shorthands, but you can define them easily:

\documentclass{article}

\usepackage[romanian]{babel}
\usepackage{combelow}

\useshorthands{'}
\defineshorthand{'s}{\cb{s}}
\defineshorthand{'t}{\cb{t}}
\defineshorthand{'S}{\cb{S}}
\defineshorthand{'T}{\cb{T}}

\begin{document}

Bucure'sti 't 'T 'S

\end{document}

EDIT. Added some letters and use comma below with combelow.

3
  • I have one question. I saw that with {'} it can be produced all the special letters in Romanian. what you said me, produce only one. can you help me?
    – Iuli
    Jun 7, 2013 at 16:10
  • Actually the shortcut should provide the "comma under" accent, not the cedilla.
    – egreg
    Jun 7, 2013 at 16:39
  • @luli I've updated my answer. Jun 7, 2013 at 17:34
7

An alternative to using shorthands is going with UTF-8 input encoding.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[romanian]{babel}
\usepackage{combelow}
\usepackage{newunicodechar}

\newunicodechar{Ș}{\cb{S}}
\newunicodechar{ș}{\cb{s}}
\newunicodechar{Ț}{\cb{T}}
\newunicodechar{ț}{\cb{t}}

\begin{document}

București ȘșȚț

\end{document}

enter image description here

In any case I'm afraid that hyphenation will not go past these special letters (but it would be the same with shorthands), because the required glyphs must be constructed from different pieces.

With XeLaTeX or LuaLaTeX you can ensure correct input and hyphenation; Romanian fonts are available with (pdf)LaTeX, but their usage is not really well supported. Here's a way to use the real glyphs and not composed ones.

\documentclass{article}

\usepackage[QX,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[romanian]{babel}
\addto\extrasromanian{\fontencoding{QX}\selectfont}
\addto\noextrasromanian{\fontencoding{\encodingdefault}\selectfont}
\usepackage{newunicodechar}

\newunicodechar{Ș}{\c S} % qxenc provides the precomposed combination
\newunicodechar{ș}{\c s} % ditto
\newunicodechar{Ț}{\c T} % ditto
\newunicodechar{ț}{\c t} % ditto

\begin{document}

București ȘșȚț

\end{document}

The Latin Modern fonts, as well as the TeX Gyre ones, support the QX encoding (thanks to Robert for the information).

With a QX encoded font, one can also use the shorthand version, in case UTF-8 encoding is difficult to use.

\documentclass{article}

\usepackage[QX,T1]{fontenc}
\usepackage{lmodern}

\usepackage[romanian]{babel}
\addto\extrasromanian{\fontencoding{QX}\selectfont}
\addto\noextrasromanian{\fontencoding{\encodingdefault}\selectfont}

\useshorthands{'}
\defineshorthand{'S}{\c S}
\defineshorthand{'s}{\c s}
\defineshorthand{'T}{\c T}
\defineshorthand{'t}{\c t}

\begin{document}

Bucure'sti 'S's'T't

\end{document}

However, QX encoded fonts are not the ultimate answer, because they don't contain the Ă and ă glyphs, which are essential for Romanian. They contain Â, â, Î and î, though.

2
  • "Romanian fonts are unfortunately unavailable with (pdf)LaTeX": this is not the whole truth. At least Latin Modern as well as the TeX Gyre fonts contain the real "textcommabelow" glyphs in QX encoding, they only require additional code to be made accessible. See this post, which thoroughly summarises the Romanian TeX situation, but unfortunately doesn't seem to have led to any progress in this area (qxenc.def is still the same).
    – Robert
    Jun 8, 2013 at 0:50
  • @Robert Thanks for the information; I'll try and investigate.
    – egreg
    Jun 8, 2013 at 7:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .