Markdown in Latex einbinden
Markdown in Latex einbinden
Hallo alle zusammen,
ich habe vor kurzem angefangen meine statistischen Auswertungen in R zu machen und in dem Zug Markdown entdeckt. Jetzt würde ich wahnsinnig gerne die mit Markdown erstellten Grafiken in mein Tex-Dokument einbinden.
Ich habe gelesen, dass es ein Package "markdown" gibt, aber das funktioniert bei mir irgendwie nicht. Ich weiß nicht, was ich da falsch mache.
Hat vielleicht jemand eine Lösung?
Vielen Dank schonmal.
Liebe Grüße,
Nadine
ich habe vor kurzem angefangen meine statistischen Auswertungen in R zu machen und in dem Zug Markdown entdeckt. Jetzt würde ich wahnsinnig gerne die mit Markdown erstellten Grafiken in mein Tex-Dokument einbinden.
Ich habe gelesen, dass es ein Package "markdown" gibt, aber das funktioniert bei mir irgendwie nicht. Ich weiß nicht, was ich da falsch mache.
Hat vielleicht jemand eine Lösung?
Vielen Dank schonmal.
Liebe Grüße,
Nadine
Erforderliche Details
Das wissen wir auch nicht, weil wir nicht sehen können, was Du machst.Nadine.B.90 hat geschrieben:[…] Ich weiß nicht, was ich da falsch mache. […]
Das wird sich zeigen, wenn wir sehen können, was Du machst.Nadine.B.90 hat geschrieben:[…] Hat vielleicht jemand eine Lösung? […]
Grafiken lassen sich (in den Formaten EPS, JPG, PDF oder PNG) nachträglich auch immer mit »graphicx« einbinden. Bezüglich »markdown« kann ich wegen Mangel an Erfahrung nichts sagen. Ein Blick in die Anleitung kann nicht schaden. "Funktioniert nicht" ist eine denkbare schlechte Problembeschreibung. Da muss schon etwas Konkretes her.
Ich wollte eigentlich erstmal ausprobieren das Beispiel von der Website bei mir zum Laufen zu bringen:
https://de.overleaf.com/latex/examples/ ... drnpcpnwrm
Er meckert aber immer bzgl. der 1. Zeile:
"!LaTeX Error: Two \documentclass or \documentstyle commands. "
Dementsprechend scheint er mit dem Package ein Problem zu haben.
https://de.overleaf.com/latex/examples/ ... drnpcpnwrm
Er meckert aber immer bzgl. der 1. Zeile:
"!LaTeX Error: Two \documentclass or \documentstyle commands. "
Dementsprechend scheint er mit dem Package ein Problem zu haben.
- Stefan Kottwitz
- Admin
- Beiträge: 2752
- Registriert: Di 8. Jul 2008, 00:39
- Kontaktdaten:
Hallo,
ich verwende auch Markdown in LaTeX-Dokumenten. Ohne nähere Informationen (Fehlermeldungen, Warnungen, .log-Datei) kann man kaum etwas vermuten.
Evtl. schau hier: http://mirrors.ctan.org/macros/generic/ ... kdown.html unter "Requirements" und "1.3.3 Using LaTeX". (--shell-escape aktivieren, evtl. lualatex nehmen)
Stefan
ich verwende auch Markdown in LaTeX-Dokumenten. Ohne nähere Informationen (Fehlermeldungen, Warnungen, .log-Datei) kann man kaum etwas vermuten.
Evtl. schau hier: http://mirrors.ctan.org/macros/generic/ ... kdown.html unter "Requirements" und "1.3.3 Using LaTeX". (--shell-escape aktivieren, evtl. lualatex nehmen)
Stefan
Hmm, wieso funktioniert denn das Beispiel bei dir, aber bei mir nicht?
Ich nutze den Texmaker mit einer mikTex-Distibution. Es funktioniert auch alles einwandfrei, nur eben Markdown läuft nicht.
Ich kann gerne mal den Inhalt der log.Datei hier posten, ich selbst kann damit nämlich leider momentan nicht wirklich was anfangen.
Die erste Fehlermeldung in der log.Datei ist folgende;
Dann geht es weiter unten mit jeder Menge weiterer Fehlermeldungen weiter, die aber glaube ich damit zusammenhängen, dass er das Package irgendwie nicht laden kann:

Ich nutze den Texmaker mit einer mikTex-Distibution. Es funktioniert auch alles einwandfrei, nur eben Markdown läuft nicht.
Ich kann gerne mal den Inhalt der log.Datei hier posten, ich selbst kann damit nämlich leider momentan nicht wirklich was anfangen.
Die erste Fehlermeldung in der log.Datei ist folgende;
! LaTeX Error: Two \documentclass or \documentstyle commands. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.1 \documentclass{ article} The document may only declare one class.
Overfull \hbox (3.30536pt too wide) in paragraph at lines 41--42 []\T1/lmr/m/n/10 (Markdown ex-am-ple text adapted from $\T1/lmtt/m/n/10 http : / / www . unexpected-[]vortices . [] ! You can't use `macro parameter character #' in vertical mode. l.73 # . first item Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.74 # . second item Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.75 # . third item Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in vertical mode. l.79 # Let me re-iterate ... Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.87 # Let me re-iterate ... Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in vertical mode. l.92 # ## An h3 header ### Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in vertical mode. l.92 ## # An h3 header ### Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in vertical mode. l.92 ### An h3 header ### Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.92 ### An h3 header # ## Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.92 ### An h3 header ## # Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! You can't use `macro parameter character #' in horizontal mode. l.92 ### An h3 header ### Sorry, but I'm not programmed to handle this case; I'll just pretend that you didn't ask for it. If you're in the wrong mode, you might be able to return to the right one by typing `I}' or `I$' or `I\par'. ! Missing $ inserted. <inserted text> $ l.117 ...to [a website](http://foo.bar). And now^ [with `markdown` v2.4] you... I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. ! Missing $ inserted. <inserted text> $ l.118 I've inserted a begin-math/end-math symbol since I think you left one out. Proceed, with fingers crossed. Overfull \hbox (231.20518pt too wide) in paragraph at lines 117--118 []\T1/lmr/m/n/10 Here's a link to [a web-site](http://foo.bar). And now$[]\OML/ lmm/m/it/10 with\OT1/lmr/m/n/10 `\OML/lmm/m/it/10 markdown\OT1/lmr/m/n/10 `\OML /lmm/m/it/10 v\OT1/lmr/m/n/10 2\OML/lmm/m/it/10 :\OT1/lmr/m/n/10 4]\OML/lmm/m/i t/10 youcanalsouseinlinedfootnoteswith\OT1/lmr/m/n/10 `\OML/lmm/m/it/10 inlineF ootnotes\OT1/lmr/m/n/10 `\OML/lmm/m/it/10 :$ [] LaTeX Warning: Reference `fig:exampleimage' on page 1 undefined on input line 1 33. [1 {C:/Users/LocalAdmin/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] No file Markdown.bbl. [2] (Markdown.aux) LaTeX Warning: There were undefined references. LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. ) ) ) Here is how much of TeX's memory you used: 4175 strings out of 492969 75578 string characters out of 3135831 132524 words of memory out of 3000000 7971 multiletter control sequences out of 15000+200000 45148 words of font info for 43 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 49i,4n,48p,814b,212s stack positions out of 5000i,500n,10000p,200000b,50000s {C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/lm/lm-mathex.enc}{C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/lm/lm-ec.enc}{C:/Program Files/MiKTeX 2.9/fon ts/enc/dvips/lm/lm-rm.enc}{C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/lm/lm-ma thit.enc}<C:/Program Files/MiKTeX 2.9/fonts/type1/public/lm/lmbx10.pfb><C:/Prog ram Files/MiKTeX 2.9/fonts/type1/public/lm/lmex10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/lm/lmmi10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/p ublic/lm/lmr10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/lm/lmr12.pfb ><C:/Program Files/MiKTeX 2.9/fonts/type1/public/lm/lmr17.pfb><C:/Program Files /MiKTeX 2.9/fonts/type1/public/lm/lmr7.pfb><C:/Program Files/MiKTeX 2.9/fonts/t ype1/public/lm/lmtt10.pfb> Output written on Markdown.pdf (2 pages, 154724 bytes). PDF statistics: 49 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000)
Was genau hast Du denn gemacht?
Nur fürs Protokoll und zum Nachvollziehen für Dich.
Ich habe von https://de.overleaf.com/latex/examples/ ... drnpcpnwrm das folgende, kleinere Beispiel extrahiert.
Das habe ich bei mir als mdtest.tex abgespeichert. Dann habe ich über die Kommandozeile https://texwelt.de/wissen/fragen/3461/w ... m-terminal
ausgeführt. Bereits nach einem Durchlauf bekam ich ohne Fehlermeldungen eine schöne PDF. Das --shell-escape ist dabei wichtig. Sonst bekomme ich eine Fehlermeldung, allerdings ist die anders als Deine. Zum Thema shell-escape im Editor gibt es https://texwelt.de/wissen/fragen/10341/ ... nem-editor
Alternativ kannst Du auch gleich LuaLaTeX nehmen und
laufen lassen.
Mein System ist ein aktuelles MikTeX auf Windows 10. (Heute morgen alles aktualisiert.)
Kannst Du die Schritte bitte mit diesem kleinen Beispiel mal durchführen? Wenn es Fehler gibt, lade bitte ruhig die ganze .log-Datei hoch.
Nur fürs Protokoll und zum Nachvollziehen für Dich.
Ich habe von https://de.overleaf.com/latex/examples/ ... drnpcpnwrm das folgende, kleinere Beispiel extrahiert.
\documentclass{article} \usepackage{markdown} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \begin{document} (Markdown example text adapted from \url{http://www.unexpected-vortices.com/sw/rippledoc/quick-markdown-example.html}) \begin{markdown} An h1 header ============ Paragraphs are separated by a blank line. 2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists look like: * this one * that one * the other one > Block quotes are > written like so. > > They can span multiple paragraphs, > if you like. Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all in chapters 12--14"). Three dots ... will be converted to an ellipsis (only if you enable the `smartEllipses` option). # Another h1 Lorem ipsum dolor. ## H2 Sit amet. \end{markdown} \end{document}
pdflatex --shell-escape mdtest
Alternativ kannst Du auch gleich LuaLaTeX nehmen und
lualatex mdtest
Mein System ist ein aktuelles MikTeX auf Windows 10. (Heute morgen alles aktualisiert.)
Kannst Du die Schritte bitte mit diesem kleinen Beispiel mal durchführen? Wenn es Fehler gibt, lade bitte ruhig die ganze .log-Datei hoch.
Hmm, ok es war wohl ein Glückgriff, dass es funktioniert hatte. Ich habe es mit meiner Statistik-Datei versucht und das hat nicht geklappt, und als ich das Beispiel wieder reinkopiert hatte, funktionierte das auf einmal doch wieder nicht, obwohl ich es über die Kommandozeile mit "--shell-escape" versucht hatte.
Ich kopiere hier mal das gesamte Log-File rein:
Ich kopiere hier mal das gesamte Log-File rein:
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6880 64-bit) (preloaded format=pdflatex 2018.11.22) 18 MAR 2019 15:06 entering extended mode **./Markdown.tex (Markdown.tex LaTeX2e <2018-04-01> patch level 5 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo" File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count80 \c@section=\count81 \c@subsection=\count82 \c@subsubsection=\count83 \c@paragraph=\count84 \c@subparagraph=\count85 \c@figure=\count86 \c@table=\count87 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\markdown\markdown.sty ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty" Package: keyval 2014/10/28 v1.15 key=value parser (DPC) \KV@toks@=\toks14 ) (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\url\url.sty \Urlmuskip=\muskip10 Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc. ) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphicx.sty" Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\graphics.sty" Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\trig.sty" Package: trig 2016/01/03 v1.10 sin cos tan (DPC) ) ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-cfg\graphics.cfg" File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 99. ("C:\Program Files\MiKTeX 2.9\tex\latex\graphics-def\pdftex.def" File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex )) \Gin@req@height=\dimen103 \Gin@req@width=\dimen104 ) ("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty" Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC) ) (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\fancyvrb\fancyvrb.sty Package: fancyvrb 2019/01/15 Style option: `fancyvrb' v3.2a <2019/01/15> (tvz) \FV@CodeLineNo=\count88 \FV@InFile=\read1 \FV@TabBox=\box26 \c@FancyVerbLine=\count89 \FV@StepNumber=\count90 \FV@OutFile=\write3 ) (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\csvsimple\csvsimple.s ty Package: csvsimple 2016/07/01 version 1.20 LaTeX CSV file processing (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\pgf\utilities\pgfkeys .sty (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfke ys.code.tex \pgfkeys@pathtoks=\toks15 \pgfkeys@temptoks=\toks16 (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\generic\pgf\utilities\pgfke ysfiltered.code.tex \pgfkeys@tmptoks=\toks17 ))) (C:\Users\LocalAdmin\AppData\Roaming\MiKTeX\2.9\tex\latex\etoolbox\etoolbox.sty Package: etoolbox 2018/08/19 v2.5f e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count91 ) ("C:\Program Files\MiKTeX 2.9\tex\latex\tools\shellesc.sty" Package: shellesc 2016/06/07 v0.02a unified shell escape interface for LaTeX Package shellesc Info: Unrestricted shell escape enabled on input line 67. ) \csv@file=\read2 \c@csvinputline=\count92 \c@csvrow=\count93 \c@csvcol=\count94 \csv@out=\write4 ) (markdown.tex ! LaTeX Error: Two \documentclass or \documentstyle commands. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.1 \documentclass{ article} ? H The document may only declare one class. ?
Hast Du meine Beispieldatei von oben in einem neuen, leeren Ordner laufen lassen? Oder geht es hier um eine größere Datei? Bitte probier zunächst mein kleines Beispiel aus.
An der .log-Datei fällt mir auf, dass Deine Datei Markdown.tex heißt und dann später aus Gründen, die mir nicht ganz klar sind, ohne den Code gesehen zu haben, eine Datei namens markdown.tex geladen wird. Auf Windowssystemen sind Markdown.tex und markdown.tex aber die gleiche Datei (Windows ist nicht case sensitive), also versucht die Datei, sich selbst zu laden. Dabei ist es nicht verwunderlich, dass TeX sich über ein zweites \documentclass beschwert. Die Frage ist also, warum lädt die Datei markdown.tex. Das kann ich nur mit einem sogenannten Minimalbeispiel beantworten, das den Fehler mit so wenig Code wie möglich reproduziert. Lösch einfach alles aus dem Beispiel weg, bis der Fehler auch weg ist und füge dann die zuletzt gelöschten Codefetzen wieder ein. Überprüfe, dass der Fehler noch auftaucht und man das Beispiel nicht weiter verkürzen kann: Fertig.
An der .log-Datei fällt mir auf, dass Deine Datei Markdown.tex heißt und dann später aus Gründen, die mir nicht ganz klar sind, ohne den Code gesehen zu haben, eine Datei namens markdown.tex geladen wird. Auf Windowssystemen sind Markdown.tex und markdown.tex aber die gleiche Datei (Windows ist nicht case sensitive), also versucht die Datei, sich selbst zu laden. Dabei ist es nicht verwunderlich, dass TeX sich über ein zweites \documentclass beschwert. Die Frage ist also, warum lädt die Datei markdown.tex. Das kann ich nur mit einem sogenannten Minimalbeispiel beantworten, das den Fehler mit so wenig Code wie möglich reproduziert. Lösch einfach alles aus dem Beispiel weg, bis der Fehler auch weg ist und füge dann die zuletzt gelöschten Codefetzen wieder ein. Überprüfe, dass der Fehler noch auftaucht und man das Beispiel nicht weiter verkürzen kann: Fertig.