Linked Questions

10
votes
1answer
1k views

auto-capitalise the output of a newcommand [duplicate]

How can I create a newcommand that automictically capitalises the first letter, when the command is used after a full stop (or question mark, exclamation mark, etc.)? \newcommand{\tinycommand}{tiny ...
6
votes
1answer
710 views

Automatically capitalize macro output if used after a period [duplicate]

Possible Duplicate: Detect beginning of a sentence in a macro for capitalization Is it possible to write a macro that is able to determine if it is used at the beginning of a sentence? For ...
4
votes
0answers
63 views

How can a macro detect whether it is invoked in the beginning of a sentence? [duplicate]

I want to have a macro that behaves differently based on the context. Assume I write a tutorial in X language. A term that I use must be written in X language followed by the corresponding English ...
1
vote
0answers
39 views

A macro that behaves differently at start of sentence [duplicate]

I am using a macro to represent a certain term, e.g: \newcommand{\agt}{the agent} (I use this macro so that it is easier to change the term in the future, if needed). Is it possible to change the ...
66
votes
11answers
35k views

Double space between sentences

I've been reading a question on spaces between sentences on a sister site. The answers there seem to imply that the days of double spacing between sentences are over, and that this was a relic of the ...
21
votes
4answers
2k views

Avoiding a page break after the first word of a sentence

Is there a way to tell TeX to avoid breaking the page after the first word of a sentence? ... ... He was quite dead. Apparently his neck had been broken. The lightning flashed for a third ...
2
votes
5answers
316 views

How can I condition on the last token?

I would like to write a command \foo which, for the sake of simplicity, does just one thing, which is make sure its argument ends with a dot. Thus both foo{hello world} and foo{hello world.} expand to ...
6
votes
2answers
235 views

context-sensitive macro: look behind?

I try to fine-tune a macro depending on whether it is following a specific character/text. E.g., This is it! \great! Wait, what is \great? should become This is it! Grrreeeaaat! Wait, what is great?...
2
votes
1answer
301 views

Why can't cleveref determine if the reference is at the beginning of a sentence?

I was reading the documentation on the cleveref package, which can be found here, when I stumbled upon a side remark on page six (can be found in the paragraph for \Cref), which says As it is very ...
2
votes
0answers
200 views

\autocap command is not working

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. \...