In typesetting math in LaTeX, there is inline mode (math inside text) and display mode (separate equations outside text). This tag is used for inline mode. It should also be used for other structures that provide a similar distinction between its usage, like the {listings} package's environment and ...

learn more… | top users | synonyms

6
votes
1answer
962 views

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets?

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets? E.g. using \bh and \eh commands from Highlight text in code listing while also keeping syntax ...
46
votes
6answers
16k views

Prevent LaTeX to break an inline math equation

I hope this question was not asked before. At least I haven't found it. I have an inline math equation and LaTeX is breaking it into two parts. In this case I'd prefer to have the whole and short ...
8
votes
2answers
303 views

Writing specific versions of an operator for display and inline modes

I'm busy answering a question by constructing a new math operator that uses the sum symbol and some TikZ placed on top. My answer as it stands can be found here. It looks (I think) pretty good in ...
39
votes
4answers
3k views

What is the Necessity of $…$ Around Numbers?

I typed up an assignment with a lot of numbers in LaTeX and turned it in to my adviser. When he returned it to me with some corrections, one of which was a lot of $ around my numbers. I understand ...
17
votes
1answer
5k views

Vertical alignment of inline images

Images appearing inline aren't always ideally placed relative to the baseline and risers of the text itself, so I frequently find myself doing manual adjustment, by eye, using \raisebox{}{} with a ...
23
votes
3answers
1k views

maths nested superscripts and subscripts displayed incorrectly inline

I am having a strange bug when using nested superscripts and subscripts in inline math (displaystyle works fine). This behaviour is the same independently of the font used or the compiler (orginally ...
9
votes
2answers
461 views

How do I typeset continued fractions in Pringsheim's concise notation?

I would like to obtain the following formatting so as to write continued fractions in my equations without wasting vertical space. What I need is one command named \cFrac which writes one fraction ...
9
votes
4answers
4k views

Micro-graphics inline in text

Can I insert a graphic in-line in a sentence? Use case: I'm writing a manual that involves navigating the Windows Start Menu. I would like to insert a little graphic of the start menu in-line in ...
3
votes
3answers
3k views

Numbering side-by-side equations or inline equations

I am trying to produce a two-column table of math equations, where each cell contains its own left-justified, numbered equation. I tried using \begin{equation} \end{equation} inside the tabular ...
16
votes
1answer
3k views

Inline TikZ - vertical centering

If I inline a bounded line segment like this: the distance \tikz{ \draw [|-|] (0,0) -- (5ex,0); } overarching the activities how can I make the line appear vertically centered on the line ...
8
votes
2answers
6k views

How do I keep a string of text together without it doing a line break?

I'm writing up a long paper, in which in prose I have various equations. However, I do not want a line break to occur within the equation - I want the equation to stick together. I want to do this ...
8
votes
2answers
741 views

How to force normal line spacing when inline math in text

I have trouble in writing my latex document : I have a lot of inline short math formulas in my text, and latex keep growing line spacing because of it. I'd like to force latex to keep a normal line ...
10
votes
2answers
849 views

Labelled in-line equation

I searched the internet but I cant find a solution for my problem. I want a numbered and labelled equation inside the text.Something like: The equation a+1=b (2.1) does ... The equation a+1=b ...
8
votes
1answer
127 views

Change spacing around binary operators

I'd like to change spacing around binary operators and this issue is discussed there: How to change default for spacing around binary relations? Is there way how to change spacing in math and ...
8
votes
2answers
3k views

\lstinline!Foo! vs \lstinline{Foo}

I wonder what is the difference or correct usage of \lstinline!...! and \lstinline{...}? I like better {} because I feel there it's more consistent with other commands but for example in below ...
16
votes
3answers
3k views

Preferred method for inline code samples

I tend to use the minted package for including code samples within my documents, which produces very nice output. However, because Pygments always produces a verbatim environment there's no way to ...
6
votes
1answer
116 views

Spacing around inline equations

What is the parameter determining spacing and stretchability around inline equations? I want to tweak spacing exactly but cannot find where the parameters are.
5
votes
1answer
146 views

Background color for inline math with linebreaks?

What's the simplest way to achieve coloured background for the inline equation in the following example: \documentclass{article} \begin{document} Completely unimportant text $ABC_{1234} = ABC_{1234} ...
5
votes
1answer
196 views

How can I typeset function names as they appear in algorithmic environments?

I'm using the algorithmicx package and I'd like to mention a function in common text. Is there a way to do that, or do I have to make a format that mimics the one used in the algorithm (all caps ...
4
votes
1answer
840 views

How to avoid background / frame break in code listings with math / mathescape?

I have lots of C++ sources with LaTeX formulas in the comments. Ideal for using the listings packages to pretty print the source. However, most of the formulas break either, the background or the ...
4
votes
2answers
377 views

Can I draw a small arrow from a word to a space-gap on the same line?

I want to illustrate that the const in the following line can also be moved one word to the right. Maybe I can underline the const and draw a slim arced arrow pointing to the next gap? const int * ...
8
votes
2answers
250 views

Include PDF via \pdfliteral

The pdfinlimg package and perl script allow to include ("binary") images directly into the LaTeX source code via the \pdfliteral command. For example, \documentclass[margin=1cm]{standalone} ...
8
votes
2answers
324 views

How to create an inline list via a macro

I want to create a macro that yields an inline lists. I can easily do this using enumerate* form the the enumitem package, but when I attempt to wrap this in a macro, I get: Extra }, or forgotten ...
7
votes
1answer
296 views

Embed image data (png or pdf) inside tex document [duplicate]

Is there a way to include (or "inline") raw image data or pdf data inside the tex document itself, such that it becomes stand-alone? Something like this: ...
3
votes
2answers
253 views

How to highlight all inline math in document?

As the title says, I would like to highlight all the content of $...$, \(...\), \begin{math}...\end{math} in my document. My last trial, however not really well asked was: Background color for ...
3
votes
1answer
914 views

LaTeX - Using commands inside inline code

I want to be able to have inline code (printed in typewriter or something) where I can also use LaTeX commands like \myinlinecode{here comes a backslash: <\textbackslash>}. So it should be ...
1
vote
1answer
175 views

\lstinline break at punctuation

I need listing package (\usepackage{listing}) to break at punctuation namespace::subnamespace::class ^ ^ at either these two locations