LaTeX forum ⇒ Math & ScienceUse special character as a variable in a formula Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
3102
Posts: 1
Joined: Sun Apr 20, 2014 2:28 pm

Use special character as a variable in a formula

Postby 3102 » Sun Apr 20, 2014 2:54 pm

If i write $t=a$ in LaTex, I get "t = a". If I write $t=?$ I get "t =?" but I want to get "t = ?". The ? shall have the same distance from the equals sign as any other variable or letter. Is there a way to to treat the "?" the same way as any other letter in a formula?

To make clear how $t=a$ and t=? look like, I have added a screenshot.
Attachments
picture1.JPG
picture1.JPG (13 KiB) Viewed 2223 times

User avatar
Johannes_B
Site Moderator
Posts: 4186
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Apr 20, 2014 7:15 pm

A quick and dirty hack would be to set the space by hand.


  1. \documentclass{article}
  2. \usepackage{mathtools}
  3. \newcommand{\iswhat}{\;?}
  4. \begin{document}
  5. $t=a$\par
  6. $t=?$\par
  7. $t=\iswhat$
  8. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Postby esdd » Sun Apr 20, 2014 10:21 pm

Other possibilities are
  1. $t=\mathord{?}$

and
  1. $t={}?$


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests