\begin{description}
\item[xyz] \[x=y\]
\end{description}
x=y
appears on the line below xyz
, if I changed \[x=y\]
to some normal text it wouldn't create the new line. How can I stop it?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this community\begin{description}
\item[xyz] \[x=y\]
\end{description}
x=y
appears on the line below xyz
, if I changed \[x=y\]
to some normal text it wouldn't create the new line. How can I stop it?
\documentclass{article}
\everymath{\displaystyle}
\begin{document}
\begin{description}
\item[xyz]$x=y$
\end{description}
\end{document}
Based on the given comment.
\documentclass[preview,border=12pt]{standalone}
\everymath{\displaystyle}
\newcommand\myitem[2]{\item[$#1$]\hfill$#2$\hfill\null}
\begin{document}
\begin{description}
\myitem{xyz}{\frac10+0^0}
\myitem{\frac10}{0^0}
\end{description}
\end{document}
\everymath
\documentclass[preview,border=12pt]{standalone}
\newcommand\myitem[2]{\item[$\displaystyle#1$]\hfill$\displaystyle#2$\hfill\null}
\begin{document}
\begin{description}
\myitem{xyz}{\frac10+0^0}
\myitem{\frac10}{0^0}
\end{description}
\end{document}
\item[..] \[...\]
, then you can write a macro \myitem
that formats things the way you want. If not, then it's more difficult.
\everymath
here, it is considered quite problematic in LaTeX.
\line
similar to\item
? And, do you wantx=y
to be horizontally centred just like\[x=y\]
?\[\]
. Hence, it will automatically create a new line for you in math mode. If you want to use inline math, simply use$<content>$