Skip to main content
29 votes

How to make a single word look as some code?

I can't believe nobody mentioned the listings package. It provides a command called \lstinline{your_code} which can even highlight keywords for you. See also this question: Should I use \lstinline ...
Domi W's user avatar
  • 390
28 votes
Accepted

How to Draw Gabriel's Horn

Almost same image but from a different point of view and with the sun in a different position. Using only tikz with the library math and layers. It may take some time to execute; the time can be ...
Daniel N's user avatar
  • 6,242
27 votes
Accepted

What characters are allowed to use as delimiters for BibTeX keys?

First of all, spaces are not allowed in key names, so we can concentrate on other special characters. BibTeX I have prepared the following test file: @article{a{}b$, author={A. Uthor}, title={With ...
egreg's user avatar
  • 1.2m
26 votes

How can I type the symbol for usual topology $R_{(-)}$ in LaTex?

Sigur's answer might be appealing, but it has a big defect: with \usepackage{MnSymbol} you change every math symbol in your document to shapes that are thought to accompany Minion. Besides, I find ...
egreg's user avatar
  • 1.2m
18 votes

How to transcript codes from HP 50G in LaTeX

This answer tries to reproduce the screenshot. It uses the lcd package, which defines an extended alphanumeric character set, with each character constructed using dots set in a 5 x 7 matrix. Thus, ...
Ross's user avatar
  • 5,686
18 votes

Replicating a chronodex in TikZ

I recreated everything from scratch and made it a \pic that is highly customizable and allows for 24-hours or am/pm format. It uses the calendar library which should make it easy to create a full ...
Jasper Habicht's user avatar
16 votes

How to format an inline source code

You can create your \inlinecode command which adapts to various languages. Here is some piece of code I've been using and which was very helpful to me: \usepackage{listings} \usepackage{color} \...
Salvioner's user avatar
  • 493
15 votes

How to present a Python code snippet efficiently in LaTeX?

Here is the way I like to do. Of course you can change colors, font sizes, borders and so on. You need Pygments to use minted. MWE \documentclass[11pt,a4paper]{report} \usepackage{tcolorbox} \...
Sigur's user avatar
  • 37.6k
15 votes
Accepted

Single-key teletype?

\documentclass{article} \usepackage{shortvrb} \MakeShortVerb| \begin{document} this |and| that or |the other| \end{document} shortvrb is in the core base latex distribution.
David Carlisle's user avatar
15 votes

How can I type the symbol for usual topology $R_{(-)}$ in LaTex?

Another possibility, cutting out the parenthesis from a \bigcirc to get more round symbols. To get a more similar symbols with square brackets, I cut them out of amssymb's \square. \documentclass{...
Vincent's user avatar
  • 20.4k
14 votes
Accepted

Is it possible to use tikzmark inside minted?

Yes, it appears to work, you just need to specify an escape character (? here) to minted so you can insert the \tikzmark. \documentclass{article} \usepackage{minted} \usepackage{tikz} \usetikzlibrary{...
David Carlisle's user avatar
14 votes
Accepted

Display bash code in LaTeX

In LaTeX, in order to display bash code and any other code, you can use the listings package. The \lstset command is used to control the basic appearance, including the language of code. Please see ...
Masroor's user avatar
  • 18.1k
14 votes

How to Draw Gabriel's Horn

I don't know if this helps, but I was able to do it with pgfplots as follows; \documentclass{beamer} \beamertemplatenavigationsymbolsempty \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=...
Jasper's user avatar
  • 1,072
13 votes

Triangle Notation in Spain

You can import the symbol from yhmath: \documentclass{article} \usepackage{amsmath} \DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n} \DeclareMathAccent{\widetriangle}{\mathord}{yhlargesymbols}{"...
egreg's user avatar
  • 1.2m
13 votes

How to illustrate the Mean Value theorem?

Some PSTricks solutions only for fun purposes! \documentclass[pstricks,border=12pt,12pt]{standalone} \usepackage{pst-plot,pst-eucl} \def\f{(x-1)^2/5+1} \def\L#1#2#3{\psCoordinates[linestyle=dashed](#...
Display Name's user avatar
  • 47.4k
12 votes
Accepted

How to transcript codes from HP 50G in LaTeX

Does this look better? \documentclass[a4paper]{article} \usepackage{listings} \lstset{basicstyle=\ttfamily, columns=fullflexible, keepspaces=true} \begin{document} \begin{lstlisting} << SWAP ...
Thruston's user avatar
  • 43.3k
12 votes

How can I type the symbol for usual topology $R_{(-)}$ in LaTex?

Just because a tikz answer is always required ... Here is one using the Arc Barb arrowhead style of the arrows.meta library. EDIT Added a line cap=round option to show that you can pretty much ...
BambOo's user avatar
  • 8,871
11 votes

Aligning table within latex editor

In TexStudio you select the data in your table and go to (top of the screen) LaTeX > Manipulate Tables > Align Columns This will neatly align your table at the &'s.
Gilian's user avatar
  • 111
11 votes

Single-key teletype?

Use fancyvrb and \DefineShortVerb (although you might not want to use `) \documentclass{article} \usepackage{fancyvrb} \DefineShortVerb\` \begin{document} I'm writing a document with a ton of ...
Phelype Oleinik's user avatar
11 votes
Accepted

what package should I use for $\mathscr{C}$?

A font that gives nice (in my extremely humble opinion, the nicest) \mathscr{} is given by the mathrsfs package. There are many others...
vonbrand's user avatar
  • 5,591
11 votes
Accepted

How can I type the symbol for usual topology $R_{(-)}$ in LaTex?

What about \leftfree \mkern -12mu \rightfree from MnSymbol package? \documentclass{report} \usepackage{amssymb} \usepackage{MnSymbol} \begin{document} \[ \mathbb{R}_{\leftfree\mkern -12mu\rightfree} \...
Sigur's user avatar
  • 37.6k
11 votes
Accepted

Replicating a chronodex in TikZ

Nice work so far. Please find below my refactored code, which replaces many draw statements by a handful of loops. Refactoring is a nice thing to do. Whenever you finished some part, like a set of ...
MS-SPO's user avatar
  • 15k
10 votes

How can I auto-indent in TeXstudio?

There is also Indent and unindent automatically under Options -> Editor -> Indentation Mode. I understand the author is happy with previous suggestions, but I hope it may help others since this ...
Alex's user avatar
  • 231
10 votes
Accepted

How to call out sections of source code?

Based on cmhughes comment sugessting the use of tikzmark, and the multiline bracket solution found here, I was able to come up with the following: \documentclass{article} \usepackage{enumitem} \...
hudsonb's user avatar
  • 323
10 votes

Triangle Notation in Spain

\documentclass{article} \usepackage{stackengine,scalerel,graphicx} \stackMath \newcommand\that[1]{% \setbox0=\hbox{$#1$}% \ensurestackMath{% \stackon[2pt]{\copy0}{\,\rotatebox{90}{\stretchto{\...
Steven B. Segletes's user avatar
10 votes

what package should I use for $\mathscr{C}$?

To use \mathscr, you can use the mathrsfs package as already mentioned. I think it is also worth mentioning the mathalpha package, which allows to use several different math script fonts. Here's a ...
Vincent's user avatar
  • 20.4k
10 votes

How can I type the symbol for usual topology $R_{(-)}$ in LaTex?

Here are two possibilities. \documentclass{article} \usepackage{amssymb} % for \mathbb macro \begin{document} $\mathbb{R}_{( \mkern-6mu -\mkern-6mu )}$ or $\mathbb{R}_{\scriptscriptstyle( \mkern-6mu ...
Mico's user avatar
  • 520k
10 votes

How to mimic StackExchange-style inline code in LaTeX

A solution which requires the use of LuaLaTeX. \documentclass{article} \usepackage{xcolor} \usepackage{luacolor} \usepackage{lua-ul} \NewDocumentCommand{\Code}{v}{\highLight[gray!20]{\texttt{#1}}} \...
F. Pantigny's user avatar
  • 43.9k

Only top scored, non community-wiki answers of a minimum length are eligible