Tag Info

Hot answers tagged

7

They mean something like \documentclass[graybox,envcountchap,sectrefs]{svmono} but with smallextended in the options between [] and perhaps a different class than svmono depending on your requirements. Springer have extensive documentation and examples in a zip file you can download from ...


6

\documentclass{article} \usepackage[T1]{fontenc} \def\foo#1{\par \texttt{<\detokenize{#1}>} \expandafter\if\relax\detokenize\expandafter{\romannumeral0#1}\relax \if X#1X% empty\else not empty\fi \else not empty\fi} \begin{document} \foo{} \foo{ } \foo{\empty} \foo{{}} \foo{\sqrt} \foo{\csname @gobble\endcsname{hello}} \end{document}


6

It's quite easy with xparse: \documentclass{article} \usepackage{xparse} \NewDocumentCommand{\range}{ m >{\SplitArgument{1}{ }}m } {% \dorange{#1}#2% } \NewDocumentCommand{\dorange}{ m m m } {% \IfNoValueTF{#3}{#1~#2}{#1[]~#2--#3}% } \NewDocumentCommand{\defineabbreviation}{ m m m } {% \NewDocumentCommand{#1}{o}{\IfNoValueTF{##1}{#2}{#3}}% ...


5

A macro that supports complex ranges must use the full force of expl3. Here's a possible solution: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\range}{ m m } { \cashner_range:nn { #1 } { #2 } } \tl_new:N \l__cashner_range_input_tl \seq_new:N \l__cashner_range_input_seq \bool_new:N \l__cashner_range_multi_bool ...


5

You can use a \romannumeral trick: \if\relax\detokenize\expandafter{\romannumeral-`\Q#1}\relax The missing space after `\Q will trigger expansion of #1 (after macro substitution, of course). Since this expansion ends at the first unexpandable token, this should be what you want. However a leading space will be ignored. \def\notempty{\relax} ...


5

\documentclass[11pt,spanish,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} OK so far except that theses usually have chapters so book or report might be preferable. \setlength{\parskip}{2ex} \setlength{\parindent}{0pt} Better to use parskip: \usepackage{parskip}% but do you really want no indentation in a thesis? ...


4

\# \$ \% \& \~ \_ \^ \{ \} are very different types of commands, \% makes a percent but \^ does not make ^ it is a command that takes an argument \^{a} constructing accented letters. You can use \detokenize{@Model.ReportTitle} then you basically only need to quote \( \} and \% to ensure that the construct has balanced braces. and add ...


4

The implementation is not the best, but just to see it can be done: \documentclass{article} \usepackage{xparse} \NewDocumentCommand{\macroa}{ >{\SplitArgument{1}{,}}m } {% \processtwo#1% } \NewDocumentCommand{\processtwo}{ m m } {% \IfNoValueTF{#2} {% \semicolonfalse #1, % } {% \semicolontrue #1 \textbf{\textit{#2}}% ...


4

The code inside siunitx (v2) uses a loop over each token in the input before comparing this to the various lists of possible 'number parts'. As that process cannot make assumptions about the nature of the tokens and as it covers a variety of input forms, it's rather complex. I'm currently re-writing it all to be more efficient and clear but the need to work ...


3

Behold my psychic power! Use \cslet to set \answer1 etc. to the current definition of \answer, not answer itself. \documentclass{article} \usepackage{etoolbox} \newcounter{a} \setcounter{a}{0} \newcommand\setans[2]{% \csdef{answer#1}{#2}} \newcommand\addans[1]{% \stepcounter{a}% \cslet{answer\thea}{#1}} % <--- Not \csdef! ...


3

You have to use suffix and not expr: def anchors(suffix p) = pair p.n, p.e, p.s, p.w; p.n := .5(ulcorner p + urcorner p); p.e := .5(urcorner p + lrcorner p); p.s := .5(llcorner p + lrcorner p); p.w := .5(ulcorner p + llcorner p); enddef; path b; b := unitsquare scaled 1pt; anchors(b); show b.n; show b.e; show b.s; show b.w; end This outputs ...


3

To collect your label in the "Tree" interface, follow these steps: Show the "Options Interface" (Options -> Options Interface) Double-click the "Tree" item (Tree.ini gets opened) Locate the lines BRANCH="Labels-TeX" BRANCH_CAPTION="Labels (#)" // Change Mode from TeX to ? to disable this item BRANCH_MODE_FILTER="TeX|DTX;INS;STY;AUX" ...


3

Parameters can be used only in the scope of a macro definition, so your ##2 in the file is meaningless. \begin{filecontents}{test-disputeUS} \section{Governing law. Arbitration} \label{sec:dispute} The parties agree that the Agreement shall be governed by the laws of the State of \ifstr{\control}{DE}{Delaware}{New York}, USA, without giving effect to its ...


3

This is as easy as \documentclass{article} \usepackage{amsmath} \makeatletter \renewcommand{\slimits@}{\limits} \renewcommand{\ilimits@}{\limits} \makeatother \begin{document} A summation $\sum_{i=1}^{n} a_{n}$ and an integral \[ \int_{0}^{1} x^2\,dx \] also inline: $\int_{0}^{1} x^2\,dx$ \end{document} However the result is typographically terrible. ...


3

Although in older posts of mine, I was reluctant to recommend the use of LuaLaTeX, the code has now matured enough and the LuaTeX Team is doing such a great job, that I would heartily recommend that any "thesis class" seriously considers using LuaLaTeX. Thesis templates are about enforcing styles and parsing is one of the stengths of Lua. As you wish to ...


3

You are confusing latex with the square backets for the optional arguments. When latex sees \TestA[\TestB[111]] it thinks that the optional argument for \TestA is \TestB[111. Now it tries to evaluate this expression and gets confused because \TestB is not conforming to syntax. To fix this you need to put brackets around the optional argument to \TestA: ...


3

An explicit number can be expanded without changing it and the unwanted command sequence can be redefined to vanish itself, when expanded: % Setup \makeatletter \newif\ifintheway \def\@citeb{foobar} \def\bfoobar{\inthewayfalse 17} % Extract the number from \csname b\@citeb\endcsname % and store it in the macro \mynumber \begingroup ...


2

What you think works doesn't do it. By chance you have selected two words without depth, while # has it. Try with: \documentclass{article} \usepackage{tikz} \newcommand{\mkTikzCoord}[2]{% \tikz[remember picture, baseline=(#1.base)]{\node [inner sep=0, outer sep=0, text depth=.25ex, text height=1.5ex] (#1) {#2};}% } \begin{document} Some text where I ...


2

You can use the \vspace*{length} command to write to the same line multiple times. Combine this with the \baselineskip length to jump several lines up or down. Additionally, change \baselineskip locally to make room for sub-line legends: \documentclass{article} \pagestyle{empty} \parindent0pt \begin{document} \bgroup % Double line space (or use setspace ...


1

This is not breakable and uses tcolorbox: \documentclass{article} \usepackage[many]{tcolorbox} \usepackage{lipsum} \definecolor{keyideascolor}{rgb}{0,0.5,0.1} \makeatletter \newtcolorbox{keyidea}[1][]{ enhanced jigsaw, left=7pt,right=7pt,top=1.75ex,bottom=1.25ex, boxrule=0pt, arc=0pt, before=\par\noindent\vspace{2em}, ...


1

You can use \edef\sum in this way: \edef\sum{\mathchar\the\sum\limits} ... A summation $\sum_{i=1}^{n} a_{n}$ ...


1

The best way to define new macros is to use the etoolboxs \csdef: Notes: Note that \aa is already defined., so you should use an alternate name. As \csdef won't issue an error in that case, I have added a test to make sure that the code issues an error if you attempt to redefine an existing macro. You can also use \csname...\endcsname to build names of ...


1

The two-line solution which uses only TeX primitives follows: \def\sdef#1{\expandafter\def\csname#1\endcsname} \def\mkMac#1{\sdef{the#1}{The macro #1}\sdef{#1}##1{\sdef{the#1}{##1}}} \mkMac{affilation} \affilation{University} Welcome to \theaffilation


1

As mentioned in the comments, you have two simple options that I present below. However, I'm not quite sure what you are after. \documentclass{minimal} \usepackage{forest} \forestset{ with translation/.style={ l sep=0,inner xsep=0, append translation/.expanded/.wrap pgfmath arg={\gettranslation{##1}}{content}, content/.expanded/.wrap ...


1

Have you tried the ifmtarg package? It provides the macro \@ifmtarg{<arg>}{<Code for arg empty>} {<Code for arg not empty>} Use texdoc ifmtarg for the documentation.


1

You can define a new template based on the frame number one for footline: \documentclass[compress,final]{beamer} \usepackage{ragged2e} % for justifying \usepackage{lipsum} % for random texts \usepackage{geometry} \geometry{lmargin=.5cm, rmargin=.5cm} ...



Only top voted, non community-wiki answers of a minimum length are eligible