There are predefined functions somewhere such that when you use them in default theorem environments, their names appear in a normal (non-italicized) font. I want to be able to define my own functions and have this same effect. Here is an example of what I've been doing:  \documentclass{article} \usepackage{amsmath,amsthm,amssymb} \newtheorem{thm}{Theorem} \newcommand{\dom}[1]{\text{dom}{#1}}  \begin{document} \begin{thm} function has normal font: $\sin(0)$ \\ function does not have normal font: $\dom{f}$ \end{thm} \end{document}   How do I accomplish this?
20492
Mathematical operators, such as function names, should be set in roman type, not italics. Latex already has commands for some operators, including \max, \min, and \log.  How can I define additional such commands?
11225
I have a question about making an ending symbol.  It is a LaTex-default that every proof environment has an ending symbol. I want to make every theorem-alike environment such as the example environment have also an ending symbol. But how to manually set this up? Specifically, I want to make all these environments ended by a square symbol.  \newtheorem{thm}{Theorem} \newtheorem{lem}[thm]{Lemma} \newtheorem{cor}[thm]{Corollary} \newtheorem{pro}[thm]{Proposition} \newtheorem{assump}{Assumption} \newtheorem{axiom}{Axiom} \newtheorem*{conj}{Conjecture} \theoremstyle{definition} \newtheorem{defi}[thm]{Definition} \newtheorem{exam}{Example} \newtheorem{exer}{Exercise} \newtheorem*{rem}{Remark} \newtheorem*{notation}{Notation} \newtheorem*{note}{Note}   I am looking for, with gratitude, a comprehensive setup.
27760
The standard font used for \mathcal does not include any lowercase characters. The Comprehensive LaTeX Symbols List suggests redefining \mathcal to use Zapf Chancery. However I do not particularly like that font. For example the uppercase "I" is very hard do distinguish from the non-mathcal "I". Are there any good alternatives?
72176
I read many things about people wanting math mode in sans-serif font and doing crazy things with packages and options to get that, but I did not find anything that would simply make my math mode font non-italic.  Is there an (easy) way to set math mode font to be non-italic?  And is there a way to do that globally for the whole document?
115876
I have this:  function foo($a='apple', $b='brown', $c='Capulet') {     // do something }   Is something like this possible:  foo('aardvark', &lt;use the default, please&gt;, 'Montague');
73595
After posting  to the query , I thought about how to generalize (and simplify) the OP's setting, e.g., by using explicit theorem-like environments in the two columns.   In the following MWE, which employs the tabularx and amsthm packages, things work fine. (The framelines in the screenshot indicate the edges of the text block.) In the first tabularx environment, the first column is narrower than the second, and in the second tabularx environment, the situation is reversed. In both environments, the filler text that makes up the body of the "theorems" occupies the full width of the cell:    \documentclass{article} \usepackage[a4paper,margin=2.5cm,showframe]{geometry} \usepackage{tabularx} \newcolumntype{L}[1]{&gt;{\hsize=#1\hsize}X} \usepackage{lipsum}  \usepackage{amsthm}  %\usepackage{ntheorem}  \newtheorem{theorem}{Theorem}  \begin{document} \noindent % First column is narrower than second: \begin{tabularx}{\textwidth}{@{} L{0.8} | L{1.2} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &amp;   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx}  \bigskip\noindent % Now, first column is wider: \begin{tabularx}{\textwidth}{@{} L{1.2} | L{0.8} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &amp;   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx} \end{document}     However, if I comment out the instruction \usepackage{amsthm} and activate the instruction \usepackage{ntheorem} in the preceding MWE (and leave everything else unchanged), I get a rather different result: In the first tabularx environment, the text in the right-hand cell does not occupy the available horizontal space; in the second tabularx environment, both columns now take up the same width even as the width of the text in both cells is restricted to that of the second column.  Question: Have I encountered a bug in either ntheorem or tabularx, or did I set up the mechanism for generating X columns of varying widths incorrectly?  Some background information: The issue occurs with both TeXLive2019 and the current pre-release version of TeXLive2020. I use tabularx 2020/01/15 v2.11c, amsthm 2017/10/31 v2.20.4, and ntheorem Version 1.33 &lt;2011/08/15&gt;. AFAICT, the issue appears to be independent of the choice of document class.
102886
I am attempting to create a usable function within LaTeX such that its inputs are transformed mathematically. However, I cannot find any documentation that can perform such mathematical function definition.  Here is an example of what I am seeking:  Having defined a function entitled \myMathFunction which accepts only one parameter, the follow usage:  \myMathFunction{2}   should output 6 if the function is defined as follows: ({#1} * 5) - {#1}^2  Where {#1} is the parameter, and in the case of my example, is equal to 2.  Additionally, the function should be usable within a PSTricks plot. E.g.  \psplot[     algebraic,     linecolor   = red,     linewidth   = 1pt ]{0}{TwoPi} {\myMathFunction{x}}
110135
I'm a complete newbie to Latex, and I am trying to use it for creating small pdf images with equations. My requirements are:   Aligned equations Clear font (bold and italic) Minimal sized image in PDF format Searchable in PDF format   This version finally creates a small PDF without margins, but the problem I run into is with searching. For some fonts, I can't search for comma (in case I want to find "x,y". In some versions, the first letter of a word isn't searchable with the rest of the word, so "Sample" is not searchable. In some fonts, I can't search for a word ending in ff, the second f is not searchable. Is there an easy solution to this?  To create the file:  pdflatex --file-line-error --interaction=nonstopmode testcode.tex   Thank you so much!  \documentclass{amsart} \usepackage{txfonts} \usepackage[T1]{fontenc} \usepackage[margin=0pt]{geometry} \usepackage[active,tightpage]{preview} \usepackage{varwidth} \begin{document} \begin{preview} \begin{varwidth}{\linewidth} \begin{equation} \nonumber \begin{aligned} &amp;Example\_VAL_{x,y} &amp;&amp;= \sum\nolimits_{i=0}^{MARK\_n}VAL_{x,y,i} * VAL_i \\ &amp;Example\_VAL2_{x,y} &amp;&amp;= \sum\nolimits_{i=0}^{MARK\_n}VAL2_{x,y,i} * VAL_i \end{aligned} \end{equation} \end{varwidth} \end{preview} \end{document}   Latest version after help from Ulrike, and trying to simplify code writing for myself:  \documentclass[varwidth=\maxdimen,border=2pt]{standalone} \usepackage{luatex85} \usepackage{amsmath} \usepackage{unicode-math} \usepackage[italic]{mathastext} \setmainfont{TeX Gyre Termes} %Times clone \setmathfont{TeX Gyre Termes Math} %accompagning math.  \begin{document} \[ \nonumber\begin{aligned}         &amp;Example\_VAL_{x,y} &amp;&amp;= \sum\nolimits_{i=0}^{MARK\_n}VAL_{x,y,i} * VAL_{i}         \\         &amp;Example\_VAL2_{x,y} &amp;&amp;= \sum\nolimits_{i=0}^{MARK\_n}VAL2_{x,y,i} * VAL_{i}     \end{aligned} \] \end{document}   Curious how to get a slanted more normal font in the equation - without embedding myvar throughout.
74752
Is there a way to do underscripts? By "underscript" I mean a small font underneath the text object like limits or sums have. I don't want it to behave like a math operator though, where it is typeset as a subscript or underscript depending on the environment (like sums). I want there to always be an underscript in math environments with the possibility of adding a subscript in addition to the underscript. Is there anything like an \underscript{X}{a} command?  Is there even something like that that will only work in mathmode? I haven't been able to find it.
49271
I am happy with the great majority of what unicode-math does. But at times I find that I prefer a symbol the way it was before. With \varnothing and \complement, for example. In those cases I was able to save them under a different name before loading unicode-math, but this doesn't always work.  Right now I'm trying to access the \mathcal alphabet from plain LaTeX. How might I accomplish this?    Additional Question  I've been looking through unicode-math, trying to figure out where exactly the original \mathcal alphabet gets discarded, but I eventually gave up.  It would be interesting if someone could explain:   how/where the original \mathcal font is defined anyway, and what kind of 'switch' is thrown by unicode-math that makes it unavailable.
73111
In my macro file, I have certain theorem environments defined, for example.  \newtheorem{theorem}{Theorem} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary}  \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition}   Again, these lines are in my macros.sty file of shortcuts.  In the past, I have changed the numbering of theorem, etc... by using \numberwithin. I have recently learned that I can instead edit the \newtheorem line. For example, if I want results numbered according to section I can use  \newtheorem{theorem}{Theorem}[section]   My question now is about future situations when I have two documents, which both use the same macros.sty file, but in one document I want to number results by section and in the other document I want to number results by something else, say chapter.  How can I accomplish this without creating two different .sty files?   EDIT: I think I should add that I am looking for a way to do this without going back to \numberwithin. The reason for this is because \numberwithin doesn't seem to work well with the thmtools package.
106177
For equations in my document, I use the facilities of the  package. In order to make the equation numbers  more eye-catching, I want them to be in boldface and a little bit indented to the right, i.e. like this:    I've already tried redefining the internal amsmath macros \maketag@@@ or \tagform@. But both  \def\maketag@@@#1{\hbox{\m@th\bfseries#1\hspace{3mm}}}   and  \def\tagform@#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}\hspace{3mm}}   also change the references produced by \eqref, as this macro internally uses \tagform@ to produce its output. These references should keep their default appearance, however, as I don't need the prominent formatting in the running text.  The most promising approach I've tried so far is to redefine \print@eqnum:  \def\mytagform#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}\hspace{3mm}} \def\print@eqnum{\mytagform\theequation}   This redefinition doesn't affect the \eqref references. Sadly though, it seems to work only with align environments, the tags of equation environments aren't changed:  \documentclass{article} \usepackage{amsmath} \makeatletter % \maketag@@@ and \tagform@ also influence \eqref % \def\maketag@@@#1{\hbox{\m@th\bfseries#1\hspace{3mm}}} % \def\tagform@#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}\hspace{3mm}}  % \print@eqnum looks promising, but applies only to align environments \def\mytagform#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}\hspace{3mm}} \def\print@eqnum{\mytagform\theequation} \makeatother \begin{document} \begin{equation}     1+1=2\label{equation} \end{equation} \begin{align}     1+1 &amp;= 2\label{align} \end{align} \eqref{equation}, \eqref{align} \end{document}   outputs   How can I change the appearance of equation numbers without affecting references produced by \eqref?
11840
Is there a general way to change the font of a particular symbol without switching packages?  For example, suppose I'm using Computer Modern for my entire document, but I want the "subset" operator to look as it does in mathabx.  How can I redefine it to appear in this way?
65022
I want to implement a function name color highlighting and I use the listings package. My 'regex' for this is def %s( where def (including space) is the first delimiter %s is the function name and ( is the second delimtier. Now my aim is to color only %s in purple. So basically I want to only touch the part between the delimiters and the delimiters should stay untouched.  Here is what I tried so far:  \documentclass{article} \usepackage{xcolor,listings} \usepackage[ngerman]{babel} \usepackage{fontspec} \setmonofont{Courier New}  \begin{document}  \lstset{language=Python,     escapebegin=\color{orange},     keywordstyle=\color{blue}\bfseries,     commentstyle=\color{orange!80!red},     stringstyle=\ttfamily\color{gray},     %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(},     moredelim = [s][\color{purple}]{def\ }{(},     showstringspaces=false}‎ \lstset{literate=%    *{0}{{{\color{red}0}}}1     {1}{{{\color{red}1}}}1     {2}{{{\color{red}2}}}1     {3}{{{\color{red}3}}}1     {4}{{{\color{red}4}}}1     {5}{{{\color{red}5}}}1     {6}{{{\color{red}6}}}1     {7}{{{\color{red}7}}}1     {8}{{{\color{red}8}}}1     {9}{{{\color{red}9}}}1 }  ‎‎\begin{lstlisting}[basicstyle=\ttfamily,mathescape] def fancy_function_name(page_url = 'tex.stackexchange.com'):     return page_url.split('.')[0] \end{lstlisting}  \end{document}   This code will generate:   You can see that it matches the right place but is too greedy and colors the delimiters too. So I thought about the uncommented line: %moredelim = [is][\color{blue}\bfseries def \mdseries\color{purple}]{def\ }{(}, If I use this one and uncomment the line below I get this result:    It's nearly what I wan't but I cannot add the last, now missing ( in black color.  Does anyone has a solution for this without pretouching the code and add all the @@ symbols?
61004
I've been using Hendrik Vogt's answer to my earlier question , in which he explained how to make the underscore character active and assign a macro to it so that it can be redefined to produce roman type in subscripts:  \catcode`_=\active \newcommand_[1]{\ensuremath{\sb{\mathrm{#1}}}}   The solution works like a charm in maths and text environments, however I've run into trouble when I use it in 'literal' environments, such as file names or references, where making _ active breaks things.  Question: How can I make the underscore produce roman subscript, yet still function as a normal character in file names, labels, references and the like? I only need the subscript function in maths environments.  MWE:  \documentclass{article}  \catcode`_=\active \newcommand_[1]{\ensuremath{\sb{\mathrm{#1}}}}  \begin{document} $D_H$ \label{sec_a} % This causes a "! Missing \endcsname inserted." error \end{document}
9541
1st example:  \starttypescript [\s!serif] [paratype]   \definefontsynonym [ParatypeSerif-Regular] [\s!name:PTSerif-Regular] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Italic] [\s!name:PTSerif-Italic] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-Bold] [\s!name:PTSerif-Bold] [\s!features=\s!default]   \definefontsynonym [ParatypeSerif-BoldItalic] [\s!name:PTSerif-BoldItalic] [\s!features=\s!default] \stoptypescript   2nd example:  \definefont[SerifS][\s!file:GenBkBasR at \smallfontsize]   Is \s! only related to fonts? Should I use it in my typescript files?
72728
% What to do here   \begin{document}   This is good integration.   $$\displaystyle \int x dx = \frac{x^2}{2}$$  \end{document}    I don't know much about LaTeX so I am going to need some spoon feeding.   I want text to appear in normal font. But math to appear in AMSEuler Font.  I don't want to make any changes inside the document.