1

The following command is just a shortcut to avoid me to write two very long words I use often. I would like to capitalize the first letter of the first word at the beginning of a sentence.

\newcommand{\es}{\autocap{e}dslqk dlqsmd}

However \es text. (i.e. the command at the beginning of a sentence) does not print Edslqk dlqsmd but edslqk dlqsmd.

How can I capitalize this letter automatically?

  • Can you expand your code to a compilable minimal example, so we all have the same basis of knowledge? – Johannes_B Feb 27 '14 at 9:09
  • \MakeUpperCase? – Claudio Fiandrino Feb 27 '14 at 9:09
  • 2
    \autocap is a biblatex command and as such only works if it is within the scope of biblatex's punctuation tracker (that tracker is only working within citations and the bibliography). Automatically capitalising words depending on their position in the text is quite a difficult job (there have been questions about that here before, I think, with - if at all - quite complicated solutions). – moewe Feb 27 '14 at 9:19
  • 2
    TeX can't read English or any other language. It has no notion of beginning of sentence that could be exploited. biblatex has \autocap, but this command is used in a very controlled environment, where everything has been split up into small pieces. – egreg Feb 27 '14 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.