4

So I have a document where I have a bunch of compound names. (e.g. \lambda_v-C(t)-\rhd.) The - character in the equation context is understood as a minus sign and is WAY too long for compound names.

I know one options is to switch to a text context, (e.g. \lambda_v \text{-} C(t) \text{-} \rhd).

This works, but it's really wordy and annoying. Since I never use a minus sign in any equation in this document, I'd like the - character to automatically be displayed as the hyphen even in equation contexts. Is there a way to do this?

Alternatively, \\- or some other very short sequence would work too.

2 Answers 2

5
\documentclass{article} \usepackage{amssymb} \mathcode`-=`- \begin{document} $\lambda_v-C(t)-\rhd$ \end{document} 

output

However I suspect that you want a real arrow with “C(t)” in the middle, don't you?

Something like

\documentclass{article} \usepackage{tikz-cd} \tikzcdset{arrows={-Triangle[open]},every label=\textstyle} \newcommand{\AR}[1]{% \hspace{-0.5em}% \begin{tikzcd}[ ampersand replacement=\&, column sep=large, ] {}\arrow[r,"#1" description]\&{} \end{tikzcd}% \hspace{-0.5em}% } \begin{document} $\lambda_v \AR{C(t)} \mu$ \end{document} 

arrow

2
  • Thanks, that works. To answer your question, no, I actually have compound names with triangles in them... (They represent computation rules in some extensions of the lambda calculus) Commented Mar 3 at 17:35
  • 1
    @azani You should use {\rhd} or the spacing can go awry. Commented Mar 3 at 18:06
5

Assuming you have only a few of these names, you can define a shortcut for each, say,

\newcommand{\LC}{\ensuremath{\lambda_v \text{-} C(t) \text{-} \rhd}} 

and then simply type \LC when you need it. This way the minus sign is unaltered and remains available with its standard meaning, should you require it.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.