Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing example-image.pdf #49

Closed
marc-medley opened this issue Feb 20, 2019 · 5 comments
Closed

missing example-image.pdf #49

marc-medley opened this issue Feb 20, 2019 · 5 comments
Assignees
Labels
documentation Related the technical documentation, the user manual, and the README files feature request good first issue

Comments

@marc-medley
Copy link

The file example-image.pdf referenced by examples/example.md is not present in /markdown/master/examples. Not sure if intentional or an oversight.

![example image](example-image.pdf "An example image from Martin Scharrer's mwe package")

see https://raw.githubusercontent.com/Witiko/markdown/master/examples/example.md

@Witiko
Copy link
Owner

Witiko commented Feb 20, 2019

Hello @marc-medley,

this exploits a special feature of TeX: if an image is not present in the current directory, TeX will search the TeX distribution using the kpathsea library. Loading LaTeX document classes and packages uses the same mechanism. As suggested by the image title, the image example-image.pdf is part of Martin Scharrer's mwe package. For example on my system, the image is located at /usr/local/texlive/2018/texmf-dist/tex/latex/mwe/example-image.pdf.

@marc-medley
Copy link
Author

@Witiko Hmm... Interesting TeX feature.

Works ok on my TeX setup. Although, not originally expect to be missing when previewing in a couple different markdown editors.

Suggestion: It would be generally helpful to a have a brief explanation (like a summary of the above reply) added to example.md. In many cases, double clicking the *.md files open a Markdown application would not have this TeX feature.

As an aside, I found that MacDown would render the example-image.pdf in the markdown preview, while Atom markdown-preview-enhanced would not. That said, the vector based example-image.pdf is likely preferred in a published high resolution LaTeX document rather than a example-image.png raster image.

Thanks for the info.

@Witiko Witiko self-assigned this Mar 7, 2019
@Witiko Witiko added documentation Related the technical documentation, the user manual, and the README files feature request good first issue labels Mar 7, 2019
@rafaelzemog
Copy link

Hello I want to ask if there is a way to add captions in the figure, markdown does not natively support captions and working with html creates a mess and do not render figures only displays the raw text. I want fo include my figures created in markdown in the \listoffigures

@Witiko
Copy link
Owner

Witiko commented May 5, 2019

Hello @rafaelzemog,

markdown supports image titles and the default LaTeX image renderer uses image titles for figure captions. The only disadvantage is that you cannot format the captions (e.g. use emphasis, code spans, or any other inline markup):

\documentclass{article}
\usepackage{markdown}
\begin{document}
\begin{markdown}

  ![example image](example-image.pdf "An example image from Martin Scharrer's mwe package")

\end{markdown}
\end{document}

Spectacle J12578

As we discussed in #32, you can prevent the images from floating as follows:

\usepackage{float}
\makeatletter
\renewcommand*{\fps@figure}{H}
\makeatother

In the future, please consider creating your own issue if no related issue is open. This will make it easier for other users to find an answer to the same question. 😉

@Witiko Witiko closed this as completed in 1a9f322 May 5, 2019
@rafaelzemog
Copy link

Thankyou for your support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related the technical documentation, the user manual, and the README files feature request good first issue
Projects
None yet
Development

No branches or pull requests

3 participants