Is it possible to make macros give different results at the beginning of a new sentence? Suppose that I want the macro "\secname" to write "Section" at the beginning of a new sentence, and "section" anywhere else. How can I do so?
[Tex/LaTex] Detect beginning of a sentence in a macro for capitalization
capitalizationconditionalsmacrospunctuation
Best Answer
You could set the \sfcode of the "end of sentence" chars to something different and test for it:
\nonfrenchspacing is also setting the \sfcodes. In this case you could use something like this: