2

In my Latex source file, I put \everymath{\displaystyle} in the preamble. So every formula within $...$ will in displaymath style. In this circumstance, how to get an inline math style?

Knt
  • 166
  • 6
    Code between $...$ will still be typeset as inline math, \displaystyle only changes the way some parts of the math code are displayed, e.g. subscripts below operators instead of the normal subscript positioning. You can undo your global setting for a certain inline math by using $\textstyle ...$. But you probably shouldn't use your global setting in the first place; use \[ ... \] or $\displaystyle ...$ where appropriate. – siracusa Jul 07 '19 at 05:07
  • 5
    Did you see the posting Show inline math as if it were display math? The most-upvoted answer to that query -- shameless self-citation alert! -- shows how to go back and forth between \displaystyle and \textstyle. – Mico Jul 07 '19 at 06:47
  • 4
    by far the best way is not to use \everymath{\displaystyle} as it makes inline math unusable for its intended purpose but if you do do that you can use \displaystyle at the start of the expression to get back to normal https://tex.stackexchange.com/questions/323367/i-have-a-question-about-the-displaystyle-command/323375#323375 – David Carlisle Jul 07 '19 at 07:02
  • 2
    sorry I meant to write "you can use \textstyle " – David Carlisle Jul 07 '19 at 19:34
  • @DavidCarlisle I have tried, but it doesn't work. – Knt Jul 08 '19 at 00:45
  • 1
    \textstyle would work, if you have some code that does not work as you expect then it is always best to include a small complete document that reproduces the problem. However as I say in this case it is best simply not to use \everymath{\displaystyle} or only use it in a very restricted local group – David Carlisle Jul 08 '19 at 06:46

0 Answers0