Math & ScienceUse special character as a variable in a formula

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

Use special character as a variable in a formula

Post by 3102 »

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 3791 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Use special character as a variable in a formula

Post by Johannes_B »

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

Code: Select all

\documentclass{article}
\usepackage{mathtools}
\newcommand{\iswhat}{\;?}
\begin{document}
$t=a$\par
$t=?$\par
$t=\iswhat$
\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

Use special character as a variable in a formula

Post by esdd »

Other possibilities are

Code: Select all

$t=\mathord{?}$
and

Code: Select all

$t={}?$
Post Reply