Tagged Questions
4
votes
1answer
30 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
...
2
votes
2answers
60 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 ...
3
votes
1answer
56 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 ...
1
vote
1answer
67 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
56 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 ...
1
vote
1answer
41 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
90 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
92 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 ...
8
votes
1answer
82 views
A question about a macro definition errors
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
109 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
318 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
95 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
191 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 ...
8
votes
2answers
639 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 ...
9
votes
2answers
139 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 ...
4
votes
2answers
109 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
77 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
640 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
256 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[] ...
0
votes
0answers
248 views
command definition outside \begingroup \endgroup pair not working [closed]
This MWE is from a real case where an error occurs (with a hint about WSF from suffix package, but below the error is different) with \globaldefs=1\relax in a \begingroup \endgroup pair, in order to ...
2
votes
1answer
301 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
352 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}
...
3
votes
2answers
594 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
137 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 ...
7
votes
2answers
280 views
Appending to Variables
The following code works:
\def \robble {robble}
\def \robbles {\robble\robble}
But the following but doesn't:
\def \robbles {robble}
\def \robbles {\robbles robble}
The overall goal is to get ...
0
votes
2answers
145 views
Mysteriously fails to compile when I comment a line
I set up a github repo with a not-so minimal working environment (sorry for that).
As the README at github says, uncommenting the following stupid line solves the problem and makes the ...
4
votes
1answer
133 views
Shortcut macro for tabularx environment
I'm trying to define a shortcut using \newcommand for setting up a table using the tabularx environment. The command seems to work fine when beginning the table:
\newcommand{\bt}{\begin{tabularx}}
...
2
votes
1answer
78 views
Diagnosing errors inside newcommands
When I need to use something repeatedly within a document, I make my own command. E.g.:
\newcommand{\notification}[2]{ % line 2
Hello #1, your #2 pie is ready. % line 3
} ...
3
votes
1answer
1k views
LaTeX algorithmic package: Undefined Control Sequence in for-Loop
I'm trying to specify an algorithm in pseudocode in a LaTeX document, but I'm having trouble with the for-Loop. My statement:
\for{$bin=0 to binCount$}
\item blablabla
\endfor
keeps on generating ...
2
votes
1answer
152 views
Why won't this macro work in a \caption?
I created a macro to easily shift into typewriter mode, ala markdown or fancyvrb's "short verbatim" command. It works everywhere but in \captions. In that case, TeX fails saying I've exceeded ...
11
votes
1answer
3k views
Error: Missing \begin{document}
I wanted to make a command that outputs a number in math mode. This is how my file looks like:
\documentclass{scrartcl}
%\usepackage{epsdice}
%\newcommand{dice}[1]{\epsdice{#1}}
...
4
votes
1answer
586 views
Error “Reconstruction failed” with soul package
I've got a problem with the soul package while adding a letter-spacing to a result of a command that is defined just like this:
\newcommand{\myCommand}{some text}
In the document I'd like to have ...
2
votes
1answer
567 views
Implementing “aside” environment for explaining details of calculation
I would like to have parts of the text set in smaller time with different indentation, and separated from the rest of the text visually (e.g. by horizontal rules). I would like to use this to set off ...
6
votes
2answers
279 views
In the verbatim environment, how can I display an 'if' statement I declared as '\ifcondition'?
I have declared a couple of if commands of the form
\newif\iffinal
\newif\ifsolutions
Now I want to write about it in the same document! So I want to write something like
\iffinal
(...)
...
8
votes
1answer
772 views
Cite in theorem environment argument
When I try to cite a book in such a way
\begin{theorem}[\cite[p.~90]{bibitem}]
Theorem body.
\end{theorem}
I've got an error because of multiple use of [ and ]. Is it possible to cite in such a way ...
5
votes
2answers
555 views
Centering and \MakeUppercase with linebreaks
I wish to make the list of authors show up as centered, uppercase and listed vertically on my titlepage. My documentclass contains a section like this
\begin{center}
...
...
23
votes
1answer
389 views
Is there a \die command?
Is there a command that generates the error or warning of my choice? I'm planning to put it in an \ifthenelse, so it can't be a syntax error.
4
votes
1answer
444 views
How can I set single spacing in todonotes?
Question
How can I \renewcommand{\todo} to give single spacing in the todonotes of an otherwise double spaced document?
What I have tried
The documentation (p. 11, section 1.8.6) suggests that ...
13
votes
1answer
596 views
How to patch a package
I have a document that uses symbols both from the marvosym package as well as the eurosym package. There are two commands that clash and I get an error message (due to \newcommand being used and ...
8
votes
2answers
567 views
“TeX capacity exceeded” because of a couple of raiseboxes in a \section?
In a package, I have the following command defined:
\newcommand\fkm{
\ensuremath{\mathrm{
\raisebox{-0.1ex}{\rotatebox{22}{f}}\!
\raisebox{0.2ex}{\rotatebox{-15} {k}}\!
...
14
votes
3answers
2k views
Is there any way to generate custom errors/warnings in LaTeX?
I want something like \ifmmode\else\GenerateWarning{The command \backslash uzuka is supported only in math mode.}\fi, which is supposed to generate a warning "The command \uzuka is supported only in ...


