I'm trying to write macros to find the padronized values of resistors of the E24 family (as a first step), and I'm receiving the folowing error message:
! Use of \??? doesn't match its definition.
<argument> \???
! LaTeX3 Error: Extra ) ignored.
l.22 ...0\Omega$, this value is the\ExxivPos{3300}
th of E24 family of resist...
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
This is the test file I'm using.
\documentclass{article}
\usepackage[brazilian]{babel} % Suporte para Portugues do Brasil
\usepackage[utf8]{inputenc} % Permite acentuação automática para o Português do Brasil.
\usepackage{cmap} % Mapear caracteres especiais no PDF
\usepackage[T1]{fontenc} % Permite a hifenização correta em Português
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{xparse}
\usepackage{xfp}
\NewDocumentCommand \ExxivPos { m } {%
\def\myResNZ{\fpeval{10^(trunc(ln(#1)/ln(10)) - 1)}}%
\def\myResDS{\fpeval{#1 / \myResNZ)}}%
\def\myPtr{\fpeval{trunc(24*((ln(\myResDS)/ln(10)) - 1) + 1.5)}}%
\myPtr%
}%
\begin{document}
$R_S = 3300\Omega$, this value is the\ExxivPos{3300}th of E24 family of resistors.
\end{document}
General ⇒ <argument> \??? ! LaTeX3 Error: Extra ) ignored.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
<argument> \??? ! LaTeX3 Error: Extra ) ignored.
Unfortunately, you've not marked the code correctly as code. So I can test the following code first, after I've posted the reply. Otherwise I would have been able to test it before posting it. So please always tag code as code, like I'm doing here:
I've changed some of the code and added some comments, e.g., to mark the line, where you've had an extra
Code: Select all
\documentclass{article}
\usepackage[main=brazilian,english]{babel} % Suporte para Portugues do Brasil
\usepackage[utf8]{inputenc} % Permite acentuação automática para o Português do Brasil.
\usepackage{cmap} % Mapear caracteres especiais no PDF
\usepackage[T1]{fontenc} % Permite a hifenização correta em Português
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{xparse}
\usepackage{xfp}
\NewDocumentCommand \ExxivPos { m } {%
\def\myResNZ{\fpeval{10^(trunc(ln(#1)/ln(10)) - 1)}}%
\def\myResDS{\fpeval{#1 / \myResNZ}}% Here you've had an additional `)'
\def\myPtr{\fpeval{trunc(24*((ln(\myResDS)/ln(10)) - 1) + 1.5)}}%
\myPtr%
}%
\begin{document}
\foreignlanguage{english}{% The text is english, so we temporary select this language.
$R_S = 3300\Omega$, this value is the\ExxivPos{3300}th of E24 family of resistors.%
}
\end{document}
)
, which causes the ! LaTeX3 Error: Extra ) ignored
error.
Last edited by Ijon Tichy on Fri Oct 15, 2021 8:28 am, edited 1 time in total.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. 

<argument> \??? ! LaTeX3 Error: Extra ) ignored.
Thank you very much, that parenthesis really binded me, I've been loking for it for two days...
Next time I'll remember to mark the code and the foreign language, please forgive me for the inconvenience.
Jether

Next time I'll remember to mark the code and the foreign language, please forgive me for the inconvenience.
Jether