New answers tagged

0 votes

How do I globally adjust/stretch the in-between vertical spacing of items in lists only when they include display style fractions in inline math mode?

Here is the way I come up with. Instead of figuring out whether there is \dfrac somewhere in the list and then change the sep, you can locally redefine \dfrac itself, so that it is a bit "taller&...
user avatar
  • 2,030
1 vote

How do I programmatically typeset Polynomial Long Division with connected parenthesis and line? (Possibly using TikZ)

Short answer: \documentclass{article} \usepackage{polynom} \usepackage{tikz} \usepackage{etoolbox} \makeatletter \patchcmd{\pld@ArrangeResult}{\bigr)}{ \,\tikz[overlay]{ \coordinate (A) ...
user avatar
  • 2,030
4 votes
Accepted

double-underline notation for matrices and single-underline notation for vectors

I still think that underlining is evil and really old-fashioned notation. Anyway, here's a working solution. \documentclass{article} \usepackage{amsmath} \makeatletter % overline \newcommand{\...
user avatar
  • 993k
1 vote

Place the start and end index above and below the symbol ||

I don't quite understand the syntax, but I was able to solve using this feature directly in the text: \def\Parallel{\mathop{\parallel}} $$ E = \Parallel_{i=1}^8 E_i $$
user avatar
3 votes

Recursively update macro

\temp with many LaTeX-packages is a scratch-macro. So code not stemming from you might override (re)definitions of \temp stemming from code written by you. In order to prevent such clashes in the ...
user avatar
  • 23.5k
4 votes
Accepted

Recursively update macro

Your code seems to work. Let's add some tracing in order to better see what happens: \documentclass{article} \begin{document} \def\temp{} \def\update#1_#2{ \xdef\temptemp{\temp} \gdef\temp{\...
user avatar
  • 993k
4 votes

Recursively update macro

You are doing full expansion (\xdef) of previous macro declated by \update but \underbrace is more complicated macro which uses \halign with # in its preamble and this cannot be fully expanded without ...
user avatar
  • 53.5k
3 votes

Recursively update macro

underbrace is a robust command protected by LaTeX's \protect mechanism. For the mechanism to work properly you need the protected@ functions. \documentclass{article} \begin{document} \def\temp{} \...
user avatar
  • 2,218
3 votes

How do I create macros that take + (plus) or - (minus) separated arguments as inputs and stores them to variables (e.g., coefficients of polynomials)?

You can read numbers to registers \coefnum and \expnum and run next macro using \afterassignment. \newcount\coefnum \newcount\expnum \def\polycoeff#1{\polyA#1\relax} \def\polyA{\afterassignment\...
user avatar
  • 53.5k
0 votes
Accepted

Format long equation in Array

Thanks for posting some additional explanations. I have three major suggestions: I think that in order to typeset the matrix environments that contain the 3x1 vectors, you need to provide 1 line ...
user avatar
  • 439k
0 votes

Format long equation in Array

Here is a way to have a more readable matrix and a simpler code with the cellspace and mathtools packages, using systematically \dfrac. Furthermore, the esdiff package simplifies the typing of partial ...
user avatar
  • 261k
0 votes

avoid space after commas used as thousands separator in math mode

If you want an upper punctuation (freistehender Hochpunkt) without empty space in a math environment try \dot\, example: $ 14\dot\,000\dot\,000 \cdot \mbox{0,6} = 8\dot\,400\dot\,000 $ which will ...
user avatar
  • 101
0 votes

How Do I Typeset Horner's Method / Scheme of Regular Synthetic Division and Expanded Synthetic Division for Monic Divisors and Non-Monic Divisors?

From a programming perspective I’d typeset each of your 6 use cases and many more manually, i.e. without any option. Variability is king here. Next I’d have a look at commonalities and differences and ...
user avatar
  • 1,774
2 votes
Accepted

Problem in showing partial derivatives in a table

Here is a solution, without equation numbers, with the esdiff package: \documentclass{article} \usepackage{amsmath} \usepackage{esdiff} \usepackage{array, booktabs} \begin{...
user avatar
  • 261k
1 vote

LyX left subscript in math formula

Here's a solution that I found to be easier than Werner's, and not requiring the extra packages and macros that Ur's solution needs: Simply press CTRL+SPACE to make a half-space, which allows you to ...
user avatar
2 votes

How to correctly Indent the equation?

If you want your = signs aligned, use a single align* environment. Also, Use \sin not sin to get the proper spacing and shape. Similarly for \cos, \tan, \log, \ln, etc. The {} after y' is unnecessary....
user avatar
  • 21.5k
3 votes
Accepted

Moving the equation to the left in "align"

I see little reason to, to be honest. Measure the two sides and insert the appropriate space (positive or negative). \documentclass{article} \usepackage{mathtools} \DeclareMathOperator{\Hom}{Hom} \...
user avatar
  • 993k
3 votes

Moving the equation to the left in "align"

If you want to have the ≃ character exactly in the center without any random dimensions explicitly set, then you can define your own align macro \calign based on \halign primitive TeX command and \...
user avatar
  • 53.5k
2 votes

Moving the equation to the left in "align"

You may liked the following solution: \documentclass{article} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \...
user avatar
  • 255k
2 votes

Moving the equation to the left in "align"

A simple solution with the fleqn environment from nccmath. This environment can take an optional argument to specify at which distance from the left margin it starts: \documentclass{article} \...
user avatar
  • 261k
2 votes

Moving the equation to the left in "align"

\documentclass{article} \usepackage{mathtools} \DeclareMathOperator{\Hom}{Hom} \begin{document} \noindent X\dotfill X \begin{align*} \Hom_C(C \otimes_B (B \otimes_A M), P) & \simeq \...
user avatar
0 votes

Wrong output of subscripts while using Hendrik Vogt's "\widebar"

You get the same output as \mathcal{I_x} just with overline above it. You can use \widerbar{{\mathcal{I}}_{x}} to fix it. I reproduce the behavior in the example code below to show that, apart from ...
user avatar
  • 993k
0 votes

Having Matrix Style alignment in tabular

I think the most effective, yet also least obtrusive/disruptive, vertical alignment of the additive \moment_{ij}^0 term may be achieved simply by listing it first instead of last on the right-hand ...
user avatar
  • 439k
1 vote

How do you get \mathbb{1} to work (characteristic function of a set)?

Almost all Unicode math fonts have the character U+1D7D9 with TeX control sequence \Bbbone which looks like this: 𝟙. If you have Unicode math font loaded then you can use \Bbbone or directly 𝟙. For ...
user avatar
  • 53.5k
1 vote

How do you get \mathbb{1} to work (characteristic function of a set)?

Like user41766 said, using bbold is a good idea (the best imho if unicode-math isn't an option), but it would "ruin" the other letters. You can solve this issue by declaring a new alphabet, ...
user avatar
1 vote
Accepted

Dotted x in mathmode

As already commented, you have \Godelnum{A(\dot{x)}} so the dot is placed above the combination x), hence it is higher and centered with respect to both items. You should fix into \Godelnum{A(\dot{x})...
user avatar
  • 993k
0 votes

How to write "computer zero" (with slanted vertical line) in TeX?

The following command overlaps any two symbols, can be used with a regular O and / to product 0: \rlap{0}/
user avatar
  • 101
4 votes

How can I show S-comma in LaTeX math mode?

If you really want larger font size in the display, you can avoid \mathlarger, but I'd not do it: a math display is already prominent enough. In any case, you need \text for textual parts in math ...
user avatar
  • 993k
4 votes

How can I show S-comma in LaTeX math mode?

In addition to rendering text-type words that may appear in a math expression in text mode (via a \text directive, say), you may want to execute a single \large instruction before entering math mode ...
user avatar
  • 439k
1 vote
Accepted

Failed to use TikZ to draw lines matching \delimsize

Give the line correct height (equivalent to non-latex3 code \the\dimexpr\ht\mybox+\dp\mybox if \newbox\mybox \setbox\mybox=\vbox{$#1\vert$} is set) Set the correct baseline for tikz drawing (at ...
user avatar
  • 21.8k
3 votes

don't understand a particular error message I'm getting

The problem is that the first [ follows \\ and is mistaken for introducing the optional argument. Use \relax or, better, use the proper tool. \documentclass{article} \usepackage{amsmath} \begin{...
user avatar
  • 993k
2 votes

don't understand a particular error message I'm getting

the [is being seen as an optional argument, which takes a length, \\[5pt] so use ....\\ \relax [....] to hide the [ from \\ Note $$ and\hskip are TeX primitives that should not be used in LaTeX, ...
user avatar
14 votes
Accepted

How can I show S-comma in LaTeX math mode?

Words, even without accents should not be in math italic, so \text{unde} and \text{și}
user avatar
0 votes
Accepted

Adjusting Alignment in Math Mode

Like this: (red lines indicate text area borders) with use of nccmath and mathtools packages. Since I haven't your document class, I use article and increase \textwidht by \geometry package: \...
user avatar
  • 255k
2 votes
Accepted

Dashed \longleftrightarrow

Here is a tikz solution. Define a macro \longdashleftrightarrow (or some suitable shorter name) that draws an arrow of length 1.75em (approximate length of \longleftrightarrow). Loading the arrows....
user avatar
  • 21.5k
0 votes

Placement of `\vdots` looks strange with kpfonts-otf

In OpTeX, this problem doesn't exists. The original \vdots keeps unchanged even though the Unicode math with KP fonts and otf-math is initialized. The control sequence \unicodevdots is ready to access ...
user avatar
  • 53.5k
1 vote
Accepted

Placement of `\vdots` looks strange with kpfonts-otf

Let's try the following: \documentclass{article} \NewCommandCopy\originalvdots\vdots \usepackage{kpfonts-otf} \begin{document} \[ \begin{pmatrix} \mu_1\\ \vdots\\ \mu_n ...
user avatar
  • 993k
3 votes
Accepted

What is `\mathopen{}` for?

Some people write ]-1,1[ to denote the open interval from -1 to 1. The default TeX math status of the characters [ and ] is mathopen and mathclose, respectively. To properly typeset the open interval ...
user avatar
  • 439k
1 vote
Accepted

Regarding the separation line in the expression of sets

This is a proof of concept. You may want to use TikZ for a better dashed or dotted line, but the idea is the same: measure the height plus depth of \delimsize\vert. \documentclass{article} \usepackage{...
user avatar
  • 993k
1 vote

Using \colon or : in formulas?

OpTeX sets the : differently when its Unicode math is loaded. The reason is that MathClass-15.txt defines the : as punctuation mark. We left the plain TeX setting of : as relation and keep Unicode ...
user avatar
  • 53.5k
2 votes
Accepted

What is the exact spacing in \begin{gather} environment?

Not a completely automatic solution, but to reproduce the distance, add a strut of \baselineskip on each row (normally array environment does automatically if \arraystretch is 1, and \baselineskip is ...
user avatar
  • 2,218
0 votes

How continue an equation next line

I faced this situation today and the simplest solution is to use {align*} within the equation environment and double back slash \\ command at the location you want to start the next line. Although not ...
user avatar
1 vote
Accepted

How to fit the matrix in the text block?

I shall focus on the final code chunk, i.e., \newline Now, $A \times Y =\begin{vmatrix} a_{1}+a_{2}\alpha_{1}+a_{3}\alpha_{1}^{2}+\cdots+a_{n}\alpha_{1}^{n-1} & a_{1}+a_{2}\alpha_{2}+a_{n}\...
user avatar
  • 439k
1 vote

Increase the space around \circ in script style

I'm not sure you can coerce tikz-cd to apply this to all labels, but it works with the explicit command. \documentclass{article} \usepackage{amsmath} \usepackage{tikz-cd} \newcommand{\cdl}[1]{\text{$\...
user avatar
  • 993k
1 vote
Accepted

How to properly align the line without equal sign with the other lines

You could use \{ as the alignment point. \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align*} &\{ f \colon A \to B \} \\ ={}&\{ g \colon C \to D \} \end{...
user avatar
  • 439k
5 votes
Accepted

Vertical dotted line in an equation

Take the definition of \vdots from fontmath.ltx and adapt it: % from fontmath.ltx \DeclareRobustCommand\vdots{% \vbox{% \baselineskip4\p@ \lineskiplimit\z@ \kern6\p@ \hbox{.}\hbox{.}\...
user avatar
  • 993k
4 votes

Vertical dotted line in an equation

You can define \tallvdots by: \def\tallvdots{% \mathrel{\vcenter{\offinterlineskip \kern-1.4ex\hbox{$\vdots$}\kern-.7ex\hbox{$\vdots$}% }}% } No array, no rotatebox. Only two \vdots one ...
user avatar
  • 53.5k
3 votes

Vertical dotted line in an equation

Something like this? Note that in addition to creating and using a macro called \tallvdots, I've also replaced all instances of | with \mid. \documentclass{article} \usepackage{amsmath} % for '...
user avatar
  • 439k
5 votes

Boxes with text or numbers

You can define your own box with the height of a k and the depth of a j by using \vphantom{$jk$} in the definition. You can change which blocks have \overbrace and \underbrace if you like. Then put ...
user avatar
  • 21.5k
3 votes

Boxes with text or numbers

Here is one way to create your first diagram or drawing: I use tikz, its shapes.multipart library for split rectangles, and positioning for relative placement. Please find details in the pfg manual. ...
user avatar
  • 1,774

Top 50 recent answers are included