Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 17200

{macros} is for questions specifically concerning TeX's macro processor. Note that, because TeX uses macros ubiquitously, most questions about code that uses macros are not looking for information about how macros work, and so are not appropriate for this tag.

2 votes
2 answers
324 views

Listing in a command error: Text dropped after begin of listing on input line

While I wanted to test some alignment options to ask another question regarding to listings, I have encountered a problem that I was not expecting. Consider the following code: % Preamble \documentc …
Vincent's user avatar
  • 5,327
2 votes
1 answer
168 views

Customizable pagestyle with options using DeclarePageStyleByLayers

Consider the following code: \documentclass{article} \usepackage{calc} \usepackage{lipsum} \usepackage{xcolor} \usepackage{scrlayer} \newcommand{\headerheight}{2cm} \newcommand{\headertext}{\Huge\te …
Vincent's user avatar
  • 5,327
0 votes
1 answer
22 views

Branch on a pgfopts boolean choice inside a newcommand?

Consider the following code for a class that relies on pgfopts for option management: % CLASS \NeedsTeXFormat{LaTeX2e}[1994/06/01] \ProvidesClass{myclass}[2022/10/11] \LoadClass{standalone} \makeatlet …
Vincent's user avatar
  • 5,327
4 votes
3 answers
60 views

Command gobbling extra letters not working when passed another command

On another topic, I was given the following command as an answer: it takes either a two letter font shape (sc, it...) or a full version (scshape, itshape...) to set the corresponding font shape. \docu …
Vincent's user avatar
  • 5,327
2 votes
1 answer
927 views

Local variable to a package

I am defining my own latex package mypackage.sty. How to define a local command such that: mycommand If mycommand is already defined elsewhere it will be locally redefined just inside the package I …
Vincent's user avatar
  • 5,327
1 vote
1 answer
894 views

Define an environment from tcbhighmath

Let's assume that I have defined very carefully the parameters of the highlight math style from the tcolorbox package. I would like to define an environment \newenvironment{equationbox}{% \begin …
Vincent's user avatar
  • 5,327
1 vote
2 answers
36 views

Using string to process a macro name using listofitems seems to fail

I am trying to process the name of a command using listofitems, but when I am using \string to convert that command it does not behave the way I think it would behave. Here is a code to illustrate: \d …
Vincent's user avatar
  • 5,327
4 votes
2 answers
65 views

How to robustly test if a macro has not been set yet via pgfkeys?

I am trying to define a newcommand \ifempty that takes three parameters: A macro that has been tied to a pgfkey via /.store in OR /.estore in What to do in case this macro has not been set yet (is em …
Vincent's user avatar
  • 5,327
2 votes
2 answers
90 views

Convert a macro name to pgfkey name

Let's consider a macro name of the form \first@second. I would like to write a command that would convert the name of the macro to pgfkey name of the form /first/second so that the following approache …
Vincent's user avatar
  • 5,327
1 vote
1 answer
49 views

Comparison not working when the variable is stored in a macro?

I am trying to branch of font size and the following is not working as I would expect: \def\tinyfont{tiny} \def\scriptfont{scriptsize} \newcommand{\setfontsize}[1]{% \def\currentsize{#1}% \ifx …
Vincent's user avatar
  • 5,327
6 votes
2 answers
344 views

if_exist macros in LaTeX 3: what are they doing if they do not check the type of things they...

In the documentation of interface3, for several macros with the pattern xxxx_if_exist for xxxx being bool, str, seq and many others the following appear: Tests whether the <boolean> is currently defined …
Vincent's user avatar
  • 5,327
3 votes
1 answer
137 views

Passing formatting options in pgfkeys using pgfopts

I am trying to design packages and handle package options using pgfkeys through the pgfopts package. However when an option include a formatting command, the whole thing fail and I don't get the expec …
Vincent's user avatar
  • 5,327
4 votes
1 answer
299 views

Length operation within a newtcblisting

Consider the following code: \documentclass[10pt,letterpaper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{calc} \usepackage{tikz} \usepackage{ …
Vincent's user avatar
  • 5,327
1 vote
3 answers
55 views

Branch over number of characters of an argument provided to a macro

I currently have the following command: \newcommand*{\setfontshape}[1]{\@ifnotmtarg{#1}{\csname#1shape\endcsname}} that helps me produce the command: \scshape from text sc. I would like to modify my …
Vincent's user avatar
  • 5,327
5 votes
4 answers
310 views

An expandable command that adds a string to an argument if the string is missing

I would like to write and expandable command which adds a string S1 at the beginning of another string S2 if S2 does not start with S1 in order to ensure that my string always start by S1. I currently …
Vincent's user avatar
  • 5,327

15 30 50 per page