Questions tagged [definition]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
62 views

Defining an Em Dash with Length Greater Than the Cabin Default

I have noticed that the length of an em dash is not always uniform, depending upon the font being used. Consider the following code which defines an em dash: \documentclass{book} \usepackage[T1]{...
  • 5,757
5 votes
1 answer
91 views

Using \def in csv range

I would like to use a predefined list of numbers in the csvsimple-l3 range option. The MWE will explain better: \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage{csvsimple-l3} \...
  • 323
-1 votes
0 answers
50 views

Renaming hyphenated names in def, newcommand and newenvironment

I am writing a package galex where commands use the package name together with a hyphen, thus \galex\-pipe, \galex\-divid and Hyphenated names are used in \def, \newcommand, \newenvironment, with \- ...
  • 67
0 votes
1 answer
53 views

Simple boxes for definitions, theorems, lemmas, and proofs with tcolorbox

I would like to have something that looks like this: I don't want to add Box 1 to the definition environment each time. And this also goes for properties, lemmas, and theorems of the environment \...
  • 4,200
8 votes
3 answers
426 views

How to create \in-symbol with underbar that has rounded edges and correct vertical spacing?

The aim is to create a new symbol \ineq. The appearence of \ineq would be to \in as \subseteq is to \subset. Output from attempt at making \ineq: Problems with attempt in decreasing order of ...
1 vote
1 answer
94 views

Why does this command defined with \NewDocumentCommand behave differently from \def inside tabular column specification?

On the first glance \NewDocumentCommand{\foo}{m}{#1} and \def\foo#1{#1} should be identical and in most scenarios they actually are, but when the argument is not explicitly follows \foo, the command ...
  • 3,737
4 votes
1 answer
195 views

How to limit scope of microtype's letterspacing command \textls to non-math environment?

Package microtype has the command \textls to manipulate letterspacing in an ad hoc manner. While its use is usually frowned upon by typographists, according to microtype's user manual (p 23 footnote), ...
4 votes
3 answers
210 views

How would I define a character to start and end an environment in plain TeX?

In TeX, starting and ending math mode is done with the same symbol, namely $. Suppose I would like to start and end an environment like this, perhaps with the text italic, using the character *, as ...
  • 545
0 votes
1 answer
49 views

Declare new command to denote the condition with additional settings

Can someone tell me how to set the parameters of a declared new command similar to how it is set in the TikZ package? More specifically, I would like to declare a function \condVert{} that sets a ...
  • 97
2 votes
1 answer
72 views

Changing theoremstyle

I wanted to change the way "Definition 1.1" is displayed. Specifically, I want to make the name of the definition (green box in attached image) appear in bold (which I know I could do with \...
  • 35
1 vote
3 answers
69 views

How to define a LaTeX shorthand for nested indentation "contexts"

I am looking for a convenient way to code nestable "contexts" whose extents are displayed through indentation. Each context consists of a sequence of "statements" (i.e. lines) and/...
  • 801
0 votes
1 answer
54 views

Why is this \def failing?

This is just a small snippet, for debugging: \documentclass[12pt]{article} \usepackage{amsmath} \def\block#1{\begin{array}{ll}\ &{#1}\end{array}} \def\sub#1#2{\text{#1}:\\\block{#2}} \begin{...
  • 801
2 votes
2 answers
248 views

Defining a new command, the output of which depends on an internal parameter

Maybe someone can tell me how to define a new command in \LaTeX, which can take one mandatory value and another optional value (parameter) as input. In this case, depending on the value of the ...
  • 97
0 votes
0 answers
20 views

List of Definitions derived from \begin{definitions}

I have a bunch of definitions in my document, which I created using the following structure: \begin{definition}[Term X] \label{def:term-x} What a great term \end{definition} Now, I want to show a ...
2 votes
2 answers
55 views

Generate command definitions that take arguments

I want to define a command \NewSmartOp such that: \NewSmartOp \MYOP \myop would produce the following code (or anything equivalent): \makeatletter \def\MYOP{\@ifstar\MYOP@star\MYOP@nostar} \def\...
  • 216
2 votes
1 answer
260 views

Why double curly brackets in `\long\def\bold#1{{\bf#1}}`

I'm reading The TeXbook by Knuth. Page 205 has If you actually want a control sequence to allow arguments with \par tokens, you can define it to be a “long” macro by saying ‘\long’ just before ‘\def’. ...
  • 449
0 votes
2 answers
95 views

Constructing \definition in latex

Does there exist \begin{definition} in latex? And how can I construct one? Is everything derived from \newtheorem command.
  • 213
0 votes
0 answers
31 views

Enumerating theorems and examples

I have an issue when writing an article. The process of enumerating definitions, algorithms, figures and sections are ok, but when I enumerate theorems and examples, they follow in order as if they ...
0 votes
2 answers
211 views

How to adapt \crefrangelabelformat to subexample formatting?

I would like to be able to redefine something which is supposed to be defined in the preamble. In this example and in relation to this question : Cross-referencing: more sublevels, and presets, I want ...
0 votes
0 answers
65 views

! Missing \endcsname inserted . Problem with \def

I am trying to compile and OLD LaTex file from my PhD thesis, using PDFLatex. However, now it does not compile anymore. It keep me giving this error. Below I give a MWE: \documentclass[12pt,...
1 vote
1 answer
202 views

Declare math operator

I'm trying to create a command with which to write \declaremathoperator{ABC} to get \def\ABC{\operatorname{ABC}} I tried to implement it like \def\declaremathoperator#1 { \def\csname #1\endcsname{\...
2 votes
1 answer
78 views

new, renew, provide and declare commands naming conventions

When defining new macros (or more general/abstract: resources), we have to consider the case of the macro already being defined. xparse handles this (imho) quite nicely, by using the four prefixes \...
1 vote
1 answer
68 views

Huge set definition in latex

I am trying to write a set definition like the picture below in latex: How can I make such a clean set definition?
1 vote
1 answer
64 views

Writing (nested) argument specifier to aux file

This is a follow-up to this question: where I explained that I want to write some definitions into an aux file and use hooks to achieve this. Refer to this question for context why I want to do the ...
0 votes
0 answers
25 views

How to add a code in `\tcolorboxenvironment{definition}` to change the color of "Definition" black to red?

I want to change the color of "Definition" from black to red. For example, the "Definition 8.2.8 (stochastic processes)" is black. But I want to replace it by red color. My code ...
  • 185
2 votes
1 answer
53 views

On Stacking Asterisks to Form Chapter Dividers with Stackengine

This question is an extension of the earlier post Best Way to Produce This Chapter Divider Image Consider the code: \documentclass{book} \usepackage{stackengine} \usepackage{graphicx} \def\asterisks{\...
  • 5,757
0 votes
2 answers
89 views

Best Way to Produce This Chapter Divider Image

I am currently working on a document into which I hope to incorporate this chapter divider: QUESTION: Does LaTeX have an ornament that resembles this triangular group of asterisks, or must it be ...
  • 5,757
4 votes
1 answer
710 views

How is TeX syntactically organised?

I'm just starting out on TeX, and I wanted to find a directory or table of how TeX is arranged in syntax. I can make educated guesses, but I figured I'd be better self taught if I understood how ...
  • 159
1 vote
0 answers
52 views

Save environment declared with \NewDocumentEnvironment to redefine it

I have some environment declared with \NewDocumentEnvironment, lets call it oldenv which I want to redefine in another package, to tweak it a little bit. However, in the redefinition I want to make ...
0 votes
4 answers
135 views

Define global function within \begingroup ... \endgroup

I have a command that accepts optional arguments as key-value pairs, handled by the l3keys package. I use \begingroup and \endgroup to \keys_set:nn the keys in order to process set options only for ...
0 votes
0 answers
37 views

Chapter with image and format section

I would like to get chapters with image, section with dot line under and left box cover, def with shadow box and upper + lower straight lines for every proof as in the picture. Could you please help ...
1 vote
1 answer
53 views

MetaPost vardef: how to declare a variable of type 'expr'?

I want to make a macro swap: vardef swap(expr a, b) = save tmp; expr tmp; tmp := a; a := b; b := tmp; enddef; But there is an error when compilating: ! A statement can't begin with `expr'. I ...
  • 515
1 vote
0 answers
49 views

Continued minipage geometry

I need to motivate certain definition, and to do that I used minipage environment for the motivation part. However when the length of the motivation is more the section doesn't continue to next page ...
  • 631
4 votes
4 answers
256 views

Same command with two different argument-separators

I have the following code \makeatletter \def\ip#1{\@ip#1\relax} \def\@ip#1|#2\relax{\langle#1|#2\rangle} \makeatother When in the document one finds $\ip{2|3}$ he gets something like <2|3>. ...
3 votes
1 answer
175 views

How can I achieve this theorem style (a very common one)?

Consider: How can I achieve this style for definitions, theorems, ...? I only know the standard or "plain" style (bold for header, italics for body) for theorem-like environments.
  • 243
0 votes
1 answer
22 views

Why do nameref package zap the ending dot in \label and how to avoid this zap locally?

So, I'm hacking something related to nameref and during the hacking, I find on the beginning of page 3 of the nameref manual on my computer (dated 2016/05/21) that We redefine \label so that it also ...
0 votes
0 answers
80 views

Different between \def and \long\def and where to use [duplicate]

Please excuse if my question is silly.... May I know what's the difference between \def and \long\def and where to use \long\def Thanks....
  • 11.3k
1 vote
0 answers
77 views

What is the equivalent PreTeXt equivalent of \def in Latex? [closed]

I am using Latex to write my course syllabi and I want to switch to PreTeXt does anyone know what is the equivalent of \def in PreTeXt? For example, in my syllabi I use the following: \def\officehours{...
3 votes
1 answer
69 views

\def allowing multiple formats

For example, I want to define this \def\normal(#1,#2){\mathcal N\left( #1, #2 \right)} which makes it convenient to write a normal distribution (e.g., \normal(0,1) gives N(0,1)). However, I have been ...
3 votes
1 answer
59 views

Newly-Defined Scaled Bullet Point Not Being Scaled When Invoking New Definition

Consider the code \documentclass{book} \usepackage{xcolor} \usepackage{scalefnt} \usepackage{amssymb} \newcommand{\m}{\textcolor{blue}{{\scalefont{1.00}{\maltese}}}} \newcommand{\M}{\textcolor{blue}{...
  • 5,757
1 vote
1 answer
29 views

math mode print as normal mode when a command is fragile

i have created a macro, when the command in math mode print in bold, if it is outside math it should print in color \def\mathtest{\ifmmode ***math mode***\else\textcolor{red}{***text mode***}\fi} ...
  • 1,814
0 votes
1 answer
120 views

Definition function in LaTeX Tcolorboxed Poster

I'd like to create a \newtcbtheorem[number within=subsection]{definition}{Definition}{...} like this: "Title of the definition" and "Statement of the definition" must be manually ...
  • 925
3 votes
1 answer
197 views

\let and \def differentiation in D. Knuth's commentary (plain TeX)

In the The TeX Book, in apendix B, I read \def\obeyspaces{\catcode`\ =\active} {\obeyspaces\global\let =\space} {% \catcode`\^^M=\active % these lines must end with ‘%’ \gdef\obeylines{\catcode`\^^M=\...
1 vote
3 answers
112 views

LaTeX3 - Test string equality + Star version

I'm looking for some good advice on switching from (La)TeX to LaTeX3 Here is the first questions corresponding to the toy code below. What is a good way to manage an optional argument with LaTeX3? ...
  • 11.6k
1 vote
0 answers
39 views

Determining the RGB Definitions of Modified Colors in LaTeX [duplicate]

After defining certain colors and modifying them as the following code indicates, I then would like to determine the equivalent RGB definitions of the modified colors. For example, \documentclass{...
  • 5,757
1 vote
4 answers
144 views

Failing with TeX expansion

I'm trying to achieve a (seemingly simple) thing. I'd like to define a custom command \Symbol that receives a single parameter and prints that parameter. In addition, I'd like to have another series ...
  • 175
4 votes
2 answers
99 views

\NewDocumentCommand without xparse

I noticed that I can use \NewDocumentCommand without loading xparse. Why is that? How universal is that? And where can I read more about this? (My search terms always pointed to xparse.) \...
  • 3,405
0 votes
1 answer
133 views

Adjust the code to get TikTok symbol

This question it is related to this. Considering the link of my answer where there are the conditions to have the tiktok symbol https://github.com/liweitianux/resume/blob/master/fontawesome5/...
  • 46.9k
0 votes
1 answer
41 views

Read out (and edit) data from a table with def, xdef, let etc. (by using a pgf-loop and pgfplotstable)

If I read out from a table with \def, say \pgfplotstablegetelem{\row}{No}\of{\mytable} \def\No{\pgfplotsretval} it becomes wrong. By using \xdef \pgfplotstablegetelem{\row}{No}\of{\mytable} \xdef\No{\...
  • 6,357
5 votes
4 answers
110 views

Store the expanded version of a macro into another macro in the plain format

I wrote the following macro that prints a range of numbers separated by commas: \newcount\tmpnum \def\range#1#2#3{\tmpnum=#2 \loop\the\tmpnum\advance\tmpnum by #1 \ifnum\tmpnum<#3,\...
  • 2,529