I would like to define a macro for a word, i.e.   \newcommand{\stack}{{\it StackExchange} Tex}   But, I would like to automatically add a final space after that macro, like it is defined as  \newcommand{\stack}{{\it StackExchange} Tex }   except when the macro is followed by a comma, in order to avoid the situation like:      StackExchange Tex , blablabla...   Any suggestion how to insert a space only if the macro is not followed by a comma/dot character?
2572
I have a definition:  \newcommand{\arnold}{Arnold Schwarzenegger}   When I refer to it by:  \arnold is a   it is rendered as:   Arnold Schwarzeneggeris a    In order to have a space in front of "is" I would need to write  \arnold\ is a   Is there some other shorter way?
8137
I have a macro which holds some text value, e.g. \macro{some text}. If it is empty, I would like for nothing to appear in the document, but it has some content of any kind which would produce text displayed in the document, I would like a message to appear, "Text: some text".   \macro{} would be considered empty. \def\somedata{}, \macro{\somedata} would be considered empty. \macro{0} would be considered not empty.   I have tried making a TeX conditional which can check if the value is not empty, but nothing I tried works, e.g.:  \ifx #1 {} \else     Text: #1 \fi  \ifx#1{} \else     Text: #1 \fi  \ifx #1 \nil \else     Text: #1 \fi  \ifx#1!="" \else     Text: #1 \fi   What is the correct syntax for creating a conditional in plain TeX with checks if a value is not empty?
66432
The Markdown editor knows that an empty line, followed by a number, followed by a period, followed by a space, is a list item.  This works great It's almost magic  The problem is that I almost always use a close parenthesis for my lists. I think it's a pretty common practice, but the problem is that the editor / Markdown parser doesn't accept parenthesis as an acceptable list delimiter:  This fails horribly This is on the next line I swear
117474
By default, (La)TeX adds extra space between sentences. The exact rules are in the TeXbook, a summary by TH. can be found . What follows is is my "executive summary":   After any period (or quotation/exclamation mark) that doesn't follow a capital letter, TeX adds a font's "extra space" to the "normal (interword) space". For Computer Modern 10pt, the normal space is 3.33pt and the extra space 1.11pt, resulting in an intersentence space of 4.44pt (+33% compared to the nomal space, assuming no stretch and shrink). A sentence end after a capital letter is indicated by the \@ command: Ann is learning the ABC\@. To denote that a period after a lowercase letter doesn't end a sentence, one may use \@ as well as an explicit space: Prof.\@ Higgins or Prof.\ Higgins.   Intersentence spacing may be brought in line with normal spacing by issuing the \frenchspacing command. (This is the standard setting for certain languages, e.g. the  (n)german option of the babel package.) With \frenchspacing enabled, there's no need to use the \@ command. One may revert to (La)TeX's default behavour by issuing \nonfrenchspacing.  So, there's the choice between extra intersentence spacing and uniform spacing. What is missing in my opinion is a third option I'll call "tightened frenchspacing": normal (interword) spacing between sentences and decreased spacing after non-sentence ending periods. To be somewhat more precise (while still ignoring stretch and shrink), I envision the following:   Adhering to a font's ratio between "normal space" and "normal space plus extra space" (3:4 for Computer Modern), the intersentence space is set to the normal space. The space after non-sentence ending periods equals the normal space multiplied by the above ratio (resulting in a space of 2.5pt for Computer Modern). As with \nonfrenchspacing in effect, the \@ command is used to denote cases of special punctuation.   How should such a "tightened frenchspacing" option be implemented?  EDIT: Thanks to Mico for providing what may well be a stepping stone to a solution. Here's another attempt at clarification:   Simply reducing the spacing after any period is not what I had in mind. There should be a (tangible) difference between end-of sentence spaces and spaces after non-sentence-ending periods (only that the latter should be reduced instead the former augmented). If adhering to a font's normal space/extra space ratio is not possible, a solution that adds a fixed (reduced) space (say, a thin space) after non-sentence-ending periods will be accepted. For compatibility reasons, I'd prefer a solution that works with the traditional use of \@ (i.e allows "tightened frenchspacing" for existing documents without the need to change the document body). Should it turn out that a different set of "special punctuation" macros is needed, I'll accept this as a solution.
77156
I want to define a command that will take a name and create a readable string from it, that can be used as a filename. Something like  John Doe -> doe-john.  However, I want to avoid special characters, i.e. replace non-ascii characters by their ascii equivalent. That is, I need a macro that will remove accents and replace some special letters, e.g.  æüßéñ -> aeuessen.  Is there a way to do this in LaTeX with reasonable effort?
14501
In my comment here:    I needed to have a : symbol with a leading space, but I couldn't figure out how to get it.  And for some reason it converts differently in this question to how it would in a comment - as you can see, in the comment box ` :` wasn't turned into code block at all.  Is it impossible, by design, to have leading or trailing space in a codeblock?
39060
Whenever I try to insert " or ' I have to validate it by space, otherwise strange things happen as with ' followed by an a becomes áinstead of just 'a, similar behaviour with double quotes. I find this annoying and want to disable it. How do I do that?
45981
I would like to define a *'d version of a command, something like \newcommand{\foo}{blah} \newcommand{\foo*}{blahblah}  If I try to do this, LaTeX complains that I'm trying to redefine \foo, so I guess I need to do something special to handle *s. But what?
103906
I'm building an application to allow technical people to enter configuration changes.  I'd like to add tags to each change.  Right now I'm using spaces, commas and semicolons.  It appears SO uses spaces and requires hyphens to make multiple words.  I read something that leads me to believe that WordPress uses commas and that a space isn't a separator.  Is there any best practice out there?  Has anyone had any good or bad experiences?
86330
I've noticed a significant issue with the \input command, it seems.  For some reason, I can't seem to prevent it from adding a space after it reads its input.  Even if there is no newlines or spaces at the end of the file, LaTeX seems to be just driven to add a space.  Minimal working example is this:  \documentclass{article} \begin{document} A\input{TestInput.out}B \end{document}   Where TestInput.out contains only the text "SomeText" and no special characters  This provides the output:  ASomeText B   Does anybody know how to prevent this?  For a typesetting program, it's kind of weird to just arbitrarily add spaces IMO.  I'd like to think there's an easy fix, but I'll take any portable, robust fix if it works.
70608
I have a variable for color. I use it to set color to strings, by evaluating it inside the string. However, I need to include space after the name(so that the name doesn't contain part of the text). This sometimes looks bad.  How can I avoid using(printing) this space?  Example(Let's say that Red=1 and NC=2):  echo -e "$Red Note: blabla$NC".   Output:  1 Note: blabla2.   Expected output:  1Note: blabla2.
86214
I have a document, where I want to use $\tau_{ff}$. If this is rendered it looks like a space is inserted between the two f's. $\tau_{rl}$ looks fine ...   Where does this additional space come from and how can I avoid it being inserted?  (Miktex 2.9 on windows, if this is relevant).
32753
I defined a macro which is essentially a wrapper for \meaning to check macro definitions  \def\whatis#1{{\ttfamily\string#1: \meaning#1}}   (The actual form I'm using goes one step further and checks whether the command is robust, but this is irrelevant here.) More often than not, the result involves some internal macro containing the token @. If I want to check this macro, I must then write something like  \makeatletter \whatis\MacroNameWith@InIt \makeatother   As I'm very lazy :-) I would like to activate \makeatletter within the scope of \whatis, so I tried  \def\whatis#1{{\makeatletter\ttfamily\string#1: \meaning#1\makeatother}}   (Actually I'd guess that \makeatother isn't necessary because of the grouping.) Needless to say, this isn't working, otherwise I wouldn't be posting this question :-)  My questions:   Why is this not working? How can I define \whatis such that \whatis{\MacroNameWith@InIt} behaves as I wish?
86647
I have noticed that I hardly ever use the \negthinspace command  \!.  This is because I don't know how to use it properly (I do use other spacing commands quite a bit, because I can better understand the guidelines of when they might be useful). When might it be considered appropriate to use this spacing command?
86933
I have a paragraph in one part of the .tex file that I want to be duplicated in another part of the .tex file.  I could do ctrl-c, ctrl-v... as easy as that, but then if I modify one place, I will have to do the same for the other.  Is there a way to take a piece of text, in some part of the document, surround it by some reference marker, and then just use this reference marker elsewhere to duplicate the text?  EDIT: I could just do    \newcommand{\textA}{piece of text}   and then use "\textA" anywhere I want this text to appear.  However, I want "\textA" to be defined in a certain place in the document (in the .tex file). That location appears after the first time I want to use this macro.  Macros can be used only in places in the document after which they were defined, so I can't do that.
49537
Here is an example of using cut to break input into fields using a space delimiter, and obtaining the second field:  cut -f2 -d' '   How can the delimiter be defined as a tab, instead of a space?
13229
I'm not sure exactly what terminology to use to ask this question.   What I want to do is define a command pluralize such that I can do this:   \newcommand{\individual}{individual\xspace} \pluralize{\individual}  the \individual with the \individuals   and then get   the individual with the individuals     The reason I want to do this is because I might change terminology like:  \newcommand{\individual}{name\xspace} \pluralize{\individual}  the \individual with the \individuals   and then get   the name with the names     Currently what I'm doing is explicitly writing out the plural version of each command like:   \newcommand{\individual}{individual\xspace} \newcommand{\individuals}{\individual{}s\xspace}   But it seems like I should be able to turn this into a macro for simple pluralizations.   I have tried three things so far that do not work. First I tried what I thought may work:  \newcommand{\pluralize}[1]{\newcommand{\#1}{\#1{}s\xspace}   Then I looked online. I tried following the guidelines in   I came up with   \makeatletter \newcommand{\pluralize}[1]{%     \expandafter\newcommand\csname #1s\endcsname{#1{}s\xspace}% } \makeatother   and   \makeatletter \newcommand{\pluralize}[1]{%     \@namedef{#1s}{\\#1s\xspace} } \makeatother \expandafter\newcommand\csname #1s\endcsname{#1{}s}%   but I either get a compile error, or an error if I use the macro. I'm not really  sure what the @namedef, \expandafter, or \csname commands do either.     How can I correctly define the pluralize command?