Try to referece a image, but it say it's undefined [closed] - latex

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last month.
Improve this question
...wie in der Abbildung: \ref{fig:serviceWorke} zu sehen ist.
\vspace{0.5cm}
\begin{figure}
\includegraphics[width=\textwidth]{gfx/chapter-2/service-worker-architectur.png}
\caption{Service Worker Architektur [6] (S.24)}%
\label{fig:serviceWorker}
\end{figure}
\vspace{0.5cm}
Trying to reference a image but it only display a "??".
That's the Error: Reference `fig:serviceWorke' on page 11 undefined on input line 126.
I don't get the Problem.
Thank you for help

Typo: fig:serviceWorker vs. fig:serviceWorke
\documentclass{article}
\usepackage{graphicx}
\begin{document}
...wie in der Abbildung: \ref{fig:serviceWorker} zu sehen ist.
\begin{figure}[htbp]
\includegraphics[width=\textwidth]{example-image-duck}
\caption{Service Worker Architektur [6] (S.24)}%
\label{fig:serviceWorker}
\end{figure}
\end{document}

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}

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.

Latex quetion "Missing $ inserted" [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 8 years ago.
Improve this question
I want to write this simple equation in latex
2/|w|
In which |w| is the norm of w,,
I tried with
\frac{2}{\|w\|}
And get error "Missing $ inserted"
then I use this
\frac{2}{$\|w\|$}
And still get same error..
Does someone know how to solve this problem??
You are getting that error because LaTeX recognized this as being part of an equation and tried to correct it automagically. Unfortunately that rarely works well. You need to tell LaTeX that this is an equation.
To round out #nicoguaro's answer, use this form for equations that will be numbered and stand alone in the text:
\begin{equation}
\frac{2}{\left| w \right|}
\end{equation}
Or, use this form for equations that form part of a sentence:
blah blah $\frac{2}{\left| w \right|}$ blah blah.
Are this expression inside a mathematical environment like
\begin{equation}
...
\end{equation}
or $ $, \( \), \[ \] ?
The expression can be written as (using \[ \])
\[\frac{2}{\vert w \vert}\]
or just
\[\frac{2}{| w |}\]
You can see this book in Wikibooks. You need to specify that the whole expression is a mathematical expression enclosing it in its delimiters.

Frustration with fancyhdr [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have the following tex document:
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[usenames,dvipsnames]{color}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{lipsum}
\usepackage[left=2cm,top=3cm,right=1.5cm,bottom=2cm]{geometry}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
\renewcommand{\subsectionmark}[1]{\markright{\thesubsection}{}}
\usepackage[Lenny]{fncychap}
\usepackage{thumbpdf}
\usepackage[colorlinks]{hyperref}
\setlength\marginparwidth{1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LO,L]{Book template}
\fancyhead[RO,R]{\rightmark}
\fancyfoot[CO,C] {\thepage}
\begin{document}
\chapter{Chapter Intro}
\lipsum
\chapter{Chapter with subsections}
\section{section foo}
\lipsum
\subsection{subsection bar}
\lipsum
\end{document}
A sample can be viewed at http://www.mediafire.com/?0m5mnka32kj
On the top right:
How to make it show the chapter title if there is no section, as on page 2?
How to make it show the section title and nothing but the section title (no numbers, no subsections, subsubsections, etc) if there is an active section, as it's the case on page 4?
Thanks
You are almost there!
The following two marks should do the trick:
\renewcommand{\chaptermark}[1]{\markright{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}{}}
Be sure to move them to to a position after \pagestyle{fancy}. Also be sure to remove the custom \subsectionmark, unless you want to use some subsection information in the headers.

How can I start pagenumbers, where the first section occurs in LaTex? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This question is related to the post about having abstract at the titlepage.
I want to reset the page numbering at the given section.
You can also reset page number counter:
\setcounter{page}{1}
However, with this technique you get wrong page numbers in Acrobat in the top left page numbers field:
\maketitle: 1
\tableofcontents: 2
\setcounter{page}{1}
\section{Introduction}: 1
...
I use
\pagenumbering{roman}
for everything in the frontmatter and then switch over to
\pagenumbering{arabic}
for the actual content. With pdftex, the page numbers come out right in the PDF file.
To suppress the page number on the first page, add \thispagestyle{empty} after the \maketitle command.
The second page of the document will then be numbered "2". If you want this page to be numbered "1", you can add \pagenumbering{arabic} after the \clearpage command, and this will reset the page number.
Here's a complete minimal example:
\documentclass[notitlepage]{article}
\title{My Report}
\author{My Name}
\begin{document}
\maketitle
\thispagestyle{empty}
\begin{abstract}
\ldots
\end{abstract}
\clearpage
\pagenumbering{arabic}
\section{First Section}
\ldots
\end{document}

Resources