Tag Info

Hot answers tagged

11

TeX uses fixed point binary arithmetic and calc uses this arithmetic that can't guarantee great accuracy. You get a better result using implementations of floating point numbers, for example the one in expl3: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \DeclareExpandableDocumentCommand{\roundtointeger}{m} { \fp_eval:n { round ( #1, 0 ) } ...


6

I made a sample receipt using datatool and tikz. For printing such receipt, you may need a database in which you store the data of your customer, I made it by creating a cvs file named database: BillNumber,FirstName,Surname,Address,Date,Amount 11234,Name,Family,"No. 1, First St.", "2014,06,02",1000 21485,Name,Family,"No. 1, First St.", "2014,06,02",1000 ...


5

Given this python: #!/usr/bin/python import sys print sum(map(int, sys.argv[1:])) Then running the following TeX with pdflatex --shell-escape shows that the python has been passed a script and some arguments with the result being typeset by TeX. \documentclass{article} \begin{document} sum is \input{"|python tst.py 1 2 3 2>/dev/null"} ...


5

There are only a few kinda-traffic-signs in the unicode which look like this: % arara: lualatex \documentclass{article} \usepackage{fontspec} \setmainfont{symbola.ttf} \usepackage{booktabs} \begin{document} \begin{tabular}{lc} \toprule Sign & Example\\ \midrule Crossing Lanes & \symbol{"26CC} \\ Disabled ...


4

The two main problems were: To use the @ in macro mames you need to use \makeatletter and \makeatother. See the references below. The definition \newcommand\confdate[1]{\renewcommand\@confdate{#1}} means that calling \confdate sets the value of \@confdate to the first parmamater. In your code the first line (which is commented out in the MWE below) was ...


3

Had the same issue. For me it worked after I synchronized manually with the repository using the MikTeX Package Manager (Admin) tool and under the Repository menu using the synchronize. Then the issue is resolved and the mathtools package appears under the package list.


3

With the probsoln package, problems can be defined either within the document or in an external file that can be loaded using a command such as \loadallproblems or \loadrandomproblems. Here's a simple example with the problems defined in the document: \documentclass{article} \usepackage{probsoln} \begin{defproblem}{prob1}% label \begin{onlyproblem}% ...


3

The trick is pretending that Ñ occupies the same vertical space as A % arara: latex % arara: dvips % arara: ps2pdf \documentclass[a4paper]{article} \usepackage{psgo} \usepackage[spanish]{babel} \renewcommand{\golabelformat}[1]{{\sffamily\vphantom{A}\smash{#1}}} \begin{document} \begin{psgoboard} \end{psgoboard} \end{document} The arara lines are ...


2

You need to use xpatch: \documentclass[]{article} \usepackage[nonumber]{cuisine} \usepackage{xpatch} \makeatletter \xpatchcmd{\Displ@ySt@p}{\arabic{st@pnumber}}{}{}{} \makeatother \begin{document} \begin{recipe}{Name}{4}{\fr12 hour} \ing[5]{units}{something} STEP 1 STEP 2 ... \end{recipe} \end{document}


2

Here is a suggestion using the exsheets and tasks packages: \documentclass{article} \usepackage{exsheets,tasks} \SetupExSheets{ solution/name=Exercise , headings-format=\itshape } \begin{document} \begin{question} Calculate the following: \begin{tasks}(3) \task $7+2$ \task $9-9$ \task $5+5+5$ \end{tasks} \end{question} ...


2

I use the following True/False format in the Exam class. It may or may not suit your needs. I find this layout especially convenient for grading. Part of the true/false question format is based on this answer by Gonzalo Medina. \documentclass[11pt]{exam} %\printanswers % Create a True False question format \newcommand*{\TrueFalse}[1]{% \ifprintanswers ...


2

In your example, \confdate takes an argument. Therefore, when you use ...remember the date \confdate\ for the rest of your life. the \ (control space) is grabbed as the argument and placed inside \@confdate. That's why your output resembles ...remember the date for the rest of your life. On the other hand, when you use ...remember the date ...


2

If you don't need to allocate new name for printing version of the macro \confname, you can define more intelligent version of such macro: if the equal sign immediately follows then the value is stored else the value is used. Example: The test: \confname\ % value is used, empty value is printed as default. \confname={Name} % the value ...


2

My best guess is that you did not install the forloop.sty file correctly, but just save it to the folder, where you have your project. If this is the case, it will work with pdflatex, as pdflatex will install search you current directory for .sty files, but LyX will not. To install a package you have to choices. You can use the texlive install utitlity, if ...


1

Just following from the comment, the way to achieve this style is to use the amsart document class.


1

Ok, not exactly fixing the .sty file, but here someone posted a way to solve the issue: http://www.reddit.com/r/LaTeX/comments/2j1q3c/hints_for_modifying_a_sty_file/


1

Here's a solution using the answers package. You can tinker with the formatting of the answers. \documentclass[pdftex,12pt]{article} \usepackage{amsmath} \usepackage{answers} \newcommand{\answerFileName}{anexamanswers} \Newassociation{sol}{Solution}{\answerFileName} \Opensolutionfile{\answerFileName} \newenvironment{Exercise}[1] {\item #1 ...


1

The problem is not specific to shrink. The Turkish module of babel activates = and this causes problems for the interpretation of key-value syntax. If you have an up-to-date TeX system you can disable the = shorthand (that does nothing useful, in my opinion) maintaining the other two: \usepackage[turkish,shorthands=:!]{babel} With an older TeX system ...


1

Thanks to the egreg answer, i found another package to fix my problem : \documentclass{article} \usepackage{fp} \newcounter{r} \begin{document} \FPeval{\result}{round(10000 * 10.01,0)} \setcounter{r}{\result} \ther \end{document} Thank you for your help.


1

Well, you can rely on the policy that in the preamble, one uses \usepackage, whereas in the packages and classes, it's \RequirePackage: \documentclass[a4paper]{article} \def\usedpackages{} \let\xusepackage\usepackage \renewcommand\usepackage[2][]{\edef\usedpackages{\usedpackages#2,}\xusepackage[#1]{#2}} \usepackage[margin=0pt]{geometry} ...


1

Go to Miktex 2.9 settings and check if you allow "install package on the fly". If not, allow it.


1

I have a solution, which you can modify for your needs: \documentclass[ 11pt, a4paper, english ]{scrartcl} \usepackage{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \newwrite\NoFile \newread\NoFile \newread\DataFile \newcounter{NoReceipt} \openin\NoFile=NoFile.txt% \read\NoFile to \fileline \setcounter{NoReceipt}{\fileline} ...



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