TransWikia.com

Having a literal "@" in TexMaker user commands

TeX - LaTeX Asked by Johnathan R on November 27, 2020

I am wanting to make a user command that serves as a one-click preamble.

documentclass[answers,10pt]{article}

usepackage[margin=1.in]{geometry}
input{mystyle.sty}

makeatletter
@ifclassloaded{exam}{
usepackage{color}
usepackage[english]{babel}
usepackage{amsmath,amssymb,amsthm,mathdots}
usepackage{graphicx}

definecolor{SolutionColor}{rgb}{0.1,0.3,1}

unframedsolutions
shadedsolutions
definecolor{SolutionColor}{rgb}{0.9,0.9,1}
renewcommand{solutiontitle}{textbf{Solution: }}
}{
newtheoremstyle{sol}
{3pt}
{3pt}
{}
{}
{bfseries}
{:}
{.5em}
{}
theoremstyle{sol}
newtheorem*{solution}{Solution}
}
makeatother

Above is that preamble. However, since "@" is the texmaker syntax for a wildcard, it defaults to that. I was wondering if there was a way to write a literal @ that will not be treated like a wildcard.

Thank you for any help.

One Answer

The case you show the test is always false, as you load article and test for exam, so it just makes the preamble larger and slower to execute?

You could just add the test block without makeatletter to the end of mystyle.sty so all you would need then is input{mystyle.sty} or to write it in more idiomatic latex, usepackage{mystyle}

Correct answer by David Carlisle on November 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP