latex caption language (2) [closed] - latex

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
Referring to this question (Change LaTeX caption language), I got the same problem and it does not get solved by the use of the correct language package.
Here is a MWE:
\documentclass[a4paper,twoside]{article}
\usepackage[a4paper,top=2cm,bottom=2cm,inner=6cm,outer=2cm]{geometry}
\geometry{twoside}
\usepackage{lmodern}%font
\usepackage[francais]{babel}%language corrector and punctuation rules
\usepackage[utf8]{inputenc}%encoding
\usepackage[T1]{fontenc}
\usepackage[font=small]{caption}%titres des figures
\usepackage{color}
\usepackage{array}
\usepackage{colortbl}
\usepackage[pdftex]{graphicx}
\begin{document}
\begin{table}[h!]
\caption{Calendrier approximatif du processus législatif.}
\begin{tabular}{>{\raggedleft}p{0.65\textwidth}
p{0.1\textwidth}
}
Analyse du problème, fixation des objectifs et définition des moyens d'action possibles & 1 an\\
\end{tabular}
\end{table}
\end{document}
What do I do wrong? Thank you!

The standard tag for a table defined in frenchb.ldf is the word “Table”.
If you want it to become “Tableau”, for instance, you have to tell babel to.
\documentclass[a4paper,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}%encoding
\usepackage[francais]{babel}%language corrector and punctuation rules
\usepackage[a4paper,top=2cm,bottom=2cm,inner=6cm,outer=2cm]{geometry}
\geometry{twoside}
\usepackage{lmodern}%font
\usepackage[font=small]{caption}%titres des figures
\usepackage{color}
\usepackage{array}
\usepackage{colortbl}
\usepackage{graphicx}
\addto\captionsfrench{\renewcommand\frenchtablename{{\FBfigtabshape Tableau}}}
\begin{document}
\begin{table}[h!]
\caption{Calendrier approximatif du processus législatif.}
\begin{tabular}{>{\raggedleft}p{0.65\textwidth}
p{0.1\textwidth}
}
Analyse du problème, fixation des objectifs et définition des moyens d'action possibles & 1 an\\
\end{tabular}
\end{table}
\end{document}
I have also changed the package loading order to a better one. Note that you don't need to pass the pdftex option to graphicx (unless you have a very old TeX distribution).

Related

Latex: Formatting the table of code listings [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last year.
Improve this question
I'm trying to include a table of code listings in my Latex document. This is the command I am using:
\lstlistoflistings
The problem I am facing is, that the title of the code is overlaying with the numbering:
I would like to have it like this (except for "Code" in place of "Tabelle "), but I can't find a solution for it:
Based on the code kindly provided by #Dr. Manuel Kuehner, you can make this quick hack to prefix the lol with the word "Code":
% Based on https://tex.stackexchange.com/questions/97474
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{listings}
% https://tex.stackexchange.com/questions/34400
% https://tex.stackexchange.com/questions/538069
\renewcommand\lstlistingname{Quellcode (in German)}
\renewcommand{\lstlistlistingname}{Quellcodeverzeichnis (in German)}
\makeatletter
\def\l#lstlisting#1#2{\#dottedtocline{1}{0em}{1.5em}{Code #1}{#2}}
\makeatother
\begin{document}
\tableofcontents
\lstlistoflistings
\section{Section}
Some text.
\begin{lstlisting}[caption={A listing}]
Code
Code
Code
\end{lstlisting}
Some text.
\end{document}
Here is a start :).
% Based on https://tex.stackexchange.com/questions/97474
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{listings}
% https://tex.stackexchange.com/questions/34400
% https://tex.stackexchange.com/questions/538069
\renewcommand\lstlistingname{Quellcode (in German)}
\renewcommand{\lstlistlistingname}{Quellcodeverzeichnis (in German)}
\begin{document}
\tableofcontents
\lstlistoflistings
\section{Section}
Some text.
\begin{lstlisting}[caption={A listing}]
Code
Code
Code
\end{lstlisting}
Some text.
\end{document}

I cant get the references correct for my document. Caption and label are in the correct order [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
So i cant get the references correct in my latex document. I've read about caption and label being in the correct order and i already have that. below are is a working document.tex with the error.
I'm still using a local file, because i dont know how to fix that. But it is just a random png image on my machine and that is working
\documentclass[a4paper, twocolumn]{report}
\usepackage[dutch]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage{ebgaramond}
% Bibliography
\usepackage[style=apa]{biblatex}
\usepackage{csquotes}
\addbibresource{bibliography.bib}
% Translation for references to objects
\makeatletter
\def\HyLang#dutch{%
\def\equationautorefname{Vergelijking}%
\def\footnoteautorefname{voetnoot}%
\def\itemautorefname{item}%
\def\figureautorefname{Figuur}%
\def\tableautorefname{Tabel}%
\def\partautorefname{Deel}%
\def\appendixautorefname{Bijlage}%
\def\chapterautorefname{hoofdstuk}%
\def\sectionautorefname{sectie}%
\def\subsectionautorefname{subsectie}%
\def\subsubsectionautorefname{subsubsectie}%
\def\paragraphautorefname{paragraaf}%
\def\subparagraphautorefname{subparagraaf}%
\def\FancyVerbLineautorefname{lijn}%
\def\theoremautorefname{Stelling}%
\def\pageautorefname{pagina}%
}
\g#addto#macro\extrasdutch\HyLang#dutch
\makeatother
\addto\captionsdutch{%
\renewcommand{\appendixname}%
{Bijlage}%
}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{wallpaper}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\pgfplotsset{compat=1.15}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
% Table format
\pgfplotstableset{
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
col sep = comma,
string type,
}
% Colors
\definecolor{title-color}{HTML}{4230b8}
% Title formats with custom coloring
\titleformat{\chapter}
{\normalfont\bfseries\Huge\color{title-color}}{\thechapter.}{10pt}{}
\titleformat*{\section}{\normalfont\Large\bfseries\color{title-color}}
\titleformat*{\subsection}{\normalfont\large\bfseries\color{title-color}}
\titleformat*{\subsubsection}{\normalfont\normalsize\bfseries\color{title-color}}
% No page number on TOC page
\addtocontents{toc}{\protect\thispagestyle{empty}}
\begin{document}
\chapter{Planning}
\label{chap:schedule}
First ref to figure \autoref{fig:schedule}
\begin{figure}[h]
\centering
\caption{Planning}
\includegraphics[width=\textwidth]{img/schedule.png}
\label{fig:schedule}
\end{figure}
\end{document}
Output:
First ref to figure Figuur 1.1
Figuur 1.1: Planning
It should be figure 1 instead of figure 1.1
You can use the chngcntr package to use \counterwithout{figure}{chapter}
\documentclass[a4paper, twocolumn]{report}
\usepackage[dutch]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%\usepackage{ebgaramond}
% Bibliography
\usepackage[style=apa]{biblatex}
\usepackage{csquotes}
\addbibresource{bibliography.bib}
% Translation for references to objects
\makeatletter
\def\HyLang#dutch{%
\def\equationautorefname{Vergelijking}%
\def\footnoteautorefname{voetnoot}%
\def\itemautorefname{item}%
\def\figureautorefname{Figuur}%
\def\tableautorefname{Tabel}%
\def\partautorefname{Deel}%
\def\appendixautorefname{Bijlage}%
\def\chapterautorefname{hoofdstuk}%
\def\sectionautorefname{sectie}%
\def\subsectionautorefname{subsectie}%
\def\subsubsectionautorefname{subsubsectie}%
\def\paragraphautorefname{paragraaf}%
\def\subparagraphautorefname{subparagraaf}%
\def\FancyVerbLineautorefname{lijn}%
\def\theoremautorefname{Stelling}%
\def\pageautorefname{pagina}%
}
\g#addto#macro\extrasdutch\HyLang#dutch
\makeatother
\addto\captionsdutch{%
\renewcommand{\appendixname}%
{Bijlage}%
}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{wallpaper}
\usepackage{pgfplotstable}
\usepackage{booktabs}
\pgfplotsset{compat=1.15}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
% Table format
\pgfplotstableset{
every head row/.style={
before row=\toprule,after row=\midrule},
every last row/.style={
after row=\bottomrule},
col sep = comma,
string type,
}
% Colors
\definecolor{title-color}{HTML}{4230b8}
% Title formats with custom coloring
\titleformat{\chapter}
{\normalfont\bfseries\Huge\color{title-color}}{\thechapter.}{10pt}{}
\titleformat*{\section}{\normalfont\Large\bfseries\color{title-color}}
\titleformat*{\subsection}{\normalfont\large\bfseries\color{title-color}}
\titleformat*{\subsubsection}{\normalfont\normalsize\bfseries\color{title-color}}
% No page number on TOC page
\addtocontents{toc}{\protect\thispagestyle{empty}}
\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\begin{document}
\chapter{Planning}
\label{chap:schedule}
First ref to figure \autoref{fig:schedule}
\begin{figure}[h]
\centering
\caption{Planning}
\includegraphics[width=\textwidth]{example-image}
\label{fig:schedule}
\end{figure}
\end{document}

Changing citation language in latex

I am trying to include citations APA style in my latex document which is written in dutch. However, the citations appear as
author e.a. (year)
instead of
author et al. (year)
The first is probably some translation, but in dutch is is very common to still use et al. How do I change the citations in text to et al.?
\documentclass[dutch]{article}
\usepackage[utf8]{inputenc}
\usepackage[dutch]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=bibtex]{biblatex}
\addbibresource{Refrences.bib}
\begin{document}
\begin{otherlanguage}{dutch}
Dit is een test. \cite{Schleigh2015}. \cite{Slater2015}
\bibliography{bibliography}
\printbibliography
\end{otherlanguage}
\end{document}
output:
Dit is een test. Schleigh e.a., 2015. Slater e.a., 2015
Also, i just discoverd that apperently this apa style does not print an "&" when more than three authors are present. Instead in prints the word "and", which is not apa.
Author1, Author2 AND Author3
which should be:
Author1, Author2 & Author3
Luckily you use the biblatex package, this makes it easy to adjust the string:
\documentclass[dutch]{article}
\usepackage[utf8]{inputenc}
\usepackage[dutch]{babel}
\usepackage{csquotes}
\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\DefineBibliographyStrings{dutch}{
andothers = {et\addabbrvspace al\adddot},
andmore = {et\addabbrvspace al\adddot},
}
\begin{document}
Dit is een test. \cite{aksin}.
\printbibliography
\end{document}
Some other comments about your code:
apa styles requires the biber backend. With your attempt to use it with biblatex, you should have gotten an error messages telling you that. Please do not ignore error messages
your are mixing syntaxes from two different bibliography tools. \addbibresource{...} and \printbibliography are correct syntax for biblatex. \bibliography{bibliography} is not.
with \usepackage[dutch]{babel} you already changed the main language of your document to dutch, \begin{otherlanguage}{dutch}...\end{otherlanguage} is not necessary

! LaTeX Error: Something's wrong--perhaps a missing \item

\documentclass[11pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage {epsfig}
\usepackage{fancyhdr}
\linespread{1.4}
\setlength{\topmargin}{-0.4in}
\setlength{\topskip}{0.3in} % between header and text
\setlength{\textheight}{9.5in} % height of main text
\setlength{\textwidth}{6in} % width of text
%\setlength{\leftmargin}{-0.6in}
%\setlength{\oddsidemargin}{0.75in} % odd page left margin
%\setlength{\evensidemargin}{0.75in} % even page left margin
\addtolength{\evensidemargin}{-0.4in}
\addtolength{\oddsidemargin}{-0.4in}
\addtolength{\textwidth}{0.4in}
\begin{document}
\renewcommand\bibname{References}
\begin{titlepage}
\input{TitlePage}
\end{titlepage}
\pagenumbering{gobble}
\newpage
\pagenumbering{roman}
%\tableofcontents
\chapter*{
\begin{center}
{Abstract}
\end{center}
}
\begin{quotation}
\paragraph{}
Bank are providing mobile application to their customer. We are developing
banking application using Location Based Encryption. As compare to current
banking application which are location independent,
\\
\textbf{Keywords:}
Enter Keyword here.......
\end{quotation}
\newpage
\pagenumbering{arabic}
\pagestyle{fancy}
\fancyhead{} % clear all fields
\fancyhead[RO,LE]{}
\renewcommand\headrule{}
\rhead{PROJECT NAME}
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[RE,LO]{P.E.O COLLEGE}
\input{intro}
%\input{Literature_Survey}
\input{table}
%\input{problmstmt}
\input{scope}
%\input{future}
\input{conclusion}
\input{ref}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I have this latex code. But when I try to compile it it gives me an error saying :
! LaTeX Error: Something's wrong--perhaps a missing \item.See the
LaTeX manual or LaTeX Companion for explanation.Type H for
immediate help....
This error is on line:
\end{quotation}
Why am I getting this error? I haven't added any \item on the line where I'm getting the error.
The \paragraph and \\ instructions in the quotation do not make much sense. I guess that you meant something like this:
\begin{quotation}
\noindent
Banks are providing mobile applications to their customer. We are developing a
banking application using \emph{Location Based Encryption}. Compared to current
banking applications, which are location independent, \ldots
\paragraph{Keywords:} bank, application, encryption, location, mobile.
\end{quotation}

Error: missing \begin{document} in LaTeX [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
I have error in my LaTeX document, when run my file, have a error
! LaTeX Error: Missing \begin{document}.
and this tag \begin{document} exists in my code
\documentclass[12pt‎, ‎a4paper]{article}‎
\usepackage{graphicx} % inserting images
\usepackage[top=3cm,right=3cm,bottom=2.5cm,left=2.5cm]{geometry}
\usepackage[colorlinks,linkcolor=blue,citecolor=red]{hyperref}
\usepackage{multirow}
\usepackage{subfig}
\usepackage{algorithm}
\usepackage{algorithmic}
%\usepackage[utf8]{inputenc}
%\usepackage{color, pdfcolmk}
%\usepackage{sweave}
% setting the margins of page
\usepackage{xepersian}
\usepackage{setspace}
\settextfont[Scale=1.2]{XB Zar}
\setlatintextfont[Scale=1.1]{XB Zar}
\setdigitfont{XB Zar}
\setcounter{secnumdepth}{3}
\SepMark{-}
\DefaultMathsDigits
%-----------------------list-------------------------------------
\renewcommand{\listfigurename}{فهرست شکل ها}
\renewcommand{\listtablename}{فهرست جدول‌ها}
\renewcommand{\refname}{\rl{{مرجع‌ها}\hfill}}
%---------------------end list-------------------------------------
%\usepackage{geometry}\geometry{left=35mm,right=35mm, top=30mm,bottom=30mm}
\begin{document}
\pagenumbering{gobble}
\clearpage
\thispagestyle{empty}
When I copy the code you have shown here into Notepad++ with UTF-8 input encoding, I get the following result for the first line:
\documentclass[12pt?, ?a4paper]{article}?
From that I assume that you have non-UTF-8 characters which aren't recognized by LaTeX and thus it throws an error. Try to replace that line by
\documentclass[12pt, a4paper]{article}
As #nowox remarked in a comment, the \end{document} is missing. Make sure that you have that in your file.

Resources