0

How would you modify the current code so that I can insert a small image as part of the centred header in the highlighted spot?

Thank you!

output

\documentclass[]{article}
\usepackage[margin=0in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath,amssymb}
\usepackage{booktabs}
\usepackage{blindtext}
\usepackage{pgfplots}
\usepackage{mathpazo}
\usepackage{framed}
\usepackage{mathtools}
\usepackage{pgfplots}
\usepackage{amsmath}
\newtheorem{theorem}{THEOREM}
\newtheorem{proof}{PROOF}
\usepackage{tikz}
\usepackage{amssymb}     
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\usepackage{color}
\usepackage[most]{tcolorbox}
\usepackage{color,xcolor}
\usepackage{booktabs,array}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{latexsym}
\usepackage{tikz-3dplot}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{arrows}
\usepgfplotslibrary{statistics}
\usetikzlibrary{shapes.multipart,shapes.geometric,calc,angles,positioning,intersections,quotes,decorations,babel,patterns,fit}
\usetikzlibrary{decorations.markings}
\begin{document}
% !TeX spellcheck = en_GB 
\setlength{\parindent}{0pt}
\begin{center}
\end{center}
%
\newpage
\newgeometry{left=0.8in,right=0.8in,top=1.0in, bottom=0.8in}
\fancyhf{}
\fancyhead[C]{\thepage}
\voffset = 0 cm
\pagestyle{fancy}
\definecolor{Elite}{RGB}{80,129,188}
\newcommand{\mymk}[1]{%
    \tikz[baseline=(char.base)]\node[anchor=south west, draw,rectangle, rounded corners, inner sep=2pt, minimum size=7mm, text height=2mm](char){\ensuremath{#1}} ;}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle,fill=Elite!50,inner sep=3pt] (char) {#1};}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\chead{{\LARGE \textcolor{Elite}{MATHS TEST}}
%   \includegraphics{No_calculator.png}}
XX
}
\setlength{\parindent}{0mm}
\setcounter{page}{2}
\cfoot{\LARGE\bf \textcolor{Elite}{\thepage}}
%--------------------------
\fontsize{14}{20}\selectfont
\begin{tcolorbox}[colframe=Elite,boxrule=1.3mm,colback=white,width=17cm,height=23.2cm,after=\hfill,segmentation style={draw=Elite,line width=3pt,solid}]
{\huge\bf \circled{1}}\quad QUESTION 1
\end{tcolorbox}
\newpage
\setlength{\fboxrule}{2pt}
\end{document}
  • 1
    You have it in your code already, but it is commented out: \includegraphics{...}. – AlexG Oct 25 '19 at 14:26
  • When I run this code with the \include.. bit re-instated, the text gets wiped for some reason. This is why I am seeing some adivce. – Will Kim Oct 25 '19 at 14:29
  • 1
    You may need to downscale the graphics: \includegraphics[height=2ex]{...} – AlexG Oct 25 '19 at 14:31
  • Thank you so much! You were right about having to downscale the image. – Will Kim Oct 25 '19 at 14:55
  • 1
    Please, don't use \bf in LaTeX. Two-letter font commands are obsolete by decades. More generally, you should clean up your preamble. You're loading things several times and sometimes in the wrong order. – cfr Oct 25 '19 at 14:57
1

I don't have a No calculator graphic file, but I made one from \faCalculator (fontawesome5) with the help of packages bbding and stackengine: enter image description here

\documentclass[]{article}
\usepackage[margin=0in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath,amssymb}
\usepackage{booktabs}
\usepackage{blindtext}
\usepackage{pgfplots}
\usepackage{mathpazo}
\usepackage{framed}
\usepackage{mathtools}
\usepackage{pgfplots}
\usepackage{amsmath}
\newtheorem{theorem}{THEOREM}
\newtheorem{proof}{PROOF}
\usepackage{tikz}
\usepackage{amssymb}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{booktabs,array}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{gensymb}
\usepackage{latexsym}
\usepackage{tikz-3dplot}
\usepackage[english]{babel}
\usepackage[autostyle]{csquotes}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{arrows}
\usepgfplotslibrary{statistics}
\usetikzlibrary{shapes.multipart,shapes.geometric,calc,angles,positioning,intersections,quotes,decorations,babel,patterns,fit}
\usetikzlibrary{decorations.markings}
\usepackage{fontawesome5, bbding, stackengine} 

\begin{document}
% !TeX spellcheck = en_GB
\setlength{\parindent}{0pt}
\begin{center}
\end{center}
%
\newpage
\newgeometry{left=0.8in,right=0.8in,top=1.0in, bottom=0.8in}
\fancyhf{}
\fancyhead[C]{\thepage}
\voffset = 0 cm
\pagestyle{fancy}
\definecolor{Elite}{RGB}{80,129,188}
\newcommand{\mymk}[1]{%
    \tikz[baseline=(char.base)]\node[anchor=south west, draw,rectangle, rounded corners, inner sep=2pt, minimum size=7mm, text height=2mm](char){\ensuremath{#1}} ;}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle,fill=Elite!50,inner sep=3pt] (char) {#1};}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\chead{{\LARGE \textcolor{Elite}{MATHS TEST\quad\stackinset{c}{}{c}{}{\textcolor{red}{\XSolidBrush}}{\scalebox{1.1}{\faCalculator}}}}}
\setlength{\parindent}{0mm}
\setcounter{page}{2}
\cfoot{\LARGE\bf \textcolor{Elite}{\thepage}}
%--------------------------
\fontsize{14}{20}\selectfont
\begin{tcolorbox}[colframe=Elite,boxrule=1.3mm,colback=white,width=17cm,height=23.2cm,after=\hfill,segmentation style={draw=Elite,line width=3pt,solid}]
{\huge\bf \circled{1}}\quad QUESTION 1
\end{tcolorbox}
\newpage
\setlength{\fboxrule}{2pt}

\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.