0

The current \tikz I'm using now is this below.

\NewDocumentCommand{\signe}{m}{
    \tikz[baseline=(O.base)]{\node(O) [baseline,minimum width=25mm,inner sep = 0,align=center] {#1};}
}

\begin{itemize}
  \item \signe{(Help)} = Hello
  \item \signe{(Individual)} = Hello
  \item \signe{(Test)} = Hello
\end{itemize}

Output

enter image description here

How to left align text & align = in same line as previous.

Desired Output

- Remember There shouldn't be ...

enter image description here

2
  • You can use \tikz[baseline=(O.base)]{\node[baseline, text width=25mm, inner sep = 0pt, align=left] (O) {#1};}, but why don't you just use \makebox[25mm][l]{#1}? Commented Feb 15, 2023 at 6:19
  • Thanks \makebox worked fine.
    – d4rkshad0w
    Commented Feb 15, 2023 at 6:24

1 Answer 1

2

Welcome to TeX.SX! To align text in a TikZ \node, you need to set the option align=left and give it a fixed width, for example using the option text width:

\tikz[baseline=(O.base)]{\node[baseline, text width=25mm, inner sep=0pt, align=left] (O) {#1};}

But if you only want to align text in a box of a certain width, it is probably much easier to just use \makebox:

\documentclass{article}
%\usepackage{tikz}

\NewDocumentCommand{\signe}{m}{
    %\tikz[baseline=(O.base)]{\node[baseline, text width=25mm, inner sep=0pt, align=left] (O) {#1};}
    \makebox[25mm][l]{#1}%
}

\begin{document}

\begin{itemize}
  \item \signe{(Help)} = Hello
  \item \signe{(Individual)} = Hello
  \item \signe{(Test)} = Hello
\end{itemize}

\end{document}

enter image description here

You must log in to answer this question.

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