Questions tagged [renewcommand]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

How do I rewrite the \listoftables command to allow for different sized table names?

I'm trying to make it so that in the list of figures (and tables), I have the figure number behind "Figure". So, I want it to have Figure 1.1 ............description............... ...
1
vote
1answer
56 views

Define command to comment text

I would like to create a command \comment{} which would not compile anything inside of { }. Why would I not use % or \begin{comment} bla bla \end{comment} from the \usepackage{comment}? Because I want ...
0
votes
0answers
9 views

Error: /partlineswithprefixformat undefined in latex

I am using one of the available template to write my thesis, and i am getting error with /partlineswithprefixformat as undefined. I tried to search for particular package to include, but nothing ...
2
votes
1answer
34 views

Use a command with variables that uses \IfSubStr on the lowercased value of the input variables

[Similar questions] I looked at \lowercase with \IfSubStr and \StrDel but the suggestions didn't work. I apparently may have expl3 since I can use \newcommand. [Issue] I want to pass a variable to a ...
1
vote
1answer
42 views

problem creating tex from tex because of missing space

I have saved a name in \Name. It is ABC. So actually I wrote both possibilities this one \immediate\write\file{\read\noexpand\NoFile to \\Name} and this one \immediate\write\file{\read\noexpand\...
2
votes
1answer
42 views

Why \renewcommand with optional arguments doesn't compile?

What's wrong with this code: \documentclass{article} \begin{document} \let\first\section \renewcommand\section[1]{\first{#1}} \let\second\section \renewcommand\section[2][]{\second{#1}} % works till ...
2
votes
3answers
85 views

Join databases with datatool

I'm trying to get a function that can take a variable amount of csv files as an argument, and then join them into a single database for Latex's datatool. The databases are all in a uniform format (...
0
votes
1answer
33 views

Modifying a Template for

I'm using a template for vocabulary and I need to modify it a little bit. \newcommand{\entry}[5]{\markboth{#1}{#1}\textbf{#1}\ {/#2/}\ \textit{#3}\ $\bullet$\ {#4}} % Defines the command to print each ...
1
vote
4answers
292 views

How to define newcommand* with a variable name?

I'm trying this: \documentclass{article} \begin{document} \expandafter\newcommand\csname foo\endcsname{} \expandafter\newcommand*\csname bar\endcsname{} \end{document} The second \newcommand* doesn't ...
0
votes
0answers
36 views

What's the difference between New commandx and New command? [duplicate]

As the title said,what's the difference between New comandx and New command?
3
votes
1answer
177 views

Is there a "do nothing" command in LaTeX?

I'm defining it like this for myself: \newcommand\nothing[1]{#1} Maybe the same already exists in LaTeX and I can just use it? PS. The purpose of this is to highlight certain parts of the .tex ...
0
votes
1answer
27 views

How can I use all vertical spacing in a Chapter page?

A while ago I found a way to format the contents of a Chapter page. However, I haven't found a way to use all of the page space for the minitoc and Chapter Title altogether. Here's a portion of what ...
0
votes
0answers
52 views

Cancel the definition of a command or environment

I will have to use for a few weeks two packages having common commands/environments (with the same name). I would like to be able to : import the first package, "delete" the definition of ...
0
votes
1answer
22 views

Return type for \newcommand probably doesn't fit \DTLfetch?

I want to fetch from the csv file with a boolean condition (either give me the fruit or give me the count). The first command (CMDone) works and says "count" and the fetch also works and ...
3
votes
3answers
116 views

Conditional newcommand depending on characters

I have a basic command I created, aimed to simply bold and move a text to gain time : \newcommand*\Cote[1]{\footnotesize\emph{\textbf{#1}}} When I want this result, I still have to use this command \...
0
votes
0answers
30 views

How automatically start a new page with the \section{} command

I want to renew the command \section such that it automatically starts a new page as well. This is also my first time using the \renewcommand macro, and I'm not sure if what I'm doing is correct. It ...
1
vote
1answer
26 views

A query regarding re-defining the ```\lim``` command in ```amsart```

I was trying to redefine the command \lim, but I was getting an error messege. The code was analogous to the following: \documentclass[oneside,10pt]{amsart} \usepackage[T1]{fontenc} \usepackage[utf8]{...
0
votes
0answers
20 views

Package flacards - newcommand

I'm using flacards, and every card is composed of, in the frontside a word with it's category behind it, and in the backside the translation and a sample phrase behind it. For instance \card{è \\ \...
7
votes
2answers
288 views

How to replace \not by \centernot?

I noticed that LaTeX places the slash created by \not weirdly, e.g. in \not\ni. Using \centernot from package centernot looks nice, but for reasons outside of this scope I have no control over the ...
1
vote
2answers
61 views

Memoir: indent \mainmatter in TOC and multiple newcommand instructions/arguments

I have two questions somewhat relating to the memoir table of contents, as both concern the same thing to me I hope it is alright if I group the two of them together, let me know if in the future I ...
0
votes
1answer
20 views

bad spacing between macro and real rendering [duplicate]

Here is a capture of the current rendering I get : I am obliged to set a "\," after the GC$_{\text{ph}}$ and WL to have a little spacing after these symbol to not interfer with classical ...
0
votes
1answer
24 views

Prepend text to Section but only include section number in ref

I prepended a text to subsection but I would like to only have the corresponding number if I use \ref{...} Text is prepended with: \renewcommand{\thesubsection}{Herleitung \arabic{subsection}} \...
1
vote
2answers
41 views

Doubt about the xlop package and new commands

I hope you are excellent. I am a basic education teacher and I am not very good at using LaTex, I would like to know how I could create a new command to compact the command that I use right now to do ...
2
votes
1answer
54 views

How put a custom-made symbol from newcommand into the range of setmathfont?

Following up on this question, I am trying to use a unicode character as a binary operator. The answer in the linked question helped me do this, but I am running into a second issue. I want to also ...
1
vote
1answer
52 views

Non-english Section numbering problem

I have the following code for numbering the section numbers in Bengali language. \makeatletter \def\bengalidigits#1{\expandafter\@bengali@digits #1@} \def\@bengali@digits#1{% \ifx @#1 \else \...
4
votes
1answer
60 views

Generate an error message when the result of a command is empty

I have the following sample code: \documentclass{article} \usepackage{etoolbox} \newcommand{\defineSpecies}[2]{\csdef{spec@#1}{#2}} \newrobustcmd{\spec}[1]{\csuse{spec@#1}} \defineSpecies{h2o}{H$_2$...
0
votes
1answer
24 views

Curious spacing while using variables with \newcommand [duplicate]

\documentclass[10pt]{article} \usepackage[default]{opensans} \usepackage[T1]{fontenc} \usepackage{xifthen} \newcommand{\cvAnrede}{Herr} \newcommand{\cvTitel}{Dr.} \newcommand{\cvVorname}{Max} \...
0
votes
1answer
73 views

Redefining format for \autoref for equations causes unwanted format for subequations

In order to be able to reference the equations in my thesis in the format like "Equation (2.2.3)" using the \autoref command I added the following lines in my preamble: \makeatletter \let\...
2
votes
0answers
91 views

Should users use \NewDocumentCommand in place of \newcommand in 2021?

It's eight years since someone asked Always use \NewDocumentCommand instead of \newcommand? and as I approach the chapter on defining new commands in my LaTeX book, I'm wondering if it makes sense for ...
0
votes
0answers
31 views

Is it safe to omit braces around the command name being defined with \newcommand or \renewcommand? [duplicate]

I see both type of coding style in use: \newcommand{\hello}{Hello, World} \newcommand\hello{Hello, World} My question: Is there any situation where removing the braces around the command name being ...
0
votes
1answer
44 views

Add dot after number of listing in list of listings

Hello does some of you know how to add leading dot after listing number in list of listings? Im using listings package and \lstlistoflistings command. Im using tocloft package to do it in list of ...
1
vote
1answer
71 views

How to change enumerate labels locally for one list?

I want to change list labels, but I don't want to do it globally. I want just this one special list have different formatting. Overleaf instruction is: The command must be placed in the preamble to ...
17
votes
3answers
866 views

How to define von Neumann natural numbers (newcommand, with for loop)?

How can I define a new command, \natset[1]{#1}, which gives an output as follows? (∅ = \varnothing); intended use is in math-mode, e.g. $\natset[1]{#1}$. The braces are the things one usually gets ...
0
votes
3answers
63 views

Customize new itemize environment

I work with the beamer template Heverlee that has the following setting for the itemize-command: \definecolor{pblue} {RGB}{49,130,189} %primary blue \setbeamercolor{item} {fg=pblue} \...
1
vote
1answer
72 views

Add a command which allows to color some words

I would like to define a command \defi which allows to color words with one color (not necessarily the color of the picture below) : to color the word matrice, I just want to type \defi{matrice}. ...
1
vote
1answer
55 views

How to create a command to write partial derivatives

Now I am writing a theorem in my partial differential equation course and it involves so many partial derivatives like $\frac{\partial f}{\partial u}, \frac{\partial u}{\partial x},\frac{\partial v}{\...
0
votes
0answers
20 views

LaTeX Never Finishes Compiling After Renewing a Command [duplicate]

I have a document that frequently uses the \vec command from the amsmath package. I decided I wanted to make all the vectors boldfaced, so I added the following \renewcommand: \renewcommand{\vec}[1]{\...
0
votes
0answers
11 views

Problem renewing \exists command [duplicate]

I find the \exists command always looks scrunched with the following letter. I'd like to put a little space after it. I have tried \renewcommand{\exists}{\exists\,} \renewcommand{\exists}{\...
3
votes
2answers
138 views

How can I define custom math shortcut signs like $?

I would like to have something like §§ ... §§ that could replace \begin{align*} ... \end{align*} in my documents. How can this be done? \documentclass{article} \begin{document} §§ x + 1 &= 0 §§...
0
votes
0answers
28 views

Redefine command chain

I've recently switched to To Times New Roman into my Latex report and I've noticed that bold greek letters are printed awfully when using commands like \bm{} or \boldsymbol{}. I've turned around the ...
0
votes
1answer
28 views

Subsubsection labels incorrectly starting at 2

This is my code: \documentclass[12pt]{article} \renewcommand{\thesubsection}{\thesection.\alph{subsection}} \renewcommand{\thesubsubsection}{\thesubsection.\roman{subsection}} \begin{document} ...
0
votes
1answer
44 views

Using the same algorithm twice with no new caption number

I'm trying to do something similar to "Using the same figure twice with no new number", but with the algorithm2e package. Therefore I wrote the following code. \newcommand{\repeatAlgoCaption}...
3
votes
1answer
65 views

Redefining longtable to add content before and after

I'm using Pandoc to generate markdown to LaTeX, and want to add some styling to every longtable. I have been successful in adding content before the table, but not after. \newcommand{\PreTable}{foo} \...
1
vote
1answer
33 views

TeX counter shared with \newtheorem [duplicate]

\renewcommand{\thesection}{\arabic{section}} \renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}} %%%%% \newtheorem{defi}{definition}[subsection] \newtheorem{defis}{definition}[defi] ...
3
votes
2answers
55 views

Redefine mathbbm to print a colored output

I need \mathbbm to print a colored output. I tried: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{xcolor} \usepackage{bbm} \let\oldmathbbm\mathbbm \def\mathbbm#1#{\mathbbmaux{#1}} \...