0

This is my first time posting on stackoverflow, I hope I'm doing this right.

I had a LateX file on a windows 7 computer at university. It used to compile perfectly with TeXMaker. Recently, because of the university closing for summer, I had to take it home where I only have a Ubuntu laptop. I downloaded yesterday the latest version of TeX Live - Full as well as the TeXMaker interface using sudo apt install. I tried to open my file, and I get errors. I get the "! Extra \fi" error message for line 25, where I have the \usepackage[toc,page]{appendix} line, and loads of other errors messages, like "! Extra \else." at line 36 (\usepackage{textcomp}).

I have to say that no package was downloaded after the installation of TeXLive Full (which is weird, I don't think the installation downloaded all of them) and that I'm a complete newbie to LateX and on Ubuntu. Does any of you have an idea how to make the file compile properly ? Here's the first lines of the code, that lead to errors.

\documentclass[12pt,twoside]{report}
\usepackage{etex}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage[frenchb]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[utf8]{inputenc} 
\usepackage{array}
\usepackage{frenchle}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx} 
\usepackage{fancybox} 
\usepackage{cases}
\usepackage{eurosym}
\usepackage{ulem}
\usepackage{tikz}
\usepackage[makeroom]{cancel}
\usepackage{hyperref}
\usepackage{sidecap}
\usepackage{listings}
\usepackage{multicol}
\usepackage[toc,page]{appendix} 
\usepackage{wrapfig}
\usepackage{tocloft}
\usepackage[ampersand]{easylist}
\usepackage{xcolor}
\usepackage{amssymb}
\usepackage{underscore}
\usepackage{textcomp}
\usepackage{tikz}


\setlength{\oddsidemargin}{-1.cm} 
\setlength{\evensidemargin}{0.cm} 
\setlength{\topmargin}{-1.cm} 
\setlength{\textheight}{24.cm} 
\setlength{\textwidth}{17.cm}
\setlength{\parskip}{2ex} 
\setlength{\footnotesep}{2ex}
\setlength{\parindent}{0ex}
\addtolength{\skip\footins}{2ex}


\makeatletter

\def\clap#1{\hbox to 0pt{\hss #1\hss}}%
\def\ligne#1{%
\hbox to \hsize{%
\vbox{\centering #1}}}%
\def\haut#1#2#3{%
\hbox to \hsize{%
\rlap{\vtop{\raggedright #1}}%
\hss
\clap{\vtop{\centering #2}}%
\hss
\llap{\vtop{\raggedleft #3}}}}%
\def\bas#1#2#3{%
\hbox to \hsize{%
\rlap{\vbox{\raggedright #1}}%
\hss
\clap{\vbox{\centering #2}}%
\hss
\llap{\vbox{\raggedleft #3}}}}%
\def\maketitle{%
    \setcounter{page}{0}
\thispagestyle{empty}\vbox to \vsize{%
\haut{}{\@blurb}{}
\vfill
\vspace{1cm}
\begin{flushleft}
\usefont{OT1}{ptm}{m}{sl}
\huge \@title
\end{flushleft}
\par
\hrule height 4pt
\par
\begin{flushright}
\usefont{OT1}{phv}{m}{n}
\Large \@author
\par
\end{flushright}

%new commands
\newcommand{\mychapter}[1]{\textcolor{mygrey}{\chapter{\uppercase{#1}}}}
\newcommand{\mychapteretoile}[1]{\textcolor{mygrey}{\chapter*{\uppercase{#1}}}}
\newcommand{\mysection}[1]{\textcolor{myblue}{\section{#1}}}
\newcommand{\mysectionetoile}[1]{\textcolor{myblue}{\section*{#1}}} 
\newcommand{\mysubsection}[1]{\textcolor{myblue}{\subsection{#1}}}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}

%renewcommand
\ListProperties(Space=.01cm, Space*=.01cm, Progressive=3ex, Style*=-- , 

\renewcommand{\cftaftertoctitle}{\hrulefill}


\begin{document}
% My doc
\end{document}

I have to say that this compiles perfectly on the Windows PC I used.

PS : I also have other errors, like the figures that can't be found. I'm quite sure I did something wrong..

  • welcome to tex.sx. if you still have access to the windows system, add the command \listfiles to the input to report the versions. do the same on the ubuntu system. then compare the versions. that's the first thing i'd look at. – barbara beeton Aug 6 '18 at 20:57
  • 2
    Linux TeX distributions installed via the distro package manager are quite often out of date. I would recommend installing TeX Live directly. See How to install "vanilla" TeXLive on Debian or Ubuntu?. – Alan Munn Aug 6 '18 at 21:06
  • 1
    You have not really provided enough information to help, nor shown the full error message context from the log. But start by deleting any .aux or .toc files, and also remove unnecessary package lines such as etex (should never be used on current systems) and tikz (you load twice. Figures will of course be missing unless you copied them from the original machine, but again you show neither the source nor the error, so we can't help – David Carlisle Aug 6 '18 at 21:07
0

The posted document does not give the error in the title but a different error

! Illegal parameter number in definition of \maketitle.
<to be read again> 
                   1
l.86 ...{\textcolor{mygrey}{\chapter{\uppercase{#1
                                                  }}}}
? 

which looks like you have omitted }} before the line with % new commands

If you add them you get

! Paragraph ended before \ListProperties was complete.
<to be read again> 
                   \par 
l.98 

I have no idea what that command is supposed to do, so I commented it out. (but it has a ( and no matching ) )

Then you get the error

-26- Erreur d\'etect\'ee dans frenchle.sty !(voir p.ex. le fichier language.dat

) ! Extra \else. \bbl@switch ... date#1\endcsname \relax \fi \else \ifbbl@usedategroup \bbl@u... l.102 \begin{document}

? 

I'm not sure you can have both frenchle and [french]{babel} at the same time, but in any event if you comment out the frenchle package it runs without error. I also commented out several other pbsolete or duplicated packages

\documentclass[12pt,twoside]{report}
%\usepackage{etex}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage[frenchb]{babel}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[utf8]{inputenc} 
\usepackage{array}
%\usepackage{frenchle}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx} 
\usepackage{fancybox} 
\usepackage{cases}
\usepackage{eurosym}
\usepackage{ulem}
\usepackage{tikz}
\usepackage[makeroom]{cancel}
\usepackage{hyperref}
\usepackage{sidecap}
\usepackage{listings}
\usepackage{multicol}
\usepackage[toc,page]{appendix} 
\usepackage{wrapfig}
\usepackage{tocloft}
\usepackage[ampersand]{easylist}
\usepackage{xcolor}
%\usepackage{amssymb}
\usepackage{underscore}
\usepackage{textcomp}
\usepackage{tikz}


\setlength{\oddsidemargin}{-1.cm} 
\setlength{\evensidemargin}{0.cm} 
\setlength{\topmargin}{-1.cm} 
\setlength{\textheight}{24.cm} 
\setlength{\textwidth}{17.cm}
\setlength{\parskip}{2ex} 
\setlength{\footnotesep}{2ex}
\setlength{\parindent}{0ex}
\addtolength{\skip\footins}{2ex}


\makeatletter

\def\clap#1{\hbox to 0pt{\hss #1\hss}}%
\def\ligne#1{%
\hbox to \hsize{%
\vbox{\centering #1}}}%
\def\haut#1#2#3{%
\hbox to \hsize{%
\rlap{\vtop{\raggedright #1}}%
\hss
\clap{\vtop{\centering #2}}%
\hss
\llap{\vtop{\raggedleft #3}}}}%
\def\bas#1#2#3{%
\hbox to \hsize{%
\rlap{\vbox{\raggedright #1}}%
\hss
\clap{\vbox{\centering #2}}%
\hss
\llap{\vbox{\raggedleft #3}}}}%
\def\maketitle{%
    \setcounter{page}{0}
\thispagestyle{empty}\vbox to \vsize{%
\haut{}{\@blurb}{}
\vfill
\vspace{1cm}
\begin{flushleft}
\usefont{OT1}{ptm}{m}{sl}
\huge \@title
\end{flushleft}
\par
\hrule height 4pt
\par
\begin{flushright}
\usefont{OT1}{phv}{m}{n}
\Large \@author
\par
\end{flushright}

}}%%%%


%new commands
\newcommand{\mychapter}[1]{\textcolor{mygrey}{\chapter{\uppercase{#1}}}}
\newcommand{\mychapteretoile}[1]{\textcolor{mygrey}{\chapter*{\uppercase{#1}}}}
\newcommand{\mysection}[1]{\textcolor{myblue}{\section{#1}}}
\newcommand{\mysectionetoile}[1]{\textcolor{myblue}{\section*{#1}}} 
\newcommand{\mysubsection}[1]{\textcolor{myblue}{\subsection{#1}}}
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}

%renewcommand
%\ListProperties(Space=.01cm, Space*=.01cm, Progressive=3ex, Style*=-- , 

\renewcommand{\cftaftertoctitle}{\hrulefill}


\begin{document}
% My doc
\end{document}
  • Thank you ! This plus deleting any .aux or .toc files as suggested in comments solved my problem. – NapCake Aug 7 '18 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.