# Tag Info

11

To answer the questions backwards, the difference is that \spx{} expands to nothing whereas ^{} produces an empty superscript atom. Such an empty superscript field is not equivalent to not having a superscript, and can affect the position of a subscript on the same base. \expandafter\@gobble \else \expandafter\@firstofone \fi {^{#1}}% removes the ...

10

Attention: there is an error in your code. You missed closing brace } before [2]. The code \newcommand{\minitab}[2][c]{\begin{tabular}{#1}#2\end{tabular}} defines the command \minitab which has two arguments. The 1st is optional and has default value c (which will be used if you don't use another value). It is used to determine the alignment of the ...

7

It's very easy with comment package \documentclass{beamer} \usepackage{comment} % for english \includecomment{english} \excludecomment{french} % for french %\includecomment{french} %\excludecomment{english} \begin{french} \usepackage[french]{babel} \end{french} \usepackage{blindtext} \begin{french} \title{Titre} \author{Moi} \end{french} ...

4

You could use l3keys2e. File myunicodefonts.sty \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{myunicodefonts}[2015/06/21 Load fonts] \RequirePackage{fontspec} \RequirePackage{l3keys2e} \ExplSyntaxOn \bool_new:N \g_myunicodefonts_mathfont_bool \tl_new:N \g_myunicodefonts_textfont_tl \tl_new:N \g_myunicodefonts_mathfont_tl \keys_define:nn { myunicodefonts } ...

3

The code in the question has some problems: \ifstrequal is not defined, as shown by the error message. It is defined by package etoolbox. Environment switch makes a group, all local settings are lost after the end of the environment. There are lots of ways to implement "switches", this is not covered by package kvoptions, which tries to be simple and ...

3

From the LaTeX side you could remove the ?? using an etoolbox of \HyRef@autosetref: \documentclass{article} \usepackage{hyperref,etoolbox} \AtBeginDocument{\let\ref\autoref} \makeatletter % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>} \patchcmd{\HyRef@autosetref}{??}{\ignorespaces}{}{} \makeatother ...

2

Your approach here is to avoid having \WhatDoYouWantToWrite{All} throughout the document and then having to change every All to PartA (or something else) at a later stage. It's better to not pass an argument at all, and set something at the global level. Here is one such approach using TeX \if-statements: \documentclass{article} \newif\ifALL% ...

2

Here is a flexible solution using pgfkeys that allows for arbitrary switches that are given as keys to the command/environment. I define two (user) commands \SelectCommentsToPrint and \SelectiveComment. The first command controls which comments will be printed and the second command defines the comments and specifies under what conditions they should be ...

2

The primitive \over as used by \frac automatically switches styles. The \tfrac and \dfrac macros are for special cases to force text or display style. \ifinner does not test for text/display distinction so the solution is simple, replace all \ifinner \tfrac{..}{..} \else \dfrac{..}{..} \fi by \frac{..}{..} For your second question, I wouldn't use the ...

1

As an extension of the @YiannisLazarides answer, you can use mfirstuc which is included with TexLive 2014. This will take care of the capitalisation for you, and you won't have to repeat yourself when defining the upper-case version of your command. \documentclass{article} \usepackage{mfirstuc} \def\secname{fancy section} ...

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