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

44
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 ...
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 ...
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 ...
17
votes
1answer
13k views

How to rotate text inline?

I used the rotating package to rotate the symbol 90 positive degrees and that worked well. But I also want to rotate it 270 positive degrees and then it ends up hanging down on the line below. How can ...
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 ...
16
votes
3answers
2k views

How to make horizontal lists?

This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one?
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 ...
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 ...
13
votes
5answers
683 views

Alignment in inline math

I want to enclose a tabular environment with a bracket, inside an enumerate environment, and be aligned to top. In the following example: \documentclass[a4paper]{article} \begin{document} ...
13
votes
1answer
949 views

Why do I have overfull \hbox when I use inline math without line breaks

To prevent line break within equation I use following LaTeX command: ${r^2 = x^2 + y^2}$. Unfortunately it gives me Overfull \hbox (12.4459pt too wide) warning. Why LaTeX doesn't move whole ...
10
votes
2answers
815 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 ...
10
votes
2answers
187 views

Different symbols in $…$ and align environments

Is there a way to force LaTeX to produce different symbols either in $...$ or \begin{align}...\end{align} environments? For example $ \mymacro $ should lead to A while \begin{align} \mymacro ...
9
votes
2answers
452 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
3k 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 ...
8
votes
2answers
300 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 ...
8
votes
2answers
2k views

Line-break inside a `\verb'

I have set my text editor to wrap text at 76 columns. When including verbatim text in-line, my text editor did an auto-word-wrap and I ended up with something that looked like: \item Just another ...
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
318 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 ...
8
votes
1answer
119 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 ...
8
votes
2answers
232 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} ...
7
votes
1answer
895 views

Is it possible to use \begin{align} in an inline math mode with \displaystyle?

Is it possible to use \begin{align} in an inline math mode with \displaystyle?
7
votes
2answers
709 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 ...
7
votes
1answer
1k views

Avoid line breaks after \lstinline

I'm writing a computer science paper with LaTeX and have a lot of inline code. Now, when this code is followed by a comma and is at the end of line, the line break is inserted before the comma, which ...
7
votes
1answer
147 views

Grouping items onto the same line to avoid wrapping

I am authoring a poker-related document and am using the following commands to allow me to display cards: % Suit image adjustments: \newcommand{\suit}[1]{\includegraphics[width=8pt, height=8pt]{#1}} ...
7
votes
1answer
236 views

Allow line breaks but not page breaks in inline formulas

It often happens that LaTeX breaks up an inline formula over two lines. However, I find it quite distracting when it breaks an inline formula over multiple pages. For example: ...
7
votes
1answer
272 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: ...
6
votes
3answers
177 views

How to set an Inline figure matching the text height?

I want to put a very small figure inline with text. The figure must have the same height as the line it is positioned in. I have this: Some text... \includegraphics[height=\baselineskip]{picture.png} ...
6
votes
2answers
236 views

Inline math spacing and varying interword spacing

Say I want to reduce the space between two letters in math mode by 2/18 quad. Going all Die Hard 3, I put together 2 -3/18 quad \! and add 4/18 quad with \:. The problem is, though, that apparently ...
6
votes
1answer
113 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.
6
votes
2answers
196 views

Object Formatting: Graphics as In-line Symbols

I'm trying to create an in-line symbol that is a specific shape. I'm wondering how I can have something like this in my document:
6
votes
1answer
130 views

Autofit for inline equations

I am trying to use an inline equation to list bunch o tuples. However, I it does not automatically go to next line. I am doing it manually, but this time it looks ugly. By the way I am writing in a ...
6
votes
1answer
249 views

Include BibTeX contents in a listings block

I am trying to include the literal contents of a BibTeX file in my LaTeX document using the listings package but am running into an issue. As BibTeX does not appear to be natively supported (though ...
6
votes
1answer
940 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 ...
5
votes
1answer
176 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 ...
5
votes
1answer
145 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
2answers
106 views

Tie an inline math environment to be in the same line

How should I put command so that my inline math environment could be together. For example 0<x<1 is break up into two parts, 0< and x<1 in the next line.
5
votes
2answers
469 views

Flexible/automatic alternative to multienum?

I'd like to typeset the items in an enumerate environment side-by-side. Preferably, each item would take up only as much space as necessary, perhaps plus some extra padding, and the next item would be ...
5
votes
1answer
727 views

avoid linebreak in \lstinline if possible

By using \lstinline{mysourcecode} I put some code within my document. I would like to avoid that this code is broken to a new line, if possible. so, if the codeline itself is less long than a full ...
5
votes
1answer
4k views

Embedding sound files into beamer presentation with media9

I'm trying to embed a sound file inline into a beamer so i don't need to carry the sound file around with the pdf. Currently I place sound files into my beamer with the multimedia package and this ...
5
votes
1answer
489 views

inline math with \ldots

what should be preferred: $x_1,\, x_2,\ldots,\, x_n$ or $x_1$, $x_2$, ..., $x_n$ I'm hesitating for the \ldots versus ...
5
votes
1answer
296 views

How can I make \lstinline function normally inside math mode?

\lstinline of the listings package doesn't work in math mode. When I try to use it, I get the error that \ttfamily is invalid in math mode. However, when reasoning about program semantics, it is ...
5
votes
2answers
127 views

Best way to deal with overfull inline listings

I am typesetting inline code listings using the listings package. Since I'm using C# syntax, oftentimes listings contain long words (type names/variable names). Since words in listings won't be ...
5
votes
0answers
544 views

How to have inline code and line numbering with minted?

I'm using the code found in this answer to allow minted to provide inline code. But, unfortunately, this breaks line numbering, which is not shown anymore. How can I have both inline code and line ...
4
votes
2answers
369 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 * ...
4
votes
2answers
446 views

inline equation outside margin

My inline equation falls outside the margin. I was wondering if there is any solution for that? Here is the MWE: \documentclass[12pt,letterpaper]{article} \usepackage[utf8]{inputenc} ...
4
votes
1answer
214 views

Making Inline Code Printing Pretty

I have to include small code snippets like method and class names within continuous text. I do not want to display those snippets as complete seperated listings, they should be displayed inline, ...
4
votes
2answers
315 views

Automatically adjusting layout of inparaenum

I am trying to customize an inline list in the following ways: I would like an item that doesn't fit entirely on one line to be moved to the next line. Increase the vertical space between ...
4
votes
2answers
132 views

How to denote adjacent vertices?

Background I'm trying to write a rapport that relies on some rudimentary graph theory and as such I'd like to write a section explaining the basics of it. Trying to do I've run into a bit of a snag ...
4
votes
2answers
218 views

Inline underset spilling over to next line

The underset of my "xdim" command is touching characters in the line underneath. How to correct? \documentclass[12pt]{minimal} \usepackage{amsmath} ...