7

I'm trying to reproduce this notation in LaTex but to no avail.

enter image description here

This means $e_j$ has the value of $0$ in all other coordinates except for the j-th one.

I can only do the part without $(j)$: $e_{j} :=(0, \ldots, 0,1,0, \ldots, 0) \in K^{m}$

Please shed me some light! Thank you so much!

3
  • 2
    Note that this is not a please_do_this_for_meservice. Please provide what you have do far. You should at least be able to provide the contents of the image without the $(j)$ part, having that code will make it a lot easier for others to help
    – daleif
    Sep 5, 2019 at 14:25
  • 1
    Thank you @daleif! I will do it now.
    – Akira
    Sep 5, 2019 at 14:27
  • 1
    I'm leaving this as a comment and not an answer because it doesn't do what you want to do, but I think that (\underbrace{0, \dots, 0}_{j-1}, 1, \underbrace{0, \dots, 0}_{m-j}) is more clear than your notation. Sep 6, 2019 at 16:49

6 Answers 6

5

For example:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{stackengine}
% these are from https://www.tug.org/TUGboat/tb22-4/tb72perlS.pdf    
\def\clap#1{\hbox to 0pt{\hss#1\hss}}
\begin{document}
$(0,\dots,0,\ensurestackMath{\stackunder{1}{\clap{$(i)$}}},0,\dots,0)$
\end{document}

enter image description here

(The \clap is a bit harsh; see the linked article for a better way)

3
  • 3
    Nice (+1). If, in the preamble, you use \renewcommand\useanchorwidth{T}, you can eliminate the \clap. Sep 5, 2019 at 14:31
  • 2
    @StevenB.Segletes thanks, one never stops learning...
    – Rmano
    Sep 5, 2019 at 14:37
  • 3
    That being said, mathtools  defines \clap and \mathclap.
    – Bernard
    Sep 5, 2019 at 15:15
10

I propose two variants, with mathtools and old-arrows:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{old-arrows} %

\begin{document}

$e_j = (0,\dots,0,\underset{\mathclap{(j)}\strut}{1},0,\dots,0)$

$e_j = (0,\dots,0,\underset{\substack{\uparrow\\ j}\strut}{1},0,\dots,0)$

\end{document} 

enter image description here

8

Here's a solution which employs the amssymb and mathtools packages.

enter image description here

If you would like to push the (j) term a bit lower than in the picture shown above, simply change {1} to {1\mathstrut}.

\documentclass{article}
\usepackage{mathtools,amssymb}
\begin{document}
Let $m\in\mathbb{N}^{\times}$. For $j=1,\dots,m$ define
\[
e_j := (0,\dots,0,\underset{\mathclap{(j)}}{1},0,\dots,0) \in K^m
\]
\end{document}
1
  • 2
    Yep, cleaner than mine.
    – Rmano
    Sep 5, 2019 at 15:50
7

Here is an example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$E_j := \underset{(j)}{(0,\dots,0,1,0,\dots,0)}$
\end{document}


EDIT:

For asymmetric case:

e_j := (0,\dots,\underset{(j-1)}{0},\underset{(j)}{1},0,\dots,0)

enter image description here

0
6

My proposal, as alternative to the best answers, is the use the package blkarray. enter image description here

\documentclass[12pt]{article}
\usepackage{mathtools,blkarray}
\begin{document}
\[
\begin{blockarray}{ccccccccc}
\begin{block}{c(ccccccc)c}
e_{j} \coloneqq \mkern-5mu& 0, &  \ldots, & 0, & 1, & 0, & \ldots, & 0 & \mkern-5mu \in K^{m}\\
\end{block}
& &  &  & (j)
\end{blockarray}
\]
\end{document}
2

Using, appropriately the package nicematrix using the due spacings (\mkern), you can obtain a similar result.

enter image description here

\documentclass{article}
\usepackage{amssymb}
\usepackage{nicematrix}
\begin{document}
Let $m\in\mathbb{N}^{\times}$. For $j=1,\ldots,m,$ define

$e_j\mathrel{\mathop:}=\mkern-7mu \begin{pNiceArray}{ccccccc}[last-row,first-col,last-col]
& 0, &\mkern-10mu\ldots, &\mkern-10mu 0, &\mkern-15mu 1, &\mkern-15mu 0, & \mkern-15mu\ldots,&\mkern-15mu 0 &\\ 
&  &  & & \mkern-20mu \overset{(j)}{}  & & & 
\end{pNiceArray}\mkern-7mu \in K^{m}$
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .