Tag Info

New answers tagged

2

You can do it by yourself using titlepage. Adjust the values in all \vspace{<value>} as suited by yourself. \documentclass{report} \begin{document} \begin{titlepage} \centering {\huge This is the title of your thesis This is the title of your thesis This is the title of your thesis} \vspace{1cm} by \vspace{1cm} {\large ...


5

When you call \do{pl}, here's what happens: \expandafter\newcommand\csname oldglspl\endcsname\csname glspl\endcsname \expandafter\renewcommandx\csname glspl\endcsname[2][2]% \csname oldglspl\endcsname{#1}\index{#1#2} The first \expandafter expands \csname, so we get \newcommand\oldglspl\csname glspl\endcsname \expandafter\renewcommandx\csname ...


0

You need to move \begin{document} to immediately after \makeindex. However I could not do a complete compile as you did not provide the glossaryDefs.tex file. MWE issue.


12

With LuaTeX you can use the script language Lua: \documentclass{article} \usepackage{luacode} \begin{luacode} function permute(n) local tab = {} for i = 1, n do tab[i] = i end for i = 1, n do local j = math.random(i, n) tab[i], tab[j] = tab[j], tab[i] end for i = 1, n do tex.print("\\shortstack{"..i.."\\\\"..tostring(tab[i]).."} ") ...


8

Here's an implementation of the Knuth shuffle algorithm with expl3. \documentclass{article} \usepackage{amsmath,xparse} \input{random} \ExplSyntaxOn \cs_new_eq:NN \knuthshuffle_get_random:Nnn \setrannum \tl_new:N \l_knuthshuffle_tempa_tl \tl_new:N \l_knuthshuffle_tempb_tl \int_new:N \l_knuthshuffle_random_int \prop_new:N \l_knuthshuffle_newperm_prop ...


2

You can do this with two counters, one inside the \addtomytablines command, and one for the main loop. (I don't fully understand why.) I took the liberty of cleaning up your code and writing it in LaTeX. \documentclass{article} \newtoks\tablines \def\addtomytablines#1{\tablines\expandafter{\the\tablines#1}} \newcounter{row} \newcounter{loop} ...


3

You have to expand the row number as far as you can before adding it to the \tablines token list. Here's one way of achieving that: \documentclass{article} \newcounter{it} \newcounter{tot} \newtoks\tablines \newcommand{\addtomytablines}[1]{\tablines\expandafter{\the\tablines#1}} \setcounter{it}{2} \setcounter{tot}{7} \loop ...


3

Since you claimed that you solved your problem, I am here to respond to cfr's comment. Some explanation follows: According to The TeXBook, \char is used to print the desired character. So TeX would treat \char as \ c h a r when {fa-\char97.jpg} is passed as an input. (But it printed an "a" for \subsection, didn't it?) dealing with a count/counter by index ...


0

The answer was to use the LaTeX counter rather than a TeX counter. Here is the code that made it work: \documentclass[11pt, fleqn]{article} \usepackage{graphicx} \begin{document} \newcounter{count} \setcounter{count}{1} \loop\ifnum\value{count} < 8 \subsection*{Part (\alph{count})} \includegraphics[scale=0.7]{fa-\alph{count}.jpg} \hfil\break ...


3

Usual expansion problem: \documentclass[12pt]{article} \usepackage{comment} \usepackage{forloop} \newcounter{probnum} \forloop{probnum}{1}{\value{probnum} < 6}{% \begingroup\edef\x{\endgroup \noexpand\excludecomment{prob\arabic{probnum}}% }\x } \begin{document} \begin{prob1} hidden \end{prob1} shown \end{document} Alternative version ...


0

Brian Blackmore / Frans's example with sound added using media9 & animated using animate. Requires A-Reader on Windows or Mac, sorry. Run pdflatex -shell-escape on the code twice or thrice. The sound file is loaded from the web during viewing time of the pdf. For offline use, download the mp3 and adjust the addresource=... and source=... code lines ...


0

Not quite sure what do you mean by total angle. But It should be easy to modify the code. \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture}[line cap=round] \foreach\i/\result in{1/-15,2/-45,3/-90,4/-140}{ \draw[gray!50](25:\i)node[above,black]{$W_{\i}$}arc(25:-205:\i); ...


4

First, you cannot nest a \csvreader into another \csvreader. But, you could read the countries, remember them, and then read the bottles. In my following suggestion, I use the list features from the etoolbox package to store the country names into a \countrylist. Next, we loop through this list using \dolistloop which itself uses the \do macro. This \do ...



Top 50 recent answers are included