0

I recently had my computer "refreshed" and I had to reinstall MacTeX and TeXMaker. When I try to compile a specific file it says: Argument of \put has an extra }.

If I completely remove everything after \begin{document} and before \end{document} it will compile, but as soon as I put anything there I get the error. I'm pretty sure that I've not configured TeXMaker properly, but I don't know what to do. Any advice.

Here's the code (warnings, it's a hodgepodge of various files):

    \documentclass[twoside, 10pt]{article}

\RequirePackage{latexsym, verbatim, xspace, setspace} \RequirePackage{tikz, pgflibraryplotmarks} \usepackage{etex,harpoon} \usepackage[ascii, latin1]{inputenc} \usepackage{fancyhdr} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{xfrac} \usepackage{comment} \usepackage{enumitem} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \usepackage{multicol} \usepackage{graphicx} \usepackage{amsthm} \usepgflibrary{fpu} \usepackage{siunitx} \usepackage{commath} \usepackage[T1]{fontenc} \usepackage{comment}

%\usepackage{subcaption} \usepackage[caption = false]{subfig} \usetikzlibrary{arrows,decorations.pathmorphing,decorations.markings,backgrounds,positioning,fit,petri} \usepackage{tabularx} \usepackage{tabulary} \usepackage{float} \restylefloat{table} \usepackage{placeins} \usepackage{booktabs} \usepackage{afterpage} \usepackage{pgfmath} \usepackage{m-pictex} \usepackage{pictexwd} \usepackage{background} \usepackage{pictex} \usepackage{textpos} \input pictex \input{norm_background_files/rlpmacros} \backgroundsetup{placement=center,angle=0,scale=1,opacity=25, %contents=\includegraphics{GridBCD4E6_plain_math}} %contents=\includegraphics{norm_background_files/GridBCD4E6}} %contents=\includegraphics{norm_background_files/GridBCD4E6_no_rb}} contents=\includegraphics{norm_background_files/GridBCD4E6_no_rb_no_horizontal_divider}} \font\ninerm=cmr9 \font\ninei=cmmi9 \font\nines=cmsy9 \font\eightrm=cmr8 \font\eighti=cmmi8 \font\eights=cmsy8 \parindent=0pt \newcounter{probcounter} \newcounter{pagecounter}

%***************************Print Margin Notes********************** %option 0: do not print margin notes %option 1: print margin notes \def\printmarginnotes{1}

%\setlength{\textwidth}{5in} %\setlength{\leftmargin}{-0.6in} %\setlength{\rightmargin}{0in} %\setlength{\topmargin}{-0.4in} \setlength{\headheight}{0.2in} \setlength{\headsep}{0.05in} %\setlength{\topskip}{0.0in} %\setlength{\footskip}{12pt} %\setlength{\textwidth}{5in} %\setlength{\textheight}{9.6in} \setlength\abovedisplayskip{5pt} \setlength\belowdisplayskip{5pt} \usepackage[width = 6.9in, left = 0.85in, top = 0.47in, bottom = 0in, right = .75in]{geometry} \pagestyle{fancy} \setlength\parindent{0pt} \setlength{\voffset}{0pt} \setlength{\hoffset}{0pt} %\setstretch{1.246} \setlength{\parskip}{3.5pt}

%\newenvironment{absolutelynopagebreak} % {\par\nobreak\vfil\penalty0\vfilneg % \vtop\bgroup} %{\par\xdef\tpd{\the\prevdepth}\egroup %\prevdepth=\tpd}

\makeatletter \newcommand\bigcdot{\mathpalette\bigcdot@{.5}} \newcommand\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}} \makeatother

\newtheorem{definition}{Definition} \newtheorem{theorem}{Theorem}

\begin{document}

\renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} %*****************************include the preamble here**************************** %\input{m3preliminaries.tex}

\lhead{\bf Math 3 \hspace{.1in} 2021 - 2022} \rhead{\bf Name: \hspace{1.5 in}\ \ } %\lfoot{\eightrm June 15, 2015} %\lfoot{\eightrm \today} \lfoot{\eightrm } \rfoot{\eightrm } \cfoot{ } \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}

%\vspace*{0.12in} \noindent

%**************************Choose what to print******************************** %the problems, put #1 in the braces \newcommand{\stateproblem}[1]{#1} %the answers, put #1 in the braces \newcommand{\stateanswer}[1]{} %the commentary, put #1 in the braces \newcommand{\statecomment}[1]{}

\newcommand{\ovec}{\overrightarrow} \newcommand{\ds}{\displaystyle}

\newcommand{\Cdot}{\raisebox{1 pt}{\scalebox{.5}{$\bullet$}}} \newcommand{\p}{^\prime} %\newcommand{\href[2]}{\underline{#2}}

%***********************print only the answers in groups of 10******************** %\newcommand{\stateproblem}[1]{} %\newcounter{anscounter} %\newcommand{\stateanswer}[1]{ % \addtocounter{anscounter}{1} % \pgfmathparse{mod(\value{anscounter},10)} % \pgfmathtruncatemacro{\myint}{ \pgfmathresult} % \ifnum \myint=1 \filbreak\par\indent\rlap \fi % %{\textbf{\arabic{probcounter}}.}\hskip 1pt~#1 % {\textbf{\arabic{probcounter}}.}~#1 % \ifnum \myint=0 \vskip .25in \fi %} %\newcommand{\statecomment}[1]{}

%KW shorcuts \newcommand{\mbf}{\mathbf} \newcommand{\mbb}{\mathbb} \makeatletter \newcommand\MY@leftharpoonupfill@{% \arrowfill@\leftharpoonup\relbar\relbar } \newcommand\MY@rightharpoonupfill@{% \arrowfill@\relbar\relbar\rightharpoonup } % These are not needed, for now: % \newcommand\MY@leftharpoondownfill@{% % \arrowfill@\lefttharpoondown\relbar\relbar % } % \newcommand\MY@rightharpoondownfill@{% % \arrowfill@\relbar\relbar\rightharpoondown % } \newcommand\overleftharpoon{% \mathpalette{\overarrow@\MY@leftharpoonupfill@}% } \newcommand\overrightharpoon{% \mathpalette{\overarrow@\MY@rightharpoonupfill@}% }

% Support for smaller size arrows: \newcommand@dblsty@mathpalette[2]{% % Works like "\mathpalette", but macro passed in #1 must take % (at least) three arguments, of which the first two are % style selections. \mathchoice {#1\displaystyle \scriptstyle {#2}}% {#1\textstyle \scriptstyle {#2}}% {#1\scriptstyle \scriptscriptstyle {#2}}% {#1\scriptscriptstyle \scriptscriptstyle {#2}}% } \newcommand@dblsty@overarrow@[4]{% % #1 := stretchable covering arrow % #2 := base style % #3 := style for covering arrow % #4 := base symbol \vbox{\ialign{##\crcr #1#3\crcr \noalign{\nointerlineskip}% $\m@th\hfil #2#4\hfil$\crcr }}% } \newcommand\smalloverleftharpoon{% @dblsty@mathpalette{@dblsty@overarrow@\MY@leftharpoonupfill@}% } \newcommand\smalloverrightharpoon{% @dblsty@mathpalette{@dblsty@overarrow@\MY@rightharpoonupfill@}% } \makeatother

\newcommand{\kw}{}

\pagenumbering{arabic} %\begin{textblock}{5.15in}(0in, -0.05in) \label{prob40_0001} \input{prob_files/prob40_0001.tex} \end{textblock}

klw1026
  • 111
  • So even \documentclass{article} \begin{document} hello world \end{document}? What is the content of the log file for that input? – Teepeemm May 29 '21 at 21:10
  • No, that does not compile either. – klw1026 May 29 '21 at 21:13
  • The original code does compile on another computer. So it must be some kind of issue with configuration of TeXMaker and/or MacTex – klw1026 May 29 '21 at 21:14
  • presumably a duplicate of https://tex.stackexchange.com/questions/574592/previously-working-code-now-gives-argument-of-put-has-an-extra-after-texliv – David Carlisle May 29 '21 at 21:14
  • I saw that question, but after trying what you suggested it still did not work. Any other ideas? – klw1026 May 29 '21 at 21:15
  • 4
    of course we have no ideas as you have not shown any code nor shown the log. How is anyone supposed to suggest anything? – David Carlisle May 29 '21 at 21:16
  • are you using pictex? – David Carlisle May 29 '21 at 21:16
  • 1
    Oh sorry. Let me post the code. – klw1026 May 29 '21 at 21:21
  • I am not using pictex (I don't believe). I posted the code...but I'm not sure how to make it easier to read. – klw1026 May 29 '21 at 21:25
  • you are using pictex, see \input pictex is in your code, and \usepackage{pictex} too, and \usepackage{m-pictex}. – Ulrike Fischer May 29 '21 at 21:26
  • @UlrikeFischer Oh, thank you! Also, thank you for making it easier to read the code. I tried David Carlisle's suggestion (from the linked question in his comment) but it didn't seem to work. Maybe I am not putting the commands in the right place? – klw1026 May 29 '21 at 21:29
  • your code is quite a mess and it is no wonder that you are lost. I would suggest that you spent an hour or two to sort it. Remove duplicates, remove etex, that is quite unneeded, and check if you really need all what you have in your preamble. – Ulrike Fischer May 29 '21 at 21:36
  • @UlrikeFischer Yes, it is a mess. I will follow your suggestion, but I'd desperately like to get it to be able to compile first. After trying David Carlisle's suggestion, I get the error: ``Use of \put doesn't match it's definition. \put{ '' – klw1026 May 29 '21 at 21:42
  • Put \let\latexput\put before \documentclass, and \let\put\latexput before \begin{document} and then hope. But if you are actively using pictex it will then probably break. – Ulrike Fischer May 29 '21 at 21:55
  • unrelated but I wouldn't use commath. As you are using pictex this is clearly a duplicate of the earlier question.. – David Carlisle May 29 '21 at 21:57
  • @UlrikeFischer I will give it a go. – klw1026 May 29 '21 at 21:59
  • \usepackage[ascii, latin1]{inputenc} It doesn't make sense to include two options to inputenc, the file has to be in one encoding. Probably both these options are wrong, certainly they are wrong for the code as posted to this site which is in UTF-8. – David Carlisle May 29 '21 at 21:59
  • @DavidCarlisle Yes, I agree. I was not aware that pictex was there. – klw1026 May 29 '21 at 21:59
  • also if using pictex from latex (why??) just use \usepackage{pictex} delete the line\input pictexand all the lines like\font\ninerm=cmr9` which have no place in latex. – David Carlisle May 29 '21 at 22:02
  • @UlrikeFischer It gave me the same error from before: ``Use of \put doesn't match it's definition. \put{ '' . I did remove the code that David Carlisle suggested in the other question. Should I try putting that back and then doing what you suggest? – klw1026 May 29 '21 at 22:03
  • how come you have at least 10 pictex related lines in your preamble if you were not aware you are using pictex? Don't just copy random lines, Always start from an empty preamble and only add packages if you are definitely using them. – David Carlisle May 29 '21 at 22:04
  • you should clean up your code. – Ulrike Fischer May 29 '21 at 22:07
  • 1
    @DavidCarlisle It is a file that was created by several people, and I was basically just changing a few things here and there and adding to it as I went. I tried doing cntrl f and searching for pictex but it was not seeing it for some reason. – klw1026 May 29 '21 at 22:13
  • @UlrikeFischer Thank you so much for all of your help! Now that it is compiling, I am going to go through it and clean it up. – klw1026 May 29 '21 at 23:25

1 Answers1

2

This is a duplicate of the referenced question and the same answer applies, but I'll add it here in your example document. I also added some comments to the preamble lines.

\let\latexput\put
\documentclass[twoside, 10pt]{article}

\RequirePackage{latexsym, verbatim, xspace, setspace} \RequirePackage{tikz, pgflibraryplotmarks} %%%NO! \usepackage{etex} \usepackage{harpoon} %%%NO! \usepackage[ascii, latin1]{inputenc} \usepackage{fancyhdr} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{xfrac} \usepackage{comment} \usepackage{enumitem} \usepackage{pgfplots} \pgfplotsset{compat=1.12} \usepackage{multicol} \usepackage{graphicx} \usepackage{amsthm} \usepgflibrary{fpu} \usepackage{siunitx} % I wouldn't \usepackage{commath} \usepackage[T1]{fontenc} \usepackage{comment}

%\usepackage{subcaption} \usepackage[caption = false]{subfig} \usetikzlibrary{arrows,decorations.pathmorphing,decorations.markings,backgrounds,positioning,fit,petri} \usepackage{tabularx} \usepackage{tabulary} \usepackage{float} \restylefloat{table} \usepackage{placeins} \usepackage{booktabs} \usepackage{afterpage} \usepackage{pgfmath} \usepackage{m-pictex} \usepackage{pictexwd} \usepackage{background} \usepackage{pictex} \let\pictexput\put \let\put\latexput \usepackage{textpos} %%%NO! \input pictex % I don't have this file \input{norm_background_files/rlpmacros} \backgroundsetup{placement=center,angle=0,scale=1,opacity=25, %contents=\includegraphics{GridBCD4E6_plain_math}} %contents=\includegraphics{norm_background_files/GridBCD4E6}} %contents=\includegraphics{norm_background_files/GridBCD4E6_no_rb}} contents=\includegraphics{example-image}} %%%NO! \font\ninerm=cmr9 %%%NO! \font\ninei=cmmi9 %%%NO! \font\nines=cmsy9 %%%NO! \font\eightrm=cmr8 %%%NO! \font\eighti=cmmi8 %%%NO! \font\eights=cmsy8 \parindent=0pt \newcounter{probcounter} \newcounter{pagecounter}

%***************************Print Margin Notes********************** %option 0: do not print margin notes %option 1: print margin notes \def\printmarginnotes{1}

%\setlength{\textwidth}{5in} %\setlength{\leftmargin}{-0.6in} %\setlength{\rightmargin}{0in} %\setlength{\topmargin}{-0.4in} \setlength{\headheight}{0.2in} \setlength{\headsep}{0.05in} %\setlength{\topskip}{0.0in} %\setlength{\footskip}{12pt} %\setlength{\textwidth}{5in} %\setlength{\textheight}{9.6in} \setlength\abovedisplayskip{5pt} \setlength\belowdisplayskip{5pt} \usepackage[width = 6.9in, left = 0.85in, top = 0.47in, bottom = 0in, right = .75in]{geometry} \pagestyle{fancy} \setlength\parindent{0pt}% You already did this above \setlength{\voffset}{0pt} \setlength{\hoffset}{0pt} %\setstretch{1.246} \setlength{\parskip}{3.5pt}

%\newenvironment{absolutelynopagebreak} % {\par\nobreak\vfil\penalty0\vfilneg % \vtop\bgroup} %{\par\xdef\tpd{\the\prevdepth}\egroup %\prevdepth=\tpd}

\makeatletter \newcommand\bigcdot{\mathpalette\bigcdot@{.5}} \newcommand\bigcdot@[2]{\mathbin{\vcenter{\hbox{\scalebox{#2}{$\m@th#1\bullet$}}}}} \makeatother

\newtheorem{definition}{Definition} \newtheorem{theorem}{Theorem}

\begin{document}

\renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} %*****************************include the preamble here**************************** %\input{m3preliminaries.tex}

\lhead{\bfseries Math 3 \hspace{.1in} 2021 - 2022} % \bfseries \bf has not been defined by default on latex for 30 years \rhead{\bfseries Name: \hspace{1.5 in}\ \ } %\lfoot{\eightrm June 15, 2015} %\lfoot{\eightrm \today} \lfoot{\footnotesize }% latex font commands \rfoot{\footnotesize }% although the font is irrelevant since there is no text. \cfoot{ } \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}

%\vspace*{0.12in} %%%NO! \noindent

%**************************Choose what to print******************************** %the problems, put #1 in the braces \newcommand{\stateproblem}[1]{#1} %the answers, put #1 in the braces \newcommand{\stateanswer}[1]{} %the commentary, put #1 in the braces \newcommand{\statecomment}[1]{}

\newcommand{\ovec}{\overrightarrow} \newcommand{\ds}{\displaystyle}

\newcommand{\Cdot}{\raisebox{1 pt}{\scalebox{.5}{$\bullet$}}} \newcommand{\p}{^\prime}% why? it is simplet to use '

%\newcommand{\href[2]}{\underline{#2}}

%***********************print only the answers in groups of 10******************** %\newcommand{\stateproblem}[1]{} %\newcounter{anscounter} %\newcommand{\stateanswer}[1]{ % \addtocounter{anscounter}{1} % \pgfmathparse{mod(\value{anscounter},10)} % \pgfmathtruncatemacro{\myint}{ \pgfmathresult} % \ifnum \myint=1 \filbreak\par\indent\rlap \fi % %{\textbf{\arabic{probcounter}}.}\hskip 1pt~#1 % {\textbf{\arabic{probcounter}}.}~#1 % \ifnum \myint=0 \vskip .25in \fi %} %\newcommand{\statecomment}[1]{}

%KW shorcuts \newcommand{\mbf}{\mathbf} \newcommand{\mbb}{\mathbb} \makeatletter \newcommand\MY@leftharpoonupfill@{% \arrowfill@\leftharpoonup\relbar\relbar } \newcommand\MY@rightharpoonupfill@{% \arrowfill@\relbar\relbar\rightharpoonup } % These are not needed, for now: % \newcommand\MY@leftharpoondownfill@{% % \arrowfill@\lefttharpoondown\relbar\relbar % } % \newcommand\MY@rightharpoondownfill@{% % \arrowfill@\relbar\relbar\rightharpoondown % } \newcommand\overleftharpoon{% \mathpalette{\overarrow@\MY@leftharpoonupfill@}% } \newcommand\overrightharpoon{% \mathpalette{\overarrow@\MY@rightharpoonupfill@}% }

% Support for smaller size arrows: \newcommand@dblsty@mathpalette[2]{% % Works like "\mathpalette", but macro passed in #1 must take % (at least) three arguments, of which the first two are % style selections. \mathchoice {#1\displaystyle \scriptstyle {#2}}% {#1\textstyle \scriptstyle {#2}}% {#1\scriptstyle \scriptscriptstyle {#2}}% {#1\scriptscriptstyle \scriptscriptstyle {#2}}% } \newcommand@dblsty@overarrow@[4]{% % #1 := stretchable covering arrow % #2 := base style % #3 := style for covering arrow % #4 := base symbol \vbox{\ialign{##\crcr #1#3\crcr \noalign{\nointerlineskip}% $\m@th\hfil #2#4\hfil$\crcr }}% } \newcommand\smalloverleftharpoon{% @dblsty@mathpalette{@dblsty@overarrow@\MY@leftharpoonupfill@}% } \newcommand\smalloverrightharpoon{% @dblsty@mathpalette{@dblsty@overarrow@\MY@rightharpoonupfill@}% } \makeatother

\newcommand{\kw}{}

\pagenumbering{arabic} %\begin{textblock}{5.15in}(0in, -0.05in) \label{prob40_0001} \input{prob_files/prob40_0001.tex} \end{textblock}

xxx

\end{document}

David Carlisle
  • 757,742
  • 1
    I have not had a chance to read through everything yet, but thank you for taking the time to do this. I'm going to read through it now, as well as try to clean everything up. – klw1026 May 29 '21 at 22:31
  • 1
    I tried compiling right away and it works! Thank you! Now, when I add in a few lines (which calls for another tex file) I get an error message: Undefined control sequence \nineiO \put {\ninei O} at -0.06841 0.00622 – klw1026 May 29 '21 at 22:47
  • Here's the full code: \setbox1=\vbox{ \beginpicture \setcoordinatesystem units <1.4in,1.4in> \put {\phantom{.}} at -1.05797 -1.01065 \put {\phantom{.}} at -1.05797 1.01065 \put {\phantom{.}} at 1.05 -1.01065 \put {\phantom{.}} at 1.05 1.01065 \setlinear \putrule from 0.00000 0.00000 to 1.00000 0.00000 \circulararc 360.00000 degrees from 1.00000 0.00000 center at 0.00000 0.00000 \put{$\scriptscriptstyle\bullet$} at 0.00000 0.00000 \put {\ninei O} at -0.06841 0.00622 \put{$\scriptscriptstyle\bullet$} at 1.00000 0.00000 \put {\ninei A} at 1.07 0.00000 \endpicture} – klw1026 May 29 '21 at 22:47
  • When I un-uncomment out the line \font\ninei=cmmi9 it complies again. – klw1026 May 29 '21 at 22:50
  • 1
    @klw1026 if your document is explicitly using plain tex font commands within the picture then yes I suppose you could define them, it makes no sense to be doing that in latex but whatever works. why would anyone have \ninei A in a latex file? – David Carlisle May 29 '21 at 23:01
  • I believe it works, with everything added back in (all the additional files that are called)!!!!!!!!! Thank you so much for all of your help! – klw1026 May 29 '21 at 23:24
  • I use commath a lot, is there something wrong with the package? – Heliton Martins May 29 '21 at 23:36
  • 1
    @HélitonMartins unfortunately commath is written based on a misunderstanding of the \ifinner primitive which does nothing useful in math mode. So all the commands using \ifinner are wrong and sadly that is most of the package. See many answers on site, maybe this one of egreg's is most comprehensive https://tex.stackexchange.com/a/135985/1090 – David Carlisle May 30 '21 at 09:01