2

I have this code:

\documentclass[]{memoir}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{contour}
\contourlength{.4pt}
\usepackage{shadowtext}
\usepackage{contour}

\begin{document}
\shadowoffsetx{0pt}
\shadowoffsety{-.2pt}
\shadowcolor{red}
    \resizebox*{100mm}{!}{\shadowtext{\MakeUppercase{\textbf{the text}}}}
\end{document}

I need to add a contour to the text as well, but it won't compile no matter where I put in the \contour{} command. Please note that I use xelatex.

Help?

2
\documentclass[]{memoir}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{contour}
\contourlength{.4pt}
\usepackage{shadowtext}
\usepackage{contour}

\begin{document}
\shadowcolor{red}
\shadowoffsetx{0pt}
\shadowoffsety{-.2pt}
\resizebox*{100mm}{!}{\contour{blue}{\shadowtext{\textbf{\uppercase{the test}}}}}
\end{document}

Works for me. It complains, but apparently still renders the result you're looking for (I think).

enter image description here

EDIT: To be clear, run

xelatex -interaction=batchmode -halt-on-error <yourfile>

to compile.

  • Hurm, xelatex -interaction=batchmode -halt-on-error mwe.tex gives me no output files? EDIT: It appears it gives me mwe.log and mwe.aux but no PDF files. – Kristian Nordestgaard Aug 10 '17 at 18:41
  • EDIT 2: Appears I can just plow through with plain xelatex. Odd. – Kristian Nordestgaard Aug 10 '17 at 18:49
2

I had to do \shadowtext{\contour{... to get it to work. The other way round relaxed the offsety parameter, leaving it undefined for shadowtext after contour did its multiple font shape iterations.

Removed resizebox as well since it pixellated a lot, so used scaling instead, for smoother lines.

base of T

General font effects are possible with those two packages:

Example font effects

MWE

\documentclass{article}
\usepackage[svgnames]{xcolor}
\usepackage{fontspec}
\setmainfont{Noto Serif}[Scale=3]
\usepackage{contour}
\usepackage{shadowtext}


\begin{document}
\contourlength{1.4pt}
\shadowcolor{blue}
\shadowoffsetx{1.52pt}
\shadowoffsety{1.52pt}
\Huge
\shadowtext{%
\contour[32]{yellow}{%
\textbf{\uppercase{the test}}
}%
}%

\bigskip

\contourlength{0.4pt}
\color{yellow}
\shadowcolor{blue}
\shadowoffsetx{0.52pt}
\shadowoffsety{0.52pt}
\Huge
\shadowtext{%
\contour[24]{red}{%
\textbf{\uppercase{the test}}
}%
}%

\bigskip

\contourlength{0.8pt}
\color{Magenta}
\shadowcolor{blue!40}
\shadowoffsetx{4.52pt}
\shadowoffsety{2.52pt}
\Huge
\shadowtext{%
\contour[24]{red}{%
some text
}%
}%


\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.