Questions tagged [renewcommand]

The tag has no usage guidance.

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

Pass parameters in the new command so that it can be utilized in the whole document

I want a define a new command so that once I pass the value as ANNEXURE-I it should be right aligned, bold, underlined, and the font should increase. Moreover, I want the whole document to be ...
user avatar
  • 53
0 votes
0 answers
16 views

Argument of \cvskill has an extra } when trying to override an existing command

I'm using the moderncv package which already defines the \cvskill command. I'm trying to override/redefine this command with \renewcommand: % ... % param 1: name of the skill / tech / etc. % param 2: ...
user avatar
  • 101
1 vote
1 answer
32 views

How to redefine the same command differently over multiple theorems

i was wondering if there was a way to renew the emph command for each new newtcbtheorem you define. I have the following code already, adapted from an older solution by user egreg. The goal is to ...
user avatar
1 vote
1 answer
43 views

Create new command for a specific font style

How can I make a new command of {\fontfamily{qcr}\selectfont <text here>} I have worked before with \renewcommand for mathematical formulas but I'm not sure how to do it with text formatting.
user avatar
3 votes
5 answers
605 views

Easy way to convert \command{x}{y} to \command{x,y}

This is certainly a duplicate but I cannot find a straightforward and simple conversion method. Is there a universal way to convert \command{x}{y} to \command{x,y} ? (The question is general, this is ...
user avatar
1 vote
2 answers
56 views

Use libertine math font just for the complexity package

I'm currrently using the complexity package, where I have defined a lot of new commands for complexity classes, and I'm writing my document using the libertine font. I want to use the regular math ...
user avatar
0 votes
1 answer
54 views

LaTeX Error: Command \authorname already defined. Or name \end... illegal, see p.192 of the manual

I have the following source main.tex whose content is empty excepted the first cover page : %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Masters/Doctoral Thesis % LaTeX Template % Version 2.5 (27/8/17)...
user avatar
0 votes
0 answers
28 views

Command to save all settings to get it back later

Is there a command which save all current settings in my document (like margin size for example) so that I can use it after I apply some changes? For example I would like to change some things in a ...
user avatar
  • 241
1 vote
0 answers
44 views

Create an enumerated list with dotfill after every item

I'm trying to achieve a enumerated list with a \dotfill after every item to create a 'fake ToC'. But what I'm currently ending up is the dots before the item, not afterwards. \usepackage{enumitem} \...
user avatar
  • 113
3 votes
2 answers
241 views

How can I renew the macro "\log" (from "log" to "\ell og")?

How can I renew the macro "\log" (from "log" to "\ell og")? Default function \log in line 1 I use renewcommand for \log: \renewcommand{\log}{\ell\text{og }} That shows ...
user avatar
0 votes
1 answer
53 views

If else command

Why is the below code not working? I tried also renewcommand instead of def. The counter/\setcounter does not provide the value of the width which is why I stopped using it. Any idea of how to fix ...
user avatar
0 votes
0 answers
32 views

Printing command in latex [duplicate]

I have installed new package which has a command "\mysteryCommand". It doesn't quite do what I'm looking for. How do I dump this command's actual text? I can find documentation and help me ...
user avatar
1 vote
1 answer
28 views

Make textsc insensitive to environment

I'm using textsc inside an equation that then appears in a Theorem environment. I want the text in textsc inside the equation to appear in regular font, not italics (which is enforced by the Theorem ...
user avatar
0 votes
0 answers
31 views

How to define *and* redefine in class file?

I'm creating a resume and have create my own custom resume class (doesn't everybody?). I have multiple positions that I want to typeset so I have something like this: \documentclass{mcv} \begin{...
user avatar
  • 9,552
0 votes
0 answers
219 views

a verb=xxx_== problem with newcommand - missing $ inserted

\documentclass[12pt,a4paper,UTF8, scheme = plain]{ctexrep} \usepackage{amsmath,enumerate} \usepackage{geometry} \usepackage{adjustbox} \usepackage{booktabs} \usepackage{fancyhdr} \usepackage{lastpage} ...
user avatar
  • 515
0 votes
1 answer
19 views

Acronym placement in text and period

I would like to define, an acronym that I can recycle in my text. E.g., \def\JB {\selectfont\texttt{J.~}-\texttt{Bond}}} The problem is that, In the beginning or in the middle of the sentence, I'd ...
user avatar
2 votes
1 answer
85 views

How to change an environment in its body

I have the below code. \documentclass{article} \newcounter{ex} \newenvironment{ex}{% \par\noindent\refstepcounter{ex}{\bfseries Ex \theex.\, } }{} \...
user avatar
0 votes
2 answers
57 views

How to apply contour for all content in the document output?

\documentclass[12pt]{book} \usepackage[letter, total={5in, 10in}]{geometry} \usepackage{amsfonts, amssymb, amsmath, amsthm} \usepackage[T1]{fontenc} \usepackage[outline]{contour} \usepackage{xcolor} ...
user avatar
3 votes
1 answer
45 views

Non integer number in setcounter (report document): \setcounter{figure}{1.14}

I'm wondering how to write a non integer number inside the setcounter command. I'm writing a report so the numbers of the figures are not 1, 2, 3, but 1.1, 1.2, 1.3 (in chapter 1). I tried the command ...
user avatar
0 votes
0 answers
41 views

Infinite loop redefining \chapter with \let

Q: Why does this cause an infinite loop? (Full code below.) Does let not do what I thought? \let \oldchapter \chapter \renewcommand \chapter [2] {\oldchapter{#2}} Using report as the base class, I ...
user avatar
0 votes
1 answer
32 views

Bibliography title prints strange asterisk (*) after I `renewcommand`-ed the `chapter` command in `report` class

I use report class for my work, and I renewed all the sectioning commands to my liking, including the chapter command, which apparently affects the way that biblatex prints the title of the ...
user avatar
4 votes
1 answer
194 views

Redefining \pause to do nothing

\documentclass{beamer} \renewcommand\pause{} \begin{document} \begin{frame} a \pause b \end{frame} \end{document} Expected output: a single page with "a b" in it. Actual result: LaTeX Error:...
user avatar
6 votes
4 answers
192 views

Wrapping a command (parametrically) - csname woes

I would like to "wrap" an existing command with another command. For example, suppose that there is one command \cmda I would like that each time this is called we end up executing: \...
user avatar
3 votes
1 answer
165 views

Redefine \texttt{} to allow underscore

I use underscore inside \texttt{} quite often to represent python functions, and I get quite tired of escaping every single underscore with \_. I tried the following to redefine the \texttt{} command ...
user avatar
0 votes
1 answer
41 views

Modifying chapterhead for non chapter uses

I am currently using the \documentclass{report} I want to obtain a look similar to the following, but without affecting the index or other thing: [Image_of_desired_chapter_style]1: Experiment: (...
user avatar
3 votes
3 answers
300 views

Clever Underlining

I'm using ulem package to perform clean underlining as advised here https://alexwlchan.net/2017/10/latex-underlines/ It works like a charm, but the line stays at the same thickness whatever the font ...
user avatar
0 votes
0 answers
21 views

Ref/ label problems with custom designed List of equations

Writing my thesis I needed to define a custom list of equations. The code works as expected to deliver what I need it to be. This is how I designed the list of equations ( Not my design, I had it from ...
user avatar
0 votes
1 answer
38 views

Minutes by latex: how to reduce space between parts article-class in the listoftopics (toc)?

I use \usepackage{minutes} to write a minute, by using article-class. The default style of the article-class I find it best! It looks very nice except for the large space in the list of topics. In ...
user avatar
0 votes
2 answers
39 views

Combine different commands into one using a conditional

I define the following commands \def\R{\mathbb{R}} \def\Rd{\R^d} \def\Rn{\R^n} Is it possible to combine these three commands into one using a conditional? As an example, I would like \Rx to output \...
user avatar
0 votes
2 answers
31 views

Changing template command to allow for two affiliations

I'm following a conference template and there is the command \author[orgN]{First A. Author} which allows to include the author name and its affiliation. I was asked by one of the co-authors to add a ...
user avatar
1 vote
1 answer
90 views

\renewcommand{\arraystretch}{1.3} makes ! LaTeX Error: \caption outside float in Rmarkdown

I'm writing my thesis and want to include several tables in Rmarkdown. The first table is long and includes several LaTeX symbols for regression parameters $\beta$. The rows seemed a bit squished so I ...
user avatar
2 votes
2 answers
86 views

Centering Heading and Adding Vertical Space within a \listoffigures Environment

Consider the code \documentclass{article} \usepackage{xcolor,graphicx} \usepackage{caption} \makeatletter \define@key{Gin}{color}{\def\Gin@color{#1}} \setlength{\fboxsep}{0pt}% Remove \fbox ...
user avatar
  • 5,285
2 votes
0 answers
42 views

allrunes changes default font slightly

I am trying to use a specific rune as a symbol in a document. I'm able to use the allrunes package to do so. The allrunes documentation specifically says that it does not change the default font of ...
user avatar
0 votes
0 answers
41 views

How can I '''\figurename'''bold?

I wish to rename \figurename the in my text. But when I use \renewcommand{\figurename}{\textbf{Figura: 1}} shows in text: Figura :1 :1. Why can I to solve it?
user avatar
1 vote
1 answer
87 views

\newcommand with an option for different outputs

I am creating a template for exams. I would like to use a \newcommand to create on one hand the exams with only the questions and space for the answers and on the other hand also the solutions. I have ...
user avatar
  • 942
1 vote
1 answer
66 views

Rename \maketitle to include affiliation

I have never used advanced tex macros before, so I am pretty new here. Please don't judge me too harshly! I need to modify the behaviour of the \maketitle command. I'd like to be able to add a custom ...
user avatar
  • 11
0 votes
1 answer
59 views

math note command

I have made two new commands for making what the first one (\mathnote) does, but with some changes. The new command (\mathnotee) is what I want, but is not working and I don't know why, I wante that ...
user avatar
1 vote
1 answer
87 views

change title color

I use this code to batch modify the title color of a large number of latex files \renewcommand{\title}[1]{\renewcommand{\@title}{\color{\@titlecolor}#1}} \newcommand{\@titlecolor}{black} \newcommand{\...
user avatar
  • 149
0 votes
1 answer
47 views

How can I avoid MnSymbol to redefine the bracket parenthesis?

I'm trying to save the definition of the square brackets since the package MnSymbol redefines it. I think the redefined ones are aesthetically ugly. I'm looking for a solution similar to this. A ...
user avatar
1 vote
1 answer
111 views

How to modify the author's color through \renewcommand

I retrieved the method \renewcommand MakeTitle to set the color of the title. \makeatletter \renewcommand{\title}[1]{\renewcommand{\@title}{\color{\@titlecolor}#1}} \newcommand{\@titlecolor}{red} \...
user avatar
  • 149
2 votes
1 answer
77 views

Defining a new tblr environment results in a Misplaced alignment error

By modifying the awesome-cv class with the following I'm redefining the cvskills environment using the tabularray package \NewEnviron{cvskills}{% \begin{tblr}[expand=\BODY]{ colspec={Q X}, } ...
user avatar
2 votes
1 answer
89 views

Defining a new \Vec command to use with the esvect package

The esvect package uses the command \vv{v} to write an arrowhead above the letter in its argument (i.e., a vector), and the command \vv*{v}{n} to write a vector v with a subscript n. I would like to ...
user avatar
  • 123
2 votes
2 answers
105 views

Problem with \newcommand and \renewcommand

I am trying to define a command called \vec{} that prints a bold and non-italic symbol in math environment. \renewcommand{\vec}[1]{\mathbf{#1}} usually works for me, but not in the documentclass ...
user avatar
  • 31
2 votes
1 answer
36 views

Conditionally formatting numbers using a \newcommand

I want to create a command the prints a number in red if its negative and green if it is positive. I have tried: \documentclass{article} \usepackage[dvipsnames]{xcolor} \usepackage{ifthen} \...
user avatar
0 votes
1 answer
41 views

Understand commands of a class file

I haven't much experience with TeX/LaTex and I am trying to write a CV based on this repository. Specifically, I am trying to understand how a LaTeX class file is written, and reproduce to a certain ...
user avatar
3 votes
2 answers
83 views

How to fix the size of variable-size operators

When using variable-size operators such as \prod, \sum, \bigcup, and \bigcap, their sizes are usually not quite predictable, which makes me pretty annoyed. I just want to make their sizes fixed ...
user avatar
  • 413
0 votes
0 answers
56 views

newcommand inside newcommand not working

I often use \newcommand inside another \newcommand, and it usually works well. But not this case: \documentclass[10pt]{article} \usepackage{amsmath} \begin{document} \bgroup \makeatletter \...
user avatar
1 vote
1 answer
45 views

Making Index Page Citations Bold without Obliterating "See{Another Indice}"

Previously, I had posted the question How to Display the Indice Page Numbers in Bold? and received a very fine answer, which has served me well. However, I have since discovered a conflict making ...
user avatar
  • 5,285
1 vote
2 answers
53 views

Can I temporarily redefine minipage so I can edit pages without commenting out each instance of minipage?

Update: Something went wrong! I thought the solution of Don Hosek worked, but when I tried it again I am getting the error: Undefined control sequence. l.3 \RenewDocumentEnvironment {minipage}{m} % ...
user avatar
  • 57
0 votes
1 answer
34 views

Section numbering using letters

How can I number sections using letters, starting from a specific letter? \renewcommand*{\thesection}{\Alph{section}} This will start from the letter A, but I want to start numbering from another ...
user avatar
  • 121