I have very simple document, where I declare a counter and wand to add bold text for each list item as follow:
\documentclass[11pt]{article}
\usepackage{vmargin}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\usepackage{epsfig}
\usepackage{alltt}
\setpapersize{USletter}
\setmarginsrb{1in}{1.0in}{0.8in}{.8in}{0pt}{0mm}{0.25in}{7mm}
%problems start here
\newcounter{problem}
\newcounter{total}
\newcommand{\question}[1]{\addtocounter{total}{#1}
\addtocounter{problem}{1} \noindent {\bf \theproblem.} ({\bf #1 point})}
\begin{document}
\question{0.5} lost in latex
\question{1.5} lost in latex
\question{2.5} lost in latex
\end{document}
Now everything works well is I use only whole integers as 1,2,3 etc
However, if I use decimals: 0.5, 1.5 etc, latex produces some weird output:
Any suggestion on how to fix that appreciated!
\bf
is several decades obsolete in LaTeX,epsfig
is either obsolete or deprecated,epstopdf
is almost certainly unneeded andvmargin
should be avoided as it is very buggy and doesn't work properly. – cfr Jun 7 '18 at 0:36\addtocounter{total}{0.5}
, the remaining.5
is ignored by\addtocounter
and typeset (and you probably get an error). – Phelype Oleinik Jun 7 '18 at 0:36