Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Capitalizing strings ignoring closed class words

Neither bibtex.exe nor bibtex8.exe can handle unicoded database properly. Newrtheless some peoplу (and me too) do use these routines to compile list of references. Example of such use provides unicode-gost*.bst styles from the package GOST. These styles avoid using change.case$ primitive since it produces wrong output for Cyrillic alphabets.

Could someone direct me how to eleborate LaTeX command that would convert

"Some Paper Title" to "Some paper title"

and

"Some Paper Title on {LaTeX}" to "Some paper title on {LaTeX}"

?

share|improve this question
    
You can look at this question that is very similar. –  egreg Apr 14 '12 at 21:12
add comment

marked as duplicate by Joseph Wright Apr 14 '12 at 21:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Adapting Capitalizing strings ignoring closed class words one can try this:

\documentclass{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\uncapitalize}{>{\SplitList{~}}m}{
  \UncapitalizeFirst#1\Uncapitalize\unskip
}
\ExplSyntaxOff
\def\Sentinel{\Uncapitalize}

\makeatletter
\def\Uncapitalize#1{%
  \def\next{#1}%
  \ifx\next\Sentinel
    \expandafter\unskip
  \else
    \CheckInList{#1}\space\expandafter\Uncapitalize
  \fi}
\def\UncapitalizeFirst#1{\expandafter\UC@next#1 \Uncapitalize}
\def\CheckInList#1{%
  \ifcsname List@\detokenize{#1}\endcsname
    #1%
  \else
    \expandafter\UC@next#1%
  \fi}
\def\UC@next#1{%
  \ifx#1\UTFviii@two@octets
     \expandafter\@firstoffour
  \else
    \ifx#1\UTFviii@three@octets
      \expandafter\expandafter\expandafter\@secondoffour
    \else
      \ifx#1\UTFviii@four@octets
        \expandafter\expandafter\expandafter\expandafter\expandafter
        \@thirdoffour
      \else
        \expandafter\expandafter\expandafter\expandafter\expandafter
        \expandafter\expandafter\@fourthoffour
      \fi
    \fi
  \fi
  {\UC@two}{\UC@three}{\UC@four}{\MakeLowercase}#1}
\def\UC@two#1#2#3{\MakeLowercase{#1#2#3}}
\def\UC@three#1#2#3#4{\MakeLowercase{#1#2#3#4}}
\def\UC@four#1#2#3#4#5{\MakeLowercase{#1#2#3#4#5}}
\providecommand\@firstoffour[4]{#1}
\providecommand\@secondoffour[4]{#2}
\providecommand\@thirdoffour[4]{#3}
\providecommand\@fourthoffour[4]{#4}
\makeatother

\begin{document}
\uncapitalize{Here is a List of Words École}

\selectlanguage{russian}

\uncapitalize{Москва Спасибо}
\end{document}

Unfortunately it doesn't work with commands or braced groups.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.