I want to generate a PDF from sphinx that is only black and white. The standard sphinx.sty uses \RequirePackage{color} and \RequirePackage{fancyvrb}.
If I just remove color, I get a whole list of errors. I could not find any reference in fancyvrb's documentation.
How can I achieve that (without rewriting the whole sphinx.sty)?
You can edit the conf.py and add addtions to the preamble before the build with custom LaTeX, so that sphinx will render colors as black. For example.
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
'preamble': r'''
\usepackage{titlesec}
\titleformat{\section}
{\color{black}\normalfont\Large\bfseries}
{\color{black}\thesection}{1em}{}
\titleformat{\subsection}
{\color{black}\normalfont\Large\bfseries}
{\color{black}\thesubsection}{1em}{}
\usepackage{hyperref}
\hypersetup{colorlinks=true,
linkcolor=black,
citecolor=black,
filecolor=black,
menucolor=black,
urlcolor=black,
bookmarksnumbered=true
}
'''
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
This will change all sections and subsections to black and change all your hyperlinks to black as well.
Related
came across FontAwesome icon package. When shifting through the documentation I cam across:
{\color{color-name} text and/or icon }
However, this does not seem to work for me. Anyone know what is the correct format for changing the colour of icons?
Thanks
EDIT:
\documentclass[border=0.1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{fontawesome5}
\usepackage[hidelinks]{hyperref}
\begin{document}
\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the first row of icons
\vspace{-\baselineskip} % Required for vertically aligning minipages
{\color{Blue} \icon{Globe}{12}{\href{someAddress}{someAdd}}}\\
\end{minipage}
\end{document}
if you want to use \href, you must load the hyperref package
you are opening one more { than you are closing
if you want to use an icon from fontawsome5, either use \fa<insert name here> or \faIcon{<insert name here>}, e.g. \fGlobe in your case.
\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{hyperref}
\usepackage{fontawesome5}
\begin{document}
\begin{minipage}[t]{0.275\textwidth} % 27.5% of the page width for the first row of icons
\vspace{-\baselineskip} % Required for vertically aligning minipages
{\color{Blue} \faGlobe \faIcon{globe} \href{someAddress}{someAdd} }\\
\end{minipage}
\end{document}
I'm a beginner to latex, I was writing an article. At the end when adding references. I did:
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
After compiling, the word "Reference" appears in pdf, and it is too big in size. I want its font size to be 12pt. How can I do that?
Using the titlesec package, you can temporarily change the size of section headings:
\documentclass[12pt]{article}
\usepackage{titlesec}
\begin{document}
test
\begingroup
\titleformat*{\section}{\fontsize{12pt}{14pt}\bfseries\selectfont}
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
\endgroup
\end{document}
I'm trying to use \texttt{...}, but I want to change the color it uses to gray. How would I do this?
You can use {\color{gray}\texttt{text}} to get gray typewriter font.
However if you want to use this to show some kind of code, it would be better to have a look at the listings package. This allows you to globally change the colour:
\documentclass{article}
\usepackage{xcolor}
\usepackage{listings}
\lstset{
basicstyle=\color{gray}\ttfamily
}
\begin{document}
{\color{gray}\texttt{text}}
\lstinline|text|
\end{document}
I am using Inkscape to convert images to Latex, so the text scales nicely. Using SaveAs pdf, with generate Latex ticked.
This creates a .pdf_tex file that contains something like this:
\begingroup%
\begin{picture}(1,1.18884212)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{Scapula.pdf}}%
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%
I would like to change the font size and possible also the font, so the text in all images is different from the body text. I think this is possible by e.g. redefining \smash within "picture", but I don't know how. Is this the correct approach? If so, any tips on how to do it?
With the etoolbox you could add the fontsize change to the picture environment:
\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{etoolbox}
\AtBeginEnvironment{picture}{\huge}
\begin{document}
\begingroup%
\begin{picture}(1,1.18884212)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{example-image.pdf}}%
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%
\end{document}
I created in Xfig a .fig file and now I have to add it to my Latex document. Can someone help me with this problem because I'm new in Latex and tried this code bellow but it doesen't work. I searched for various solutions but still I become this error.
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!htb]
\center{\includegraphics[width=2]{myfigure.fig}}
\end{figure}
\end{document}
I just want to center a figure on the page but the error is:
Cannot determine size of graphic in myfigure.fig (no Bounding Box).
The .fig file/format is not supported for inclusion into (La)TeX as an image. You need to export the image to a supported format via the File > Export dialog. Supported formats include Postscript, EPS as PDF stand-alone vector formats, combined files (vector + LaTeX for text) and many of the raster formats (like BMP, PNG and JPEG).
Also, use \centering to centre an image within the figure environment.