PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Zweites Bild wird nicht angezeigt



Markus
26-05-2014, 18:09
Hallo,
ich bin ziemlicher Anfänger in Latex. Ich hab ein Problem bei dem ihr euch alle denken würdet oh man... ^^ aber leider hab ich nichts gefunden wie ich das Problem lösen könnte.
Zum Problem:
Ich wollte zwei bilder in mein Protokoll mit rein nehmen. Aber das zweite Bild wird in der PDF nicht angezeigt, besser noch, mein protokoll wird mit diesem zweiten bild gar nicht erst kompiliert. Wenn ich das Bild aber auskommentiere, dann macht er alles wie er soll...
Also das ist meine Hauptseite:

\documentclass[a4paper]{scrreprt}

\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage[pdftex]{graphicx}
\usepackage[absolute]{textpos}
\usepackage[onehalfspacing]{setspace}
\usepackage{anysize}
\usepackage{float}
\usepackage{setspace}
\usepackage{fancyhdr}
\pagestyle{empty}
\pagestyle{fancy}

%Kopf- und Fußzeile anfang
\lhead{}
\chead{}
\rhead{}
\renewcommand{\headrulewidth}{0.0pt}

\lfoot{\leftmark}
\cfoot{ }
\rfoot{\thepage}
%Kopf- und Fußzeile ende

\setcounter{chapter}{3} % Kapitelzahl eingeben
\setcounter{page}{15} % Seitenzahl eingeben

\begin{document}


%\include{experiment1}

%\include{experiment2}

\include{experiment3}

%\include{experiment4}

%\include{experiment5}

%\include{experiment6}

\include{summary}

\include{references}

\end{document}

Und das ist mein fehlerhafter code:

\chapter{Bridge Circuit}
\thispagestyle{fancy}

\section{Measurement Results and Data Evaluation}

It is to determine the resistance...

%Hier klappt es
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{wheatstone_bridge.jpg}
\caption{Circuit diagram of the used Wheatstone Bridge with the variable resistance decade box, the searched resistance $R_x$, the zero indicator and the Multi-Turn potentiometer.}
\end{figure}

This special Wheatstone Bridge...

%Hier klappt es nicht
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{bridge.jpg}
\caption{Standard Wheatstone Bridge with the resistances $R_1$, $R_2$, $R_3$ and $R_4$. [1]}
\end{figure}

Ich hoffe ihr könnt mir weiter helfen.
Gruß Markus

rstuby
26-05-2014, 20:41
So können wir dein Beispiel ja nicht ausprobieren, weil wir die ganzen include-Dateien und insbesondere die beiden Bilder nicht haben.
Versuch doch mal, ob folgendes Minimalbeispiel bei dir durchläuft:



\documentclass{scrreprt}

\usepackage[pdftex]{graphicx}

\begin{document}

\chapter{Bridge Circuit}

\section{Measurement Results and Data Evaluation}

It is to determine the resistance...

%Hier klappt es
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{wheatstone_bridge.jpg}
\caption{Circuit diagram of the used Wheatstone Bridge with the variable resistance decade box, the searched resistance $R_x$, the zero indicator and the Multi-Turn potentiometer.}
\end{figure}

This special Wheatstone Bridge...

%Hier klappt es nicht
\begin{figure}[h]
\centering
\includegraphics[scale=0.5]{bridge.jpg}
\caption{Standard Wheatstone Bridge with the resistances $R_1$, $R_2$, $R_3$ and $R_4$. [1]}
\end{figure}

\end{document}

oder nimm auch noch mal die Option pdftex bei graphicx raus, die ist normalerweise nicht nötig. Wenn das so funktioniert und beide Bilder einbindet, tust du nacheinander die Pakete und Einstellungen aus deinem Originaldokument ins Minimalbeispiel rein, probierst jedes Mal aus, und dann siehst du ja, woran es hapert.
Wenn der Fehler auch bei diesem Beispiel auftritt, stell uns mal die Bilder zur Verfügung, damit wir es richtig ausprobieren können.

Markus
26-05-2014, 21:49
Hi, danke schonmal für die Antwort, das Minimalbeispiel funktioniert schon nicht... Ich habe es so kopiert unter einem neuen Namen gespeichert und auf "Schnelles Übersetzen" geklickt. Texmaker startet zwar das kompillieren, aber es wird keine PDF erzeugt und im log steht auch keine fehlermeldung.Auch wenn ich dazu pdftex rausnehme klappt es nicht. Wenn ich aber das zweite bild auskommentiere (den ganzen block) dann macht er es ganz normal. Irgendwie komisch :/
Ich glaube auch langsam nicht mehr dass es am code liegt, ich hab die dateien jetzt mal meinem laborpartner geschickt und bei ihm klappt es ganz normal...
Gruß Markus

Donalduck
26-05-2014, 22:08
Zeig doch mal dein log her.

Markus
26-05-2014, 22:27
LOG:

LOG FILE :
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2014.5.6) 26 MAY 2014 23:24
entering extended mode
**test.tex
("C:\Users\Public\Documents\uni\Grundpraktikum Physik 2\Protokolle\Resistance M
easurement\test.tex"
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrreprt.cls"
Document Class: scrreprt 2013/12/19 v3.12 KOMA-Script document class (report)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrkbase.sty"
Package: scrkbase 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-dependent b
asics and keyval usage)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrbase.sty"
Package: scrbase 2013/12/19 v3.12 KOMA-Script package (KOMA-Script-independent
basics and keyval usage)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrlfile.sty"
Package: scrlfile 2013/12/19 v3.12 KOMA-Script package (loading files)
Package scrlfile, 2013/12/19 v3.12 KOMA-Script package (loading files)
Copyright (C) Markus Kohm
))) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\tocbasic.sty"
Package: tocbasic 2013/12/19 v3.12 KOMA-Script package (handling toc-files)
)
Package tocbasic Info: omitting babel extension for `toc'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `toc' on input line 117.
Package tocbasic Info: omitting babel extension for `lof'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lof' on input line 118.
Package tocbasic Info: omitting babel extension for `lot'
(tocbasic) because of feature `nobabel' available
(tocbasic) for `lot' on input line 119.
Package tocbasic Info: defining new hook before heading of `' on input line 112
3.
Class scrreprt Info: File `scrsize11pt.clo' used instead of
(scrreprt) file `scrsize11.clo' to setup font sizes on input line 165
5.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrsize11pt.clo"
File: scrsize11pt.clo 2013/12/19 v3.12 KOMA-Script font size class option (11pt
)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\typearea.sty"
Package: typearea 2013/12/19 v3.12 KOMA-Script package (type area)
Package typearea, 2013/12/19 v3.12 KOMA-Script package (type area)
Copyright (C) Frank Neukam, 1992-1994
Copyright (C) Markus Kohm, 1994-
\ta@bcor=\skip41
\ta@div=\count79
\ta@hblk=\skip42
\ta@vblk=\skip43
\ta@temp=\skip44
\footheight=\skip45
Package typearea Info: These are the values describing the layout:
(typearea) DIV = 10
(typearea) BCOR = 0.0pt
(typearea) \paperwidth = 597.50793pt
(typearea) \textwidth = 418.25555pt
(typearea) DIV departure = -6%
(typearea) \evensidemargin = 17.3562pt
(typearea) \oddsidemargin = 17.3562pt
(typearea) \paperheight = 845.04694pt
(typearea) \textheight = 595.80026pt
(typearea) \topmargin = -25.16531pt
(typearea) \headheight = 17.0pt
(typearea) \headsep = 20.40001pt
(typearea) \topskip = 11.0pt
(typearea) \footskip = 47.6pt
(typearea) \baselineskip = 13.6pt
(typearea) on input line 1330.
)
\c@part=\count80
\c@chapter=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\abovecaptionskip=\skip46
\belowcaptionskip=\skip47
\c@pti@nb@sid@b@x=\box26
\c@figure=\count87
\c@table=\count88
\bibindent=\dimen102
) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count89
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Users\Public\Documents\uni\Grundpraktikum Physik 2\Protokolle\Resistance M
easurement\test.aux")
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count90
\scratchdimen=\dimen105
\scratchbox=\box27
\nofMPsegments=\count91
\nofMParguments=\count92
\everyMPshowfont=\toks15
\MPscratchCnt=\count93
\MPscratchDim=\dimen106
\MPnumerator=\count94
\makeMPintoPDFobject=\count95
\everyMPtoPDFconversion=\toks16
)
Chapter 1.
<wheatstone_bridge.jpg, id=1, 493.0922pt x 333.49594pt>
File: wheatstone_bridge.jpg Graphic file (type jpg)
<use wheatstone_bridge.jpg>
Package pdftex.def Info: wheatstone_bridge.jpg used on input line 16.
(pdftex.def) Requested size: 246.54549pt x 166.74756pt.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <10.95> on input line 17.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 17.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 17.
!pdfTeX error: pdflatex.exe (file C:/Users/Public/Documents/uni/Grundpraktikum
Physik 2/Protokolle/Resistance Measurement/bridge.jpg): reading JPEG image fail
ed (no JPEG header found)
==> Fatal error occurred, no output PDF file produced!

Markus
26-05-2014, 22:41
Das Problem ist gelöst...
Ich hab das bild aus dem internet geladen.
Jetzt hab ich es nochmal in paint geöffnet und unter einem anderen namen gespeichert und jetzt läuft es.
Aber verstehen tue ich es nicht, besonders weil es ja mit dem bild auch bei meinem kollegen funktioniert hat.
Wenn ihr wisst woran das liegen könnte würde ich mich freuen es zu erfahren, wenn nicht dann nicht.
Aber ich danke euch für euro Hilfe.
Gruß Markus

Markus
26-05-2014, 22:43
Aber ich danke euch für euro Hilfe.


Oh Gott, blöde europawahl :D:D:D ich meine natürlich eure Hilfe

bobmalaria
26-05-2014, 22:48
da haben wir ja schon den salat


Physik 2/Protokolle/Resistance Measurement/bridge.jpg): reading JPEG image fail
ed (no JPEG header found)

da scheint was mit dem bild nicht zu stimmen. also das bild eventuell nochmal in einem grafikprogramm öffnen und nochmals als jpg abspeichern/exportieren.

übrigens kann tex nicht sehr gut mit leerzeichen in dateinamen und pfaden umgehen. deshalb lade im zweifel noch das


\usepackage[space]{grffile}

paket. dann sollte es recht zuverlässig auch mit leerzeichen in den dateinamen gehen.

übrigens, bei \begin{figure}[h] willst du bestimmt erreichen das das bild nicht so viel gleitet. das kann aber unerwünschte ergebnisse brigen wenn man nur eine option angibt. besser ist \begin{figure}[!htb]

sollten die bilder dann immer noch an ungewünschter stelle erscheinen hiflt das

\usepackage{placeins}
an der stelle über die ein bild nicht drüber rutschen soll, schreibst du dann einfach
\FloatBarrier und dann wird das bild spätestens an dieser stelle ausgegeben. das kann zu hässlichen seitenumbrüchen führen. also eher sparsam einsetzen.

Markus
26-05-2014, 22:54
vielen vielen dank für die nützlichen tipps