1

Why does this line causes undefined control sequence error?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\title{Amsmath example}
\author{ShareLaTeX Templates}
\date{June 2017}

\begin{document}

\maketitle
\section{Introduction}

$c \in \interval[{3q/8, 7q/8})$

\end{document}
yo'
  • 51,322
Deus Ex
  • 21
  • 2
    Where is \interval defined? – Johannes_B Mar 15 '20 at 04:17
  • 3
    None of the lines in the example code defines \interval (or causes it to be defined). So the error we get is pretty natural. Maybe you were hoping to use the command from https://tex.stackexchange.com/a/135529/35864? In that case you just forgot to include the relevant code in your preamble. – moewe Mar 15 '20 at 06:31
  • 1
    You can load the interval package, but the syntaxt uses two arguments – Bernard Mar 15 '20 at 12:03

1 Answers1

1

Just reading the guide to the pag. 3, of interval package as written in the @Bernard's comment. http://ctan.mirror.garr.it/mirrors/CTAN/macros/latex/contrib/interval/interval.pdf. You can see also the bad result when you use \dfrac option.

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
\usepackage{interval}
\title{Amsmath example}
\author{ShareLaTeX Templates}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
$c \in \interval{3q/8}{7q/8}$
\vskip 1cm
$c \in \interval{\frac{3q}{8}}{\frac{7q}{8}}$
\vskip 1cm
$c \in \interval{\dfrac{3q}{8}}{\dfrac{7q}{8}}$
\end{document}

enter image description here

Sebastiano
  • 54,118