Comments (9)
Can you give a minimal example that causes the problem?
from minted.
I will do it in 1 or 2 hours. No problem.
from minted.
Ok, this is the test:
\documentclass[12pt]{book} % Default font size is 12pt, it can be changed here
\usepackage[utf8]{inputenc}
\usepackage[OT1]{fontenc}
\usepackage[francais]{babel}
\usepackage[default]{sourcesanspro}
\usepackage{minted}
\newminted{go}{}
\begin{document}
\chapter{Exemple 1 with fig}
\section{A figure test}
Note the caption font
\begin{figure}[H]
\caption{This is a test}
\end{figure}
\section{A minted listing}
Check caption, font is not opensans, but TTF Times (not found on Linux that uses Nimbus Time)
\begin{listing}[H]
\begin{gocode}
var a int
\end{gocode}
\caption{A golang code}
\end{listing}
\end{document}
I compile this with:
latex -shell-escape test.tex
Resulting ps:
- Figure 1.1 => good font (open sans)
- Listing 1 => Times roman font (not good)
from minted.
I found a workaround for now:
\usepackage[font=small]{caption}
Best display with:
\usepackage[font=small,labelfont=bf]{caption}
So, the only problem is that figures uses the document font, not minted listings.
from minted.
Note: I remove any other not embed Times Roman problem using:
\usepackage{pslatex}
But the listing label remains if we don't use caption package
from minted.
The problem is that the listing
float is created using the float
package, which doesn't provide support for easily changing fonts. (To change fonts, you'd have to redefine some of the styles defined at the end of the package.) The solution would be to use the newfloat
package, which is part of the caption
bundle. But that may be problematic due to backwards compatibility issues. I will have to look into various options for dealing with this while still maintaining acceptable backwards compatibility.
from minted.
No problem, at this time I use the workarounds that I gave in my last comments (pslatex and caption option). But yes, that could be cool if you've got a natural fix :)
Anyway, thanks for your help
from minted.
BTW: I found why my document has got Times references... that was an eps file generated by graphviz...
from minted.
There is now a newfloat
package option that uses newfloat
rather than float
to create the listing
environment. This provides better compatibility with the caption
package.
from minted.
Related Issues (20)
- importing mathtools after minted gives errors in amsmath.sty HOT 2
- Passing additional flags to `pygmentize` / Using local lexers with the `-x` flag HOT 3
- "bgcolor" option is not in the right place in the documentation
- Only allow page break on a blank line HOT 2
- Trying to get `\inputminted` works with variable arguments HOT 14
- `\minted@opt@quote` prevents expansion too much HOT 5
- [Feature Request] Allow arbitrary or tagged line ranges HOT 1
- Passing newlines via `+v` argument causes error in 2.7 HOT 5
- Use a \def macro as the value for the style option HOT 3
- Update the options forwarded to `fvextra` HOT 1
- breakautoindent option doesn't work with some languages HOT 3
- Custom lexer no longer worked in my computer. HOT 6
- Make `langlinenos` with with `\inputminted` HOT 2
- `\mintinline{cpp}{#include}` in section title results in error HOT 12
- Leading Chinese characters introduce unexpected boxes HOT 5
- Didn't receive error message that fvextra was not installed HOT 2
- Minted ignores fontfamily setting HOT 4
- Font settings (migrating from lst-listings) HOT 12
- clearing `\verbatim@nolig@list` does not allow for code ligatures HOT 2
- Confused by arbitrary failure HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minted.