Hot answers tagged

13

You can use the odsfile package, which supports manipulations with OpenDocument Spreadsheet files. You need to convert your excel file to ODS using LibreOffice (Excel can do this as well, but LibreOffice produces cleaner files). Odsfile provides \includespread command with keyval interface: \documentclass{article} \usepackage{fontspec} \usepackage{odsfile} ...


7

Short answer: You are looking for Auto Multiple Choice (AMC). Long answer: You are looking for Auto Multiple Choice (AMC) that is a LaTeX package and a free GUI program for Linux. If you are a Window user that make regularly exams, it worth to install Linux only to have this program. AMC can make one exam to each student with randomly questions, so each ...


5

This is easy enough using expl3 (there are several possible approaches): \documentclass{article} \usepackage{expl3,xparse} \ExplSyntaxOn \DeclareExpandableDocumentCommand \mycmd { m } { \__mycmd_loop:nN {#1} aeiouAEIOU \q_recursion_tail \q_recursion_stop } \cs_new:Npn \__mycmd_loop:nN #1#2 { \quark_if_recursion_tail_stop_do:nn {#2} { a } ...


5

Here's an approach with expl3 \documentclass{article} \usepackage{xparse,glossaries} \ExplSyntaxOn \DeclareExpandableDocumentCommand{\indef}{m} { \str_case_x:nnF { \tl_head:f { \tl_lower_case:n { #1 } } } { {a}{an} {e}{an} {i}{an} {o}{an} {u}{an} } {a}~#1 } \ExplSyntaxOff \begin{document} \indef{abc} --- \indef{cde} --- ...


5

As you have named the coordinates, just loop over their names: \documentclass[margin=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,calc} \begin{document} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \clip(-0.5,-1) rectangle (5.5,3.5); % defining coordinates \coordinate (1) at (0,0); \coordinate (2) at ...


4

You have to pass \EANBarcode an explicit number: \documentclass[a4paper]{article} \usepackage{labels} \usepackage{GS1} \usepackage{forloop} \LabelCols=4 \LabelRows=11 \GSSetup{module_height=15mm} \begin{document} \newcounter{loop} \forloop{loop}{1}{\value{loop} < 45}{% \addresslabel{% \expandafter\EANBarcode\expandafter{\the\value{loop}}% }% ...


3

I have had the same problem, and came up with the following solution. The enclosed LaTeX input takes a given PDF file (= one copy of the questionnaire) and creates N copies, each numbered 000..N. The number is added in light grey to the lower right corner. Feel free to customize as you like. % Print an exam N times, with serial numbers 000...N % by ...


2

you can use csvsimple package (http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/csvsimple/csvsimple.pdf) Here are some possibilities of this package that I find very useful. Documentation is very detailed with the given data file ================ StudentFile.txt============ name, email, surname, studentnumber robert, robert@yahoo.fr, ...


2

You can try this. Exploiting (for once) the fact that \foreach works in a group hence LaTeX does not complain with the \newcommand. HenceElse one would use \renewcommand and an initial \newcommand\foo{}. \documentclass{article} \usepackage{pgffor} \usepackage{ifthen} \newcommand\Ndays[1]{\ifthenelse{\equal{#1}{February}} ...


1

A poor man low weight no package approach, limited to four records (could go to nine records if space removal was handled more seriously). To be adapted to one's needs. \documentclass{article} % only for self-contained example here \usepackage{filecontents} \begin{filecontents*}{StudentFile.txt} robert, robert@yahoo.fr, roro, 123466 julie, juju@gmail.com, ...


1

The LaTeX kernel has some non publicized programming tools, such as while loops. The more well-know \loop is not appropriate here inside the tabular for a number of reasons, one being that it makes a local definition which will get lost, the other one is that \cline also uses \loop and this would clash. Here is a one-liner to get user access to one LaTeX ...


1

The obvious glitch (at least for who has some experience in macro expansion) is that \Nd does not expand to the number of days, but to the set of instruction for printing the number of days. The following macros associate days to months (also taking care of leap years) in an expandable way. \documentclass{article} \usepackage{multicol} \usepackage{xparse} ...


1

Use a different strategy: \newtheorem*{blurb}{Theorem \whatever} \newcommand{\whatever}{} \newenvironment{theorem}[1] {\renewcommand\whatever{#1}\begin{blurb}} {\end{blurb}} so you can do \begin{theorem}{3.25} in your document.


1

Is this what is meant? It is not the most effective usage of expl3, I know ;-) \documentclass{article} \usepackage{xparse} % used in example below \usepackage{pgffor} % used in example below \usepackage{xstring} % used in example below \ExplSyntaxOn \clist_set:Nn \l_tinytot_lowercaseletters_clist {a,e,i,o,u} \clist_set:Nn \l_tinytot_letters_clist ...


1

Here's a LuaLaTeX-based solution. It defines two fully-expandable "wrapper" macros named \mycmd and \mkfirstuc, which pass their arguments to Lua functions named mycmd and mkfirstuc. The Lua functions perform the actual work of prefixing "an " or "a " to a string and of upper-casing the first character in the string, respectively. % !TEX TS-program = ...



Only top voted, non community-wiki answers of a minimum length are eligible