J. C. Salomon
  • Member for 11 years
  • Last seen this week
What is the Latex convention for sign function?
Accepted answer
44 votes

Whether you use “sign” or “sgn” is a style issue which your intended publisher can answer, not us. That said, you probably want to use AMSMath’s \DeclareMathOperator not \newcommand; see newcommand vs....

View answer
When and why should I use % !TEX TS-program and % !TEX encoding?
26 votes

Alan Munn’s answer covered most of the questions for TeXShop; I’ll explain them for TeXworks. (This is adapted from Joseph Wright’s blog post TeXworks ‘magic comments’.) % !TeX program =〈program〉: 〈...

View answer
What's the proper way to typeset a differential operator?
20 votes

This covers the input side of things rather than the display side, but it’s a technique I’ve found useful: In XeLaTeX or LuaLaTeX, I do something like this: \newcommand*{\diffdchar}{d} % or {ⅆ}, ...

View answer
Macros for common abbreviations
16 votes

Phil Ratcliffe has recently posted to CTAN two packages to deal with this question: xpunctuate “provides the commands \xperiod, \xcomma and \xperiodcomma, which follow a similar procedure to that of \...

View answer
Kerning for arabic digits?
Accepted answer
14 votes

OpenType has among its many standard font features the option tnum for “Tabular Figures” (each digit has the same width, suitable for tables) vs. pnum for “Proportional Figures” (digits may have ...

View answer
How to format source to take advantage of VCS?
Accepted answer
12 votes

Per Loop Space's comment above, his tips at https://loopspace.mathforge.org/HowDidIDoThat/TeX/VCS/ are handy. Of particular use is dividing the layout code from the content (a good idea anyway) and ...

View answer
Is there a default / official / standard Vim indentation file for TeX, or just best practices for TeX source indentation?
Accepted answer
10 votes

There are no real standards, but here are some tips I’ve found handy: Don’t indent parts of a paragraph, but do break lines between sentences and after significant phrases within a sentence. As I ...

View answer
Are there any typographical improvements planned for LaTeX3?
9 votes

The purpose of LaTeX3 is to enable typographical improvements rather than to provide them. The stable bits (expl3, xparse, l3keys, among others) have so far provided more flexible ways to program ...

View answer
ar package for Aspect Ratio symbol
9 votes

Based on David Carlisle’s answer and some experimentation: \documentclass{article} \usepackage{trimclip} \begin{document} \def\AR{\clipbox{0pt 0pt .32em 0pt}\AE\kern-.30emR} A\AE \...

View answer
Suppress certain ligatures generally
8 votes

OpenType fonts class ligatures as Required, Common, Contextual, Rare/Discretionary, and Historic; and there are “features” for each of these (rlig, liga, clig, dlig, & hlig), which can be enabled ...

View answer
Using LaTeX3’s xtemplate
Accepted answer
7 votes

Can the concepts of xtemplate be described in a simple-but-complete worked example? TUGBoat 33:3 has an article by Clemens Niederberger titled The xtemplate package: An example (now publicly-...

View answer
What's the difference between format and macro language?
6 votes

The macro language of TeX refers to the way macros are read, defined, expanded, etc.; the set of primitive commands & their effect; and things like that. In this context, “plain TeX” means the ...

View answer
change the font of a sentence in latex to Calligra
Accepted answer
6 votes

Following the documentation of the calligra package at http://ctan.org/pkg/calligra, try this minimal example: \documentclass{article} \usepackage{calligra} \usepackage[T1]{fontenc} \begin{document} ...

View answer
expl3 switch for booleans: Is there a \bool_case:Nnn?
Accepted answer
4 votes

Adapting the code from \tl_case:Nnn, I have this: \documentclass{minimal} \usepackage{expl3, xparse} \ExplSyntaxOn \cs_new:Npn \bool_case:nn #1#2 { \tex_romannumeral:D \__bool_case:w #1 ...

View answer
Latex style that resembles the one used in some computer science books
4 votes

The copyright page for the Fitting book says it was “prepared from the author’s LaTeX files using Springer’s svwidecm style file.” Springer’s site does not have that style file, though they offer ...

View answer
Ellipses & Correct Space Factor
3 votes

For restricted cases, \@ifnextchar is sufficient: \documentclass{article} \usepackage[utf8]{inputenc} \newcommand*{\egap}{\kern\fontdimen3\font} \newcommand*{\wordspace}{\@\space} \makeatletter\...

View answer
l3doc in combination with minted
Accepted answer
3 votes

Although l3doc is usable (I use it myself in xpeek), it is far from being in a stable state. See, for example, Joseph Wright’s answer to How to document a expl3 macro using dtx, where he describes ...

View answer
Text fonts other than Cambria to match Cambria Math
3 votes

Constantia works particularly well, and its small caps & old-style figures are quite nice too. See this document of mine or this detail from it:

View answer
Where can I get the getfileversion package?
Accepted answer
3 votes

The README for latexfileversion says: Before version 0.3, this tool used to be named getfileversion. Unless you need the old version for some reason, this is what you’re looking for.

View answer
Specifying an oldstyle number font with fontspec
3 votes

What fontspec provides is syntax for enabling OpenType features. What you need is the ability to switch fonts every time numerals are displayed. XeTeX has the XeTeXinterchartoks functionality to ...

View answer
Specifying an oldstyle number font with fontspec
2 votes

Quoting Khaled Hosny’s answer to Fontspec: Palatino with small caps and old-style figures, here’s another solution: You need a Palatino with proper OpenType support, alternatively you can use TeX ...

View answer
Ellipses & Correct Space Factor
Accepted answer
1 votes

Returning to this question… The ellipses package exposes a hook: \RequirePackage{ellipsis} \renewcommand{\ellipsis@after}{\@} \newunicodechar{…}{\textellipsis} does the trick.

View answer
Disabling interword spacing for periods following capital letters
1 votes

Barbara Beeton’s suggestion of an acronym macro is probably the way to go. If, however, you insist on using plain text as input, you can adjust the space factors instead; here’s how: To quote from ...

View answer
Spacefactor & Unicode Curly Quotes
1 votes

Yes there is, and my edit that found the command \sfcode was halfway to the answer. Under XeLaTeX/LuaLaTeX, the curly quote character ” can have its space-factor code set just like any other character....

View answer
Split 2-up with pdfpages or graphicx
Accepted answer
0 votes

A loop is all that was needed, and the loop can even be initialized with the number of pages in the source document: % … \begin{document} \count 254 = 1 \loop \includegraphics[viewport= 0 0 396 612,...

View answer