New answers tagged

0

For me, \parallel works fine: \documentclass{article} \begin{document} \[D(P\parallel Q) = \ldots\] \end{document}


5

Something like this? \documentclass{article} \usepackage[T1]{fontenc} % for "\dh" macro \usepackage{amsmath} % for "\textrm" macro \newcommand{\crpartial}{\textup{\rmfamily\dh}} \begin{document} \[ dS \ge \frac{\crpartial q}{T} \] \end{document}


0

To obtain an equivalent of ${}^AB$ in LyX, you can start an empty math mode box, type ^ to enter superscript and enter the A, press space to exit the superscript, enter the B immediately after the superscript. Checking View > Source Pane, the above produces $^{A}B$, which compiles as ${}^AB$. If it is something you need to insert many times, then ...


2

This should be as simple as \renewcommand{\qedsymbol}{\includegraphics[height=1ex]{<image>}} where you can specify the options to suit your needs. Here's a minimal example: \documentclass{article} \usepackage{graphicx} \usepackage{amsthm} \renewcommand{\qedsymbol}{\includegraphics[height=1ex]{example-image}} \begin{document} \begin{proof} ...


2

Maybe something of this kind, but the brace and the main equation number are unnecessary, in my opinion. \documentclass{article} \usepackage{amsmath} \usepackage{hyperref} \usepackage{lipsum} % for mock text \begin{document} \lipsum[2] \begin{subequations}\label{main} \begin{equation} \left. \addtocounter{equation}{-1} \edef\theHparentequation{x.\...


0

I had a similar issue, solved by writing same expression in multiple lines by $$, for example, \documentclass[paper=8.27in:11.69in]{scrartcl} \usepackage{geometry} \usepackage{graphicx} \usepackage{pdfpages} \usepackage{hyperref} \usepackage{enumitem} \usepackage{amsmath} \begin{document} $\Pi_{employee-name}(\sigma_{manages.manager-id \ = \ employee2....


8

First, some general comments and observations about the code shown in your preamble: When using LuaLaTeX or XeLaTeX, you should not load the fontenc and inputenc packages. (Even when using pdfLaTeX, it's no longer necessary to load the inputenc package unless your file's input encoding is not UTF8 or ASCII, which is a proper subset of UTF8.) Loading the ...


5

The bm package is for legacy 8-bit fonts. In unicode-math, load a math font that comes in bold (currently, XITS Math, Libertinus Math or Minion Math) and use \boldsymbol for bold operators and signs. If you only need bold letters, you can use \mathbf, \mathbfcal, etc. Or the new commands \symbfup for bold upright, \symbfit for bold italic, etc., as Mico ...


4

I have never used gb4e, but looking at its definition of \exp % gb4e.sty line 319 \def\exp#1{\exi{{(\ref{#1}$'$)}}} I'd say the following should work (hoping that I made a meaningful MWE for gb4e) \documentclass{article} \let\mathexp=\exp % save the current (math) definition of \exp \usepackage{gb4e} \let\gbexp=\exp % save the current (gb4e) definition ...


0

This is either a bug in LuaTeX (or maybe luaotfload) or the font itself, nothing to do with fontspec or unicode-math. Here is a plain TeX example: %!TEX TS-program = XeTeX \ifx\XeTeXversion\undefined \input luaotfload.sty \def\otf#1{[#1.otf]} \else \def\otf#1{[#1.otf]} \fi \parindent=0pt\relax \hsize=8.5cm\relax \hrule \bigskip {\bf Default \TeX} ...


6

The definition of \vdots in fontmath.ltx reads \DeclareRobustCommand \vdots{\vbox{\baselineskip4\p@ \lineskiplimit\z@ \kern6\p@\hbox{.}\hbox{.}\hbox{.}}} (This is inherited from plain.tex with the addition of robustness.) I don't quite know the idea behind the \kern6\p@ bit, but removing it removes the excess box height \documentclass{article} \...


9

As @DavidCarlisle has already noted in a comment, you may want to replace \parallel with \Vert. Importantly, the symbol produced by \Vert can be enlarged vertically with the help of the \big, \Big, \bigg, and \Bigg prefixes: \big\Vert, \Big\Vert, \bigg\Vert, and \Bigg\Vert. Finally, in case you need a bit of extra spacing around the double vertical lines, ...


4

Just don't use such verbose set descriptions: your readers will have a hard time guessing where the set description starts and ends. In the code below I added several ties ~. \documentclass[a4paper, 12pt]{article} \usepackage{amsfonts} %\usepackage{amsbsy} \usepackage{amssymb} \usepackage{amsmath} \begin{document} Let $G$ be a $3$-coloured digraph. A ...


4

\mbox and \text will not text-wrap, use $..$s for math parts only. \documentclass[a4paper, 12pt]{article} \usepackage{amsfonts} %\usepackage{amsbsy} \usepackage{amssymb} \usepackage{amsmath} \begin{document} Let $G$ be a $3$-coloured digraph. A subgraph $\mathrm{H}$ of $G$ is called linear if each component of $\mathrm{H}$ is either an edge or a cycle. ...


0

There is also the Unicode combining character U+030A ◌̊ "COMBINING RING ABOVE": https://en.wikipedia.org/wiki/Ring_(diacritic)#Overring


5

To answer question 1: All (or at least most) \mathXX are internally the same a, they only look different as they are from different fonts. The sym-variants are different symbols with different unicode code points. You can see the difference if you try to copy and paste from a pdf. \documentclass{article} \usepackage{unicode-math} \begin{document} $\mathrm{a}...


1

If you're not French and plan to never write in French, you can just do \documentclass{article} \usepackage{amsmath} \makeatletter \mathchardef\normalcolon=\mathcode`: \def\colon{% \noexpand\nobreak \mskip 2mu \mathpunct{} \nonscript\mkern -\thinmuskip {\normalcolon}% \mskip 6muplus1mu \relax } \begingroup\lccode`\~=`\:\lowercase{\endgroup\...


3

\documentclass{article} \usepackage{amsmath} \begin{document} $\forall x: P (x)$ using \verb|:| $\forall x \colon P(x)$ using \verb|\colon| \def\newcolon{% \nobreak\mskip2mu\mathpunct{}\nonscript\mkern-\thinmuskip{\text{:}}% \mskip 6mu plus 1 mu \relax} \mathcode`\:="8000 % {\catcode`:=\active \global\let:\newcolon} $\forall x: P (x)$ using ...


3

There are cases where a very high or deep object is better smashed; for instance, in an alignment where a formula ends with a summation and the next is much shorter, we can save vertical space by using \smash[b]{...} around the summation. Also your case can take advantage of smashing because of the short lines of text around the display. However, one has to ...


4

You asked, How can I smash the \sum without changing the horizontal spacing around it? To \smash the expression without affecting the spacing between \frac{1}{N} and \sum, insert an empty math atom -- {} -- as the first element of the argument of \smash. For instance, \bar{x} = \frac{1}{N}\smash{{}\sum_{n=1}^N x_i} A full MWE: \documentclass[...


3

I was able to recreate the issue you've experienced on the Wikipedia site by using \dfrac instead of \frac. I can think of three possible work-arounds. The first solution relies on inserting a typographic strut. This method is feasible only if the \vphantom directive is available. The second method employs \tfrac instead of \frac (or \dfrac). Given that ...


5

You load chemformula, so use it. \documentclass{article} \usepackage{chemformula} \begin{document} \[ \ch{MoS2 + \(x\) 'n-BuLi' -> \(\frac{x}{2}\) 'n-Oct' + Li\(\sb{x}\)MoS2 '\quad(\(x\approx{1}\))'} \] \end{document}


3

Here there is my MWE with the correct sub/superscripts. EDITS: By correct comments of the users. \documentclass[a4paper,12pt]{article} \usepackage{newpxtext,newpxmath} \usepackage{mathtools} \usepackage{xcolor} \begin{document} \[\vec{x}^2_2\] \[(\vec{x})^2_2\] \[\left(\vec{x}\right)^2_2\] \[\left\lVert\vec{x}\right\rVert^2_2\] \[\textbf{Improved ...


1

The chemical formula may be composed using the ChemEquation environment provided by XymTeX (c.f. Part VIII. Molecular Formulas and Reaction Schemes). \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} % c.f. XymTeX manual (p.6,7...) \usepackage{xymtexpdf} \usepackage{xcolor} \usepackage{graphicx} \begin{document} % c.f. XymTeX ...


2

Attempting with a combination of maths + colortbl + forest The first part is to get maths + colortbl on board And we get --- MWE for the first part \documentclass[fleqn]{article} \usepackage{amssymb} \usepackage{xcolor} \usepackage{graphicx} \usepackage{tcolorbox} \tcbuselibrary{skins} \definecolor{boxTitle}{HTML}{fff79a} \definecolor{boxBackground}{...


6

It is not difficult to create something like this except for punching in the text. \documentclass[fleqn]{article} \usepackage{amssymb} \usepackage{relsize} \usepackage{lipsum} \usepackage{tikz} \usetikzlibrary{tikzmark,positioning} \begin{document} \lipsum[1] \begingroup\larger[4] \[ \tikzmarknode{n1}{\rho\frac{D\vec V}{Dt}}~=~\tikzmarknode{n2}{-\nabla p} ...


2

Instead of using parenthesis directly, use the associated LaTeX commands. In your code replace ( with \left( and ) with \right). \documentclass[fontsize=11pt]{article} \usepackage{braket} \usepackage{chemist} \usepackage{chemformula} \begin{document} \begin{chemmath} \text{MoS}_{2}+\emph{x}\,\,\text{n-BuLi} \reactrarrow{0pt}{1cm}{}{} \frac{\...


4

I can to propose a suitably rotated of the standard symbol into the MnSymbol package called \squigarrownwse (with two variants using or only \rotatebox or \rotatebox+\reflectbox) that has the arrows both on the left and on the right as in the attached image and it could probably be a symbol that you like. You can determine the blanks you want either by ...


1

Content of your matrix is not very clear (what is in the band?), so do you looking for something like this? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \mathcal{L} = \begin{bmatrix} -2 &-3q& & & & & & \\ &-20&-6q& & &...


0

I cannot reproduce the output you get with your code. Besides moving the = to the second argument to \AddConstraint, as suggested in another answer, I propose a different setting, with constraints left aligned, which seems better to me. Also I removed all \left/\right pairs, which do nothing besides adding unwanted space. A \, before dt is necessary, ...


2

Despite the many reasons not to do it this way, and Alan's comment provides a link about not using \ensuremath, I nonetheless suggested placing an \ensuremath around the code, as in \newcommand*{\pdiffat}[3]{\ensuremath{\left(\frac{\partial{#1}}{\partial{#2}}\right)_{#3}}} In this manner, the command will function when invoked in either text or math modes. ...


6

Remove the spaces between the \newcommand* and the command name, they seem to confuse the overleaf parser. This here works fine for me: \newcommand*{\pdiffat}[3]{\left(\frac{\partial{#1}}{\partial{#2}}\right)_{#3}}


3

You are redefining \familydefault to be equal to \sfdefault. This means that polyglossia is looking for a sans serif cyrillicfont. You can set it up with \newfontfamily\cyrillicfontsf{Arial}[Script=Cyrillic] It would be probably also a good idea to setup \cyrillicfonttt for the typewriter font.


1

Just for reference, here's a solution which does not employ the optidef package. Instead, it employs 1 align* environment (for the 4 "outer" blocks) and 1 aligned environment (for the group of 3 "inner" blocks which, together, make up the final "outer" block). align* and aligned are both provided by the amsmath package. \documentclass{article} \usepackage{...


1

I'll be happy to remove this post. According to what I find, you just need to move the position of the = sign in \addConstraint{\dot{\mathbf{x}} =}{\mathbf{f}\left(\mathbf{x},\mathbf{u},t\right)} to become \addConstraint{\dot{\mathbf{x}}}{ =\mathbf{f}\left(\mathbf{x},\mathbf{u},t\right)} Full example: \documentclass{article} \usepackage{optidef} \begin{...


5

TeX is also used much more frequently than roff or eqn, including on websites and message boards. For example, the math sites here on SX use MathJax, which is based on LaTeX. If you ever want to publish a paper, you’ll also need to know it.


34

Equations in roff roff (or groff or any other implementation) doesn't actually support mathematics typesetting. To this end you have to use a preprocessor which transforms equations in your document into something that groff can read. I'm only aware of the eqn preprocessor for equations but there might be others. One obvious downside of eqn (or groff in ...


6

Works in all math styles...can easily choose scale by changing Vert/Horz. stretch parameters shown as .6 and .5. Line thicknesses will always be good, since this is composed from an overlay of - and \vert in the appropriate math style. \documentclass{article} \usepackage{stackengine,scalerel} \newcommand\newperp{\mathbin{\ThisStyle{\setbox0=\hbox{% \...


9

Adjust to suit: \documentclass{article} \usepackage{amsmath,l3draw,xparse} \ExplSyntaxOn \NewDocumentCommand{\sperp}{} {% short perp {\mathord{\text{\daddy_sperp:}}} } \cs_new_protected:Nn \daddy_sperp: { \use:c { check@mathfonts } $\mspace{1mu}$ \draw_begin: \draw_cap_round: % good for CM fonts \draw_linewidth:n { \dim_to_fp:n { \...


7

Instead of importing the symbol from a different font one might compose it from \mapstochar and a minus sign \documentclass{article} \usepackage{graphicx} \makeatletter \newcommand*{\sperp}{\mathrel{\mathpalette\@sperp\relax}} % \sperp for "short perp" \newcommand*{\@sperp}[2]{% \setbox0=\hbox{$#1\mapstochar$}% \setbox0=\hb@xt@\ht0{\hss\rotatebox[...


8

The version of \perp in the MnSymbol package is narrower than the 'standard' version, but also slightly shorter. To load it without changing lots of other things, we can borrow most of the code from @Leo Liu's answer to Importing single symbol from MnSymbol. Then we obtain the following: \documentclass{article} \DeclareFontFamily{U} {MnSymbolA}{} \...


1

According to the documentation, posted on CTAN here, you'll find starting on page 6 that there are macros \sage, \sagestr, \percent, and \sageplot. The \sage macro is for numerical data and \sagestr is for string data. I've adjusted your code so that it uses \sagestr. To work numerical data in (a = 11/2) I've added it to your strings using using a raw string ...


9

\textbackslash is a text-mode command, so it does not work in math-mode (as you may have noticed) because math fonts are wildly different from text fonts, so the characters are set up differently, so they are not at all compatible. in math-mode you'd use \backslash if you wanted the backslash math symbol. Though your command: $\textbackslash$def $\...


3

Welcome to TeX.SE... Why you need \textbackslash inside math, is there any intentional? You can use just \backslash inside math...


0

You need to adjust the bold math variant \SetSymbolFont{operators}{bold}{OT1}{cmr} {b}{n} Thi swill affect operators like \log and \mathrm generally and make it use bold rather than bold extended. The bold math italic font in your last example is wider as math italic has wide sidebearings to make adjacent letters appear as a product of variables rather ...


3

If you define \px as \newcommand{\px}[1][]{\frac{\partial{#1}}{\partial x}} the [1] defines \px as a command with 1 argument, but the [] written right after the [1] make this argument optional. If you included something between this second pair of square brackets, it would become a default value for this optional argument. So with \px defined as above, the ...


4

Is this the required result of the your question? \documentclass[10pt,letterpaper]{article} \usepackage[utf8]{inputenc} \usepackage[spanish,es-tabla]{babel} \usepackage[T1]{fontenc} \usepackage{amsmath,amssymb,amsthm} \newcommand{\px}[1][]{\frac{\partial#1}{\partial x}} \begin{document} \[ \px[F_x], \px \] \end{document}


5

\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \[ P_{s,t}^{WT}=\begin{dcases} 0 & V_{s,t}^{WT} \leq V_{ci} \\ p_r\times\biggl(\frac{V_{s,t}^{WT}-V_{c,t}} {V_t - V_{ci}}\biggr)^3 & V_{ci} \le V_{t,s}^{WT} \le V_{cr} \\ p_r ...


6

You can load amstex (which is recommended if you do much mathematics), but you have to fix the definitions of \dddot (and \ddddot): \input amstex % fix \dddot and \ddddot \begingroup \catcode`@=11 \gdef\dddot#1{{\mathop{\kern0pt #1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@ \hbox{\rm...}\vss}}}} \gdef\ddddot#1{{\mathop{\kern0pt #1}\limits^{\vbox to-1.4\ex@{\...


9

The amstex macros provide this accent. \input amstex $\dddot{a}$ \bye


Top 50 recent answers are included