Tag Info

New answers tagged

1

As I mentioned in my comment, the exam document class can do this out of the box. In addition, it has many other features you may find useful when writing exams and has customization options if you do not like the default layout/style. Code For your basic MWE, the equivalent code is as follows: \documentclass[addpoints]{exam} \begin{document} ...


2

Faced with anything to do with lists, I reach for my etoolbox. The following has, perhaps, elements of overkill (mostly in the interests of customization); the core of the actual list-handling material is in \addqpoint and \printqlist; the rest is really designed to make the user-interface workable. In order to keep things together, I've commented the code ...


1

In TeX (as in M4) data structures are represented as non-evaluated treatments and looping is realised by binding the non-evaluated treatment to the appropriate procedure and evaluating the data structure. For instance, we define a list as in \def\kinglist{\\{Louis IX}\\{Louis X, dit le hutin}\\{Louis XI}} To process the three items of \kinglist we bind \\ ...


3

David has already explained why the nested \repeat command can't work and also why it's a bad idea to use the name \repeat. Here's a different definition, based on expl3: I'd say it's way easier, judge for yourself. \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \cs_set_eq:NN \xrepeat \prg_replicate:nn \ExplSyntaxOff \begin{document} ...


6

You get ! Missing = inserted for \ifnum. because \repeat has \ifnum#1>\z@ so #1 has to expand to a number, but it is \repeat{2}{1} which includes many non expandable constructs such as \@repeat, \relax and \advance. Also although unrelated to the error in this fragment, it is a very bad idea to redefine \repeat as it is part of the basic \loop ...


4

You can use coordinate inside a path to name the exact coordinates. You were naming the node below the desired coordinates. Code \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \coordinate (h) at (0, 3); \coordinate (O) at (0, 0); \draw (O) -- +(-3, 0); \draw[-latex] (O) -- +(3, 0) node[right, font = ...


3

According to pages 470-471 of the pgfplots documentation: Keep in mind that inside of an axis environment, all loop constructions (including custom loops, \foreach and \pgfplotsforeachungrouped) need to be handled with care: loop arguments can only be used in places where they are immediately evaluated; but pgfplots postpones the evaluation of many ...


6

One issue you currently have is trying to create a \frame inside another frame. Moreover, \frame takes an argument, which you're not supplying in a proper way. Here is the etoolbox implementation that inserts each item in the list on a separate frame: \documentclass{beamer} \usepackage{etoolbox} \makeatletter \newcommand\makeenumerate[1]{% ...



Top 50 recent answers are included