0

I have this environment with 9 arguments. I want to highlight some of the inputs of the argument (#1). Is it possible to do so?

\documentclass{article}
\usepackage[margin=1in, a4paper]{geometry}
\usepackage{multicol}
\usepackage{polyglossia}
\setotherlanguage{bengali}
\setmainfont{Times New Roman}
\newfontfamily\bengalifont[Script=Bengali]{Kalpurush}

\newenvironment{word}[9]% environment name { \fbox{#1}\hspace{0.2cm}\textit{#2}---#3\ifstrempty{#4}{}{\textbengali{ / #4}}\newline \ifstrempty{#9}{}{ex: \textbf{\textit{``#9''}}\} \ifstrempty{#5}{}{n: #5\} \ifstrempty{#6}{}{v: #6\} \ifstrempty{#7}{}{adj: #7\} \ifstrempty{#8}{}{adv: #8\} \newline }{}

\title{} \author{} \date{January 2023}

\begin{document}

\maketitle

\begin{multicols}{3} \section{31/05/2022} \begin{word} {269}{irrefutable}{impossible to deny or disprove}{}{}{}{}{}{} \end{word} \begin{word} {270}{asunder}{apart}{}{}{}{}{}{} \end{word} \begin{word} {271}{parables}{short story about moral attitude}{}{}{}{}{}{} \end{word} \begin{word} {272}{propound}{put forward / offer}{}{}{}{}{}{} \end{word} \end{multicols}

\end{document}

I want to mark some numbers automatically by putting those in a separate file or in the same file like this [269,271 and so on]

Fahad
  • 43
  • Could you extend your code fragment into a Minimal Working Example (MWE) please, it will help you get an answer if you make it as easy as possible for people to help :) – JamesT May 16 '23 at 08:29
  • Please note that \newenvironment requires three arguments (plus two optional ones for the number of arguments and the default value of the first if it should be optional), so correct would be \newenvironment{<name>}{<code-in-begin>}{<code-in-end>}, it looks like your use only has the first two (and works by accident because there is an implicit \par following because of the two consecutive newlines). – Skillmon May 16 '23 at 11:07
  • @Skillmon Sorry! I forgot to add the {end_def}. I have edited my code. There is no default value for the first argument as it is mandatory. – Fahad May 16 '23 at 14:20
  • Another thing: You might want to think about a key=value interface instead of 9 consecutive arguments, named parameters are usually easier to memorise and use than positional ones. – Skillmon May 16 '23 at 15:21
  • @Skillmon I don't know about the key=value interface. – Fahad May 16 '23 at 16:58
  • 1
    There are different variants of key=value interfaces in LaTeX. There is a list here. I myself prefer my own package (duh), the ones that are worth a look in that list, imho, are: "LaTeX kernel" (or "l3keys.sty" as they are the same under the hood), "expkv" (this is mine), "pgfkeys.sty". – Skillmon May 17 '23 at 18:53

0 Answers0