Skip to main content

Questions tagged [csname]

This tag is specific to the use of \csname ... \endcsname constructions, typically used to construct control sequences (macros) that are otherwise difficult to create using \<csname>.

3 votes
1 answer
84 views

Table Missing Values

I'm trying to improve my ability to read math and physics equations, so I borrowed this code from someone on GitHub. I'm a bit of a latex novice. I was having issues getting the document to build at ...
Jonathon Anderson's user avatar
3 votes
1 answer
41 views

Fontspec and \readline produce trailing blank symbol

I am using \readline to paste the contents of a plain text file to a LaTeX document, which works fine. This is what the plain text file looks like: This is the first line. This is the second line. ...
mto_19's user avatar
  • 133
1 vote
1 answer
65 views

How does one fully expand a macro between \csname and \encsname?

The best way to ask this question is to present two MWEs, one of which works and one of which does not. Naturally, I would like to get this into the second form, but I am at a loss as to what is ...
Mike Pugh's user avatar
  • 329
6 votes
3 answers
248 views

How to expand a command with \csname and \expandafter

I get it when I write: \expandafter\def\agent{Hello} \expandafter\def\expandafter\agent\expandafter{\agent World} \agent result: Hello World It doesn't work for me when I write: \expandafter\def\...
Juli's user avatar
  • 121
0 votes
1 answer
15 views

How can I use escapeinside within a minted environment with the bash lexer?

The escapeinside functionality doesn't work properly with the bash lexer. Is there any way to fix this? MWE: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[escapeinside=|...
OpenAI was the last straw's user avatar
2 votes
2 answers
64 views

Calling variables in latex via newcommands arguments

I want to make my life easier with some calculations in LaTex, therefore I define a compound specific variablecalled \compound1molarmass. I use \newcommand to call another function from chemmacros so ...
Hugel's user avatar
  • 23
2 votes
2 answers
115 views

How to pass an argument to a macro called with \csname

I have a macro that generates lists of random numbers and converts them into letters to print. I'd like to create another macro that prints those lists with intervening text. That is, if \first ...
CBaker's user avatar
  • 23
2 votes
1 answer
115 views

Understanding `\expandafter` when checking nested `\csname…\endcsname`

Please consider the following MWE, which is an excerpt from a much larger project. The scenario is to define a conditional \IfComp{<number>}{<defined>}{<undefined>} that queries, ...
Lupino's user avatar
  • 2,762
0 votes
0 answers
76 views

Extra Braces When \url Uses Variable

When using \url{} in the following example, it adds additional braces around the variable. So the code below renders: {google.com} - google.com Why is this happening, how can I avoid it? Is there a ...
matijahhh's user avatar
0 votes
1 answer
79 views

Doesn't "\csname" need contain "\0"?

On page 40 of The TeXbook, Conversely, you can go from a list of character tokens to a control sequence by saying ‘\csname\endcsname’. So \csname TeX\endcsname equals \TeX. However, \TeX contains ...
Y. zeng's user avatar
  • 2,105
3 votes
0 answers
68 views

Are there tricks for detecting whether a `\csname..\endcsname`-thingie went wrong and, if so, delivering additional messages explaining the issue?

For the sake of having expandable tokens expanded before stringification I sometimes combine \csname..\endcsname-expansion with \string as in \chardef\stopromannumeral=`\^^00 \edef\gobbleToPrefix{% \...
Ulrich Diez's user avatar
  • 29.7k
1 vote
3 answers
81 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
0 votes
1 answer
36 views

Cannot plot CSV with PGFPlotTable, Missing \endcsname inserted

Let's say I have this pretty standard CSV file: id,x0,y,sy,yhat,yerr,yrelerr,ychi2 0,-1,-1.083108355,0.075,-1.013608377,-0.069499978,0.068566894,0.85871057 1,-0.857142857,-0.625857469,0.075,-0....
jlandercy's user avatar
  • 195
0 votes
1 answer
82 views

Exercise 5.7 in TeX - define control sequences with grouping

I want to solve Exercise 5.7 in the TeXBook by Donald E. Knuth. Define control sequences **\beginthe**<block name> and **\endthe**<block name> that provide a “named” block structure. In ...
GarretW's user avatar
0 votes
2 answers
69 views

! Missing \endcsname inserted error when using \seq_map_pairwise_function:ccN

This question is related to Execute list of commands generated by pairing elements from two \clist s or \seq s. I am trying to perform a sequence of commands of the form \def\alpha {^^^^03b1} ...
Mike Pugh's user avatar
  • 329

15 30 50 per page
1
2 3 4 5
7