8
votes
4answers
176 views

Tex capacity exceeded by using renewcommand to add arguments into a list

I was working on a small macro in which I create a \newcommand with two arguments. The second argument is just a name. I want to use this \newcommand more than once and at the end I would like to have ...
3
votes
1answer
20 views

How to properly expand an argument to the \url or \path macro?

In the following MSE: \documentclass{article} \usepackage{url} \newcommand{\rootDir}{\$ROOTDIR} \newcommand{\myDir}{my/dir} \newcommand{\makeFilePaths}[3]{% ...
4
votes
1answer
46 views

mtpro2: PARENS environment error

\documentclass[10pt,a4paper]{book} \usepackage[utf8x]{inputenc} \usepackage{ucs} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage[lite]{mtpro2} ...
1
vote
0answers
44 views

newcommand, section

I just received a new task in LaTex with a predefined structure and predefined commands. There was also the command \mysection. I think it shouldn't show the text of the section in the document, but ...
2
votes
0answers
43 views

What is the meaning of \+ in doxygen-generated latex?

When compiling a software reference manual with doxygen and latex output, I get the following error: ! Undefined control sequence. l.2 ... Modular System for Shelves and Coasts (M\+ ...
5
votes
3answers
178 views

\newcommand for tabular entries using keyval

I am trying to define a command for tabular entries using keyval. \documentclass{article} \usepackage{keyval} \makeatletter \define@key{tabularEntryKeys}{a}[\dots]{#1 & } ...
0
votes
2answers
78 views

! File ended while scanning use of \@xs@testcase

my script produces this error: Runaway argument? \section *{Serumnatrium} \par \ib {Zweck}{ \el { * Wasserverteilung *\ETC. ! File ended while scanning use of \@xs@testcase. <inserted text> ...
9
votes
2answers
111 views

Error when using defs inside a macro to write a row in a table

For the following MWE \documentclass{article} \newcommand{\cmd}[5]{% \def\tA{#1}% \def\tB{#2}% \def\tC{#3}% \def\tD{#4}% \def\tE{#5}% \tA & \tB & \tC & \tD & \tE \\ } ...
3
votes
0answers
85 views

pdflatex: How to automatically quit on compile error?

See also this question on Reddit. I want to automate running pdflatex over and over with make and guard. However, when pdflatex encounters a syntax error, it hangs, preventing guard from being able ...
2
votes
1answer
65 views

Trouble including graphics from csv file into Pgftable, commands are dissapearing (local maybe?)

I've been trying to add eps graphics with the filename in a csv file. Take a look at the CSV to get an idea of what I mean: ...
4
votes
2answers
116 views

How to deal with macro expansion and 'TeX capacity exceeded' when using write18?

This issue is driving me nuts. Ever since the friendly and knowledgeable people here on tex SE have guided me to doing multiple string replacements the proper way, I've been trying to incorporate that ...
1
vote
0answers
34 views

What's the shortest input that makes TeX and/or TeX-based systems go into a loop? [duplicate]

The following 12-character input causes TeX to go into a loop. \def\x{\x}\x It won't crash, it won't produce an error message, it'll just sit there for ever, trying to compile the document (but not ...
4
votes
2answers
136 views

\renewcommand for \forall to add a parameter

Hi I'm trying to redefine the \forall command so that it accepts an argument instead of using the regular juxtaposition. What it looks like at the moment is ...
4
votes
2answers
182 views

TeX capacity exceeded in Table of Contents due to macro

I'm working on a macro that when given Hello will make a chapter named hello, and number it like this: 1 - Hello, with the 1 - inside the margins. I also want it to automatically label the chapter by ...
14
votes
1answer
140 views

How can I wipe TeX's memory of a user-defined control sequence?

I know I can redefine a control sequence to be empty or \relax, as in my example below. However, doing so doesn't prevent one from using that control sequence , because it is still defined. To add ...
6
votes
2answers
54 views

How to make a family of related optional-arg macros reliable

I have some working, but unreliable \def magic I use to reduce boilerplate regarding mathematical indices. (This is in LaTeX, but I couldn't think of a way to do it using newcommand). \makeatletter ...
8
votes
1answer
113 views

Undefined Macro in Package xstring

I have a very basic problem. I am trying to use the xstring package in a Latex document and I keep getting the following error message for an undefined control sequence: (c:/Program Files ...
6
votes
1answer
62 views

My attempt to local redefine a command is failing and not sure why

I want to decorate some text and then reprint it undecorated. This is the code that I was using to do this. \documentclass{article} \usepackage{xcolor} \makeatletter ...
1
vote
1answer
44 views

about newcommand [duplicate]

I have trying to use new command to represent math, and this is what I type in: \\ \newcommand\fpi2[2][\pi][2]{frac{#1}{#2}}\\ \newcommand\mylim[2][x]{lim_{#1\to #2}} I'm trying to create a new ...
-1
votes
1answer
763 views

\newcommand in class - undefined control sequence

I'm trying to write a class based on article.cls and I'm having some trouble with \newcommand. Here go the complete files. Class file \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{NITclsD} ...
0
votes
1answer
986 views

Undefined control sequence argument [closed]

\begin{algorithm} \SetKwData{Candidates}{candidates} \SetKwData{Links}{links} \SetKwData{Visited}{visited} \SetKwData{URL}{URL} \SetKwData{TraversalDepth}{traversalDepth} ...
7
votes
1answer
127 views

How do I use commands within tabular definition?

Using commands within tabular definition result in error ! Missing $ inserted. In this case, it is the \, that causes problems when calling the custom command. Same commands work fine outside tabular ...
9
votes
3answers
148 views

Problem with ^^<HEX>

I have small problem with ^^<HEX>. If I have a <HEX> part of the ^^<HEX> in the macro \def\attemp{<HEX>}, I cannot write ^^<HEX> as ^^\attempt or ...
2
votes
1answer
397 views

'Undefined control sequence \setkomavar'

I ran into the error: 'Undefined control sequence l.12 \setkomavar{subject}{Regarding: Code 123.456}' My document preamble looks like this: \documentclass{letter} \usepackage{hyperref} ...
6
votes
2answers
119 views

Problem with newly defined command and special chars

I have the following problem. In my document, I defined a new command to save a few chars \renewcommand{\r}{r_\mathrm{max}} Additionally, since it is Swedish, it makes use of the special char å, ...
4
votes
1answer
149 views

Errors in passing a previously concatenated string to foreach

Motivation While attempting to answer Pie chart with values as angles not percent, I stucked on passing a string to a foreach. The context To makes things clear, I briefly introduce the context. ...
2
votes
2answers
135 views

Multi-line text retrieved from file via \input, within a newcommand declaration, passing newly declared command as argument of standard letter class

I have put together a minimum working example consisting of a number of files mwe.tex % instance of personal letter address.tex % full address of individual being addressed in mwe.tex ...
4
votes
1answer
223 views

Use of \cals doesn't match its definition \calscommand

The following minimal working example employs a cals table in the document environment and works fine: \documentclass{article} %document encoding \usepackage[utf8]{inputenc} %geometry ...
3
votes
2answers
316 views

Undefined control sequence \pgfmath@

Why does the following code give me this error message? Error ERROR: Undefined control sequence. --- TeX said --- \pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@ l.28 \draw ...
4
votes
1answer
171 views

A list of pairs in pgfkeys

Having learnt a lot about the pgfkeys package as a result of my last question, I'm now trying to do some more adventurous things. Let's say I have a command called \blob, whose value is the ...
4
votes
1answer
2k views

Command \* already defined … see p.192 of the manual

My code had: \newtheorem*{theI}{Thesis I} And it gives me the error: Command \* already defined. Or name \end... illegal, see p.192 of the manual. 1.16 \newtheorem*{theI}{ ...
5
votes
2answers
242 views

Double subscript error with \newcommand?

Disclaimer: I know of Defining a newcommand with sub- or superscript and avoiding "double subscript" error but this only gives a work-around, but no explanation to my question. Here's a ...
2
votes
1answer
90 views

import in \newcommand in my package produces an error

I have written and installed my own package gym.sty. In that package I defined \newcommand{\loadgym}{\import{sagegym}} since I need to execute some commands after \begin{document} for the package ...
3
votes
1answer
120 views

LaTeX report wrong error line when enclosing thing within a macro

I like to write my LaTeX C++ style 1 \mydisplay 2 { 3 \BoomUndefinedMacro \\ 4 x + 1 = 2 5 } But then LaTeX, LaTeX say that the error is in line 5, instead of line 3. This is not useful, ...
2
votes
2answers
179 views

Error with \DeclareRobustCommand, \usepackage{hyperref,xcolor} and \usepackage{graphicx}

In order to tie capital letters with a capital hyphen, I created a command \DeclareRobustCommand{\capitalhyphen}{\raisebox{0.24ex}{\resizebox{0.4em}{\height}{-}}\kern-0.07em} which uses graphicx ...
9
votes
1answer
170 views

A question about a macro definition error

Given: \documentclass{minimal} \newcommand{\emrule}[1]{\rule[4pt]{#1em}{0.2pt}} \newcommand{\endash}{\emrule{.5}} \begin{document} 2000\endash2013 \end{document} I get: ! LaTeX Error: Command ...
6
votes
1answer
222 views

“No room for a new \read” with writing a journal

I'm fairly new to TeX and learning as I go. I am trying to keep a journal in LaTeX. I'm using the solution provided at Using LaTeX to keep a diary . It's essentially a setup where each day's entry is ...
3
votes
1answer
1k views

Undefined control sequence on legitimate LyX macro

I'm trying to define a LyX macro, Insert -> Math -> Macro on the menus. It's a very simple macro. Source code under View -> View Source: \global\long\def\Z{\mathbb{Z}} The file compiles nicely if I ...
0
votes
1answer
146 views

\newline causing TeX capacity exceeded error

I'm rigging up some code so that I get the references cited on a slide displayed directly in the footline of my beamer presentation, and I've run into an error that mystifies me. The code I have ...
2
votes
1answer
416 views

xelatex memory problem [closed]

I have problem while running xelatex: TeX capacity exceeded, sorry [main memory size=1500000]. I tried increasing memory limits in texmf.cnf (also ran fmtutil-sys), but I hit maximum allowed and it ...
11
votes
2answers
2k views

Misplaced \omit. \multispan with \newcommand

I'm trying to build my own cookbook-style, which has an ingredient makro. Sometimes the ingredients should be seperated and have a headline, so I tryed with an optional argument. A minumum example ...
10
votes
2answers
291 views

Multicolumn within a newcommand error

I am new to writing packages and am coming across an error that I can't unravel, I would appreciate any help that you can provide. I am writing a few macros which are meant to be used within a tabular ...
5
votes
2answers
213 views

How can I define a macro that adds a row to a table that has not yet been printed?

I want to generate a list of technical abbreviations and acronyms that I use. Currently, I'm defining all acronyms with a macro I have designed. Now, I want the macro to call another macro, called ...
0
votes
1answer
113 views

Possible package missing [closed]

I started using LaTeX yesterday and there's something I can't figure out: I've noticed that I don't have some commands, for example right now I'm trying to use \vphantom and \phantom, but when I type ...
7
votes
3answers
2k views

Passing arguments to nested newcommands

I thought that doubling hashes was sufficient to pass arguments to nested \newcommand. \newcommand{\notice}[1]{ \vspace{10px} \textbf{#1:} \begin{quotation} ##1 \end{quotation}} ...
6
votes
4answers
549 views

Illegal parameter number with \docsvlist

I'm trying to define a macro that take as an input a CSV list and create an item list. etoolbox comes just handy for this and the macro I'm using is \begin{itemize} \renewcommand*{\do}[1]{\item[] ...
2
votes
1answer
451 views

Why is LaTeX refusing to create a new page to place content?

Ihave stumbled upon strange behavior (at least for me). I am generating a document composed of a set of blank framed boxes, each with a text attached above, and it will always be most likely necessary ...
6
votes
1answer
701 views

Using a macro as value of addtotoc in \includepdf

I would like to include pages from an external PDF file into my document, using the pdfpages package. The following works for me: \documentclass{article} \usepackage{pdfpages} \begin{document} ...
4
votes
2answers
2k views

Error with \newcommand and \section

I'm trying to typeset an article. In the preamble, I defined these two things: \newcommand{\leftexp}[2]{{\vphantom{#2}}^{#1}{#2}} \newcommand{\hr}{\leftexp{*}{\mathbb{R}}} However, when I try to ...
0
votes
1answer
181 views

Getting an error when trying to use 'xstring' commands in my macro

When I try to compile the minimal example below, I get an error: ! Argument of \@xs@StrLeft has an extra }. <inserted text> \par l.33 \setInSCCF{abcdef} If I switch the ...