How do I put a question mark above \leq? - latex

How can I put a question mark above a less-than-or-equal-to symbol(\leq) in LaTeX?

You can use stackrel:
\begin{equation}
2 \stackrel{?}{\le} 3
\end{equation}
\end{document}
Or, if you use the amsmath package, you can use overset as follows:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
2 \overset{?}{\le} 3
\end{equation}
\end{document}

\stackrel{\text{\tiny ?}}{=}

Use the accents package. You can do more fun stuff with TeX primitives, but here's the easy and most flexible way:
\documentclass{article}
\usepackage{accents}
\newcommand{\qleq}{\accentset{?}{\leq}}
\begin{document}
Test: $a \qleq b$.
\end{document}

Related

Latex equation reference not working as expected

I am preparing a report and found out \label and \eqref are not working for equations properly. \eqref giving a random equation number and not the exact equation number in the report. I have used \numberwithin{equation}{section} numbering for equations, which means if the equation is in section 5, it will have number from 5.1, 5.2 and so on. But in \eqref only 5 is coming and not the exact number of the equation. Is there any solution for this?
Equation number \eqref{eq:1}.
\begin{fleqn}[150pt] \label{eq:1}
\begin{equation}
\begin{aligned}
\Delta l^e = u^e_2 - u^e_1
\end{aligned}
\end{equation}
\end{fleqn}
Your label needs to be inside the equation:
\documentclass{article}
\usepackage{mathtools}
\numberwithin{equation}{section}
\begin{document}
\section{title}
Equation number \eqref{eq:1}.
\begin{equation}
\begin{aligned}
\Delta l^e = u^e_2 - u^e_1
\end{aligned}
\label{eq:1}
\end{equation}
\end{document}
If you really must use the nccmath package, you could roll back to an older latex version:
\RequirePackage[2019/01/01]{latexrelease}
\documentclass{article}
\usepackage{nccmath}
\numberwithin{equation}{section}
\begin{document}
\section{title}
Equation number \eqref{eq:1}.
\begin{fleqn}[150pt]
\begin{equation}
\begin{aligned}
\Delta l^e = u^e_2 - u^e_1
\end{aligned}
\label{eq:1}
\end{equation}
\end{fleqn}
\end{document}

In latex, the integral symbol '\int' displays as '\Delta' in the compiled pdf, why?

This happens in some (but not all) documents, where '$\int$' in an equation displays as '$\Delta$' in the compiled pdf. For those documents, I tried both Winedt and Overleaf and the same things just happen.
The problem can be replicated by using the following codes in the main.tex file:
\documentclass[a4paper,10pt]{autart}
\pagestyle{plain}
\date{\today}
\usepackage{esint}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\setlength {\marginparwidth }{2cm}
\begin{document}
\begin{frontmatter}
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
\thanks[footnoteinfo]{Acknowledgement...}
\author[AuthorCategory1]{Author 1}\ead{author1#somewhere}
\author[AuthorCategory2]{Author 2}\ead{author2#somewhere}
\address[AuthorCategory1]{Address 1}
\address[AuthorCategory2]{Address 2}
\begin{abstract}
---
\end{abstract}
\end{frontmatter}
\section{This is a section}
\begin{eqnarray}
\int \nonumber
\end{eqnarray}
\end{document}
The autart.cls can be found online, for example at https://hal.archives-ouvertes.fr/file/index/docid/514508/filename/autart.cls
You will get a result like this:
And from my own exploration, the problem can be solved surprisingly if changing the title from
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
to
\title{Title\thanksref{footnoteinfo}}
And you will get the correct integral symbol as follows:
It seems that you can also solve the problem by removing the "esint" package, or change the document class from autart to article. I guess there is some conflicts defined in these class/packages, maybe, and result in this funny phenomenon.
Is there a way to solve the problem without changing the title, while using autart document class and esint package?
Thanks.
Ironically, the problem is in the \no#harm macro your class defines, which redefines \protect. You can work around the problem by removing this defintion like this:
\documentclass{autart}
\pagestyle{plain}
\date{\today}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\no#harm}{\def\protect{\noexpand\protect\noexpand}}{}{\typeout{patch ok}}{\typeout{patch fail}}
\makeatother
\usepackage{esint}
\setlength {\marginparwidth }{2cm}
\begin{document}
\begin{frontmatter}
\title{Generalized $t$-Distribution Noise Model\thanksref{footnoteinfo}}
\thanks[footnoteinfo]{Acknowledgement...}
\author[AuthorCategory1]{Author 1}\ead{author1#somewhere}
\author[AuthorCategory2]{Author 2}\ead{author2#somewhere}
\address[AuthorCategory1]{Address 1}
\address[AuthorCategory2]{Address 2}
\begin{abstract}
---
\end{abstract}
\end{frontmatter}
\section{This is a section}
\begin{eqnarray}
\int \nonumber
\end{eqnarray}
\end{document}

How do I write this in LaTeX?

How do I write these symbols in LaTeX?
One possibility is the mathabx package:
\documentclass{article}
\usepackage{mathabx}
\begin{document}
\[
\odiv
\oplus
\ominus
\otimes
\]
\[
\bigodiv
\bigoplus
\bigominus
\bigotimes
\]
\end{document}
If you don't need the big versions, then the stix package would be another alternative.

How to fix "Underfull \hbox (badness 10000)" warning?

I have this small .tex file.
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1} \newline
Task description: \newline
\end{document}
When compiling, it warns about line
\textbf{Task 1} \newline
With the following message:
"Underfull \hbox (badness 10000)".
How do I fix this?
I had a similar issue, I solved it by removing any \newline or \\ at the and of every sentence that had nothing textual below.
For instance, two examples that causes that problem:
An example. \\
This is well used. \\
This line will cause the error. \\
(I'm a new paragraph) \\
Because there's nothing directly underneath.\\
The last line does NOT require a "newline".
This is a thid paragraph. \\
:D
The same is true for figures or similar
This is a line.
Putting a "newline", as here, before a \begin will cause the error. \\
\begin{figure}[h]
....
\end{figure}
A quick and nice solution is to use package parskip, and instead of using \newline or \\ for line breaks, simply insert an empty line
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{parskip} %% <-- added
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1}
Task description:
\end{document}
The warning will be gone.
By the way, to know why it happened, refer to this question on TeX Stack Exchange.
Instead of forcing an underfull box with \newline, you could simply leave an empty line to start a new paragraph:
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{tikz}
\setlength{\droptitle}{-3.5cm}
\setlength{\parindent}{0cm}
\newcommand{\squad}{\hspace{0.5em}}
\author{vladgovor77771}
\title{Some article}
\begin{document}
\maketitle
\textbf{Task 1}
Task description:
blabla
\end{document}

Two statements next to curly brace in an equation

How can I write an equation with one curly brace ({), and on the right-hand side next to the curly, two statements in two different lines?
You can try the cases env in amsmath.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
f(x)=\begin{cases}
1, & \text{if $x<0$}.\\
0, & \text{otherwise}.
\end{cases}
\end{equation}
\end{document}
That can be achieve in plain LaTeX without any specific package.
\documentclass{article}
\begin{document}
This is your only binary choices
\begin{math}
\left\{
\begin{array}{l}
0\\
1
\end{array}
\right.
\end{math}
\end{document}
This code produces something which looks what you seems to need.
The same example as in the #Tombart can be obtained with similar code.
\documentclass{article}
\begin{document}
\begin{math}
f(x)=\left\{
\begin{array}{ll}
1, & \mbox{if $x<0$}.\\
0, & \mbox{otherwise}.
\end{array}
\right.
\end{math}
\end{document}
This code produces very similar results.
Are you looking for
\begin{cases}
math text
\end{cases}
It wasn't very clear from the description. But may be this is what you are looking for http://en.wikipedia.org/wiki/Help:Displaying_a_formula#Continuation_and_cases
To answer also to the comment by #MLT, there is an alternative to the standard cases environment, not too sophisticated really, with both lines numbered. This code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{cases}
\begin{document}
\begin{numcases}{f(x)=}
1, & if $x<0$\\
0, & otherwise
\end{numcases}
\end{document}
produces
Notice that here, math must be delimited by \(...\) or $...$, at least on the right of & in each line (reference).
Or this:
f(x)=\begin{cases}
0, & -\pi\leqslant x <0\\
\pi, & 0 \leqslant x \leqslant +\pi
\end{cases}
Here is a way to manually control the size of brace, if cases or \left\{ doesn't provide suitable brace size you want.
\begin{math}
\biggl\{
\begin{array}{l}
statement1\\
statement2
\end{array}
\end{math}
You can choose among \bigl\{ \Bigl\{ \biggl\{ \Biggl\{ to adjust brace size from the smallest to the largest.
Image of different braces
From left to right: cases \left\{ biggl\{ Bigl\{

Resources