# Tag Info

20

If using LuaLaTeX rather than XeLaTeX is an option for you -- fortunately, Lua(La)TeX and polyglossia have started playing nice with each other, beginning a few months ago -- you may achieve your goal as follows. First, define an "OpenType feature file", such as # Scripts and languages # If the font uses others, they should be defined here too ...

16

It might depend on the style and language(s) you are using, but generally titles are printed in the field format titlecase. By default, titlecase has no effect on casing; from biblatex.def: \DeclareFieldFormat{titlecase}{#1} If you want all titles in sentence case (i.e. first letter capitalized, the rest in lowercase) you can redefine this format: ...

16

\documentclass[a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\capitalize}{>{\SplitList{~}}m}{ \CapitalizeFirst#1\Capitalize\unskip } \ExplSyntaxOff \def\Sentinel{\Capitalize} \def\CapitalizeFirst#1{\MakeUppercase#1 \Capitalize} \def\Capitalize#1{% \def\next{#1}% \ifx\next\Sentinel ...

16

A working scheme seems to be \documentclass{article} \usepackage[authoryear]{natbib} \usepackage{hyperref} \DeclareRobustCommand{\VAN}[3]{#2} \begin{document} \citet{vannoort} \citet{other} \bibliographystyle{plainnat} % here we change the meaning of \VAN \DeclareRobustCommand{\VAN}[3]{#3} \bibliography{vannoort} \end{document} where the entry in the ...

16

\documentclass[a4paper]{article} \makeatletter \DeclareRobustCommand{\emphcap}[1]{\begingroup\emph@cap#1\@nil\endgroup} \def\emph@cap#1{% \ifx#1\@nil \expandafter\@gobble \else \emph@@cap{#1}% \fi \emph@cap} \def\emph@@cap#1{% \ifnum\uccode#1=#1\relax \itshape#1\emph@captrue \else \ifemph@cap\/\else\fi\upshape#1\emph@capfalse ...

16

I would say the typographically correct thing would be to use small caps for all-capital letter words, for example CD-ROM would become \textsc{cd-rom}: That way, the hyphen is aligned nicely with the surrounding letters, and the all-caps word doesn't stand out as much. This is also the solution suggested by Erik Spiekerman in his Typo Tips.

15

An approach using LaTeX3: the important command is \regex_replace_all:nnN. Its first argument is a regular expression (here, [A-Z] matches any uppercase letter); its second argument the replacement, here \textit followed by \0 (what the regular expression matched); and the third is a token list variable on which we want to do the replacement. ...

14

Ok, here is an other approach dedicated to LuaLaTeX fans (and future fans of LuaLaTeX). I think it is a good example to show how easy it is to write a few (easy to understand) lines of Lua code. In the provided Lua code one can check the input string for every char and format any LaTeX string you need without cryptic TeX commands. It is good practice to ...

14

You have to isolate the first token in #1 from the rest and uppercase it; the fact that \uppercase doesn't expand anything and puts back the token list into the input stream after its operation can be exploited in the following way: \newcommand{\mycommand}[1]{\mycommandaux#1\relax} \def\mycommandaux#1#2\relax{% \uppercase{\expandafter\gdef\csname ...

14

i find the cited answer rather confusing, if not out-and-out backwards. \@ before punctuation says that the period does fall at the end of a sentence. to quote from the latex manual (p.170): \@ Causes an end-of-sentence space after punctuation when typed before the punctuation character. Needed only if the character preceding the punctuation ...

14

The format definition \DeclareFieldFormat{titlecase}{\MakeSentenceCase{#1}} makes all titles in sentence case, which isn't what you want. Titles need to be printed according to both the entry and field types. For example, with the title field we need to handle @article and @book entries differently. With @inproceedings entries we need to handle the title ...

14


14


14

Our own Martin Scharrer's collcell package is ideal for this sort of thing: \documentclass{article} \usepackage{array} \usepackage{collcell} \newcolumntype{U}{>{\collectcell\MakeUppercase}c<{\endcollectcell}} \begin{document} \begin{tabular}{cU} a & b \end{tabular} \end{document}

13

Computer Modern's greek (bottom) font is (loosely) based on Monotype's 155M Greek font (top): The Monotype 155M font itself is related to the Porson greek font, which was one of the most used typeface for greek in english speaking countries. One of the characteristic of this font is that it has upright capitals but slanted lowercase. This might seem ...

13


12

For expl3, I wrote the following as the most robust approach I could find \documentclass{article} \usepackage{expl3} \ExplSyntaxOn \cs_new:Npn \tl_to_upper_case:n #1 { \exp_args:Nf \__tl_to_upper_case:n {#1} } \cs_new:Npn \__tl_to_upper_case:n #1 { \__tl_to_upper_case:w #1 ~ \q_no_value \q_stop } \cs_new:Npn \__tl_to_upper_case:w #1 ~ #2 \q_stop { ...

12

Yes and no. The "setting" comes from the style file you use for your bibliography. Changing the style will change the way BibTeX dos or does not use capital letters. You might also try to change the bst file. But given its complicated structure and the fact that a publisher might use his own style / require you to use his, this is usually not a possibility. ...

12

The macro simply says \spacefactor 1000 Under \nonfrenchspacing, capital letters set the space factor to 999 and, by rule, the space factor never jumps from a value less than 1000 to a value greater than 1000. On the other hand, a comma sets the space factor to 1250, the period to 3000 and so on for other punctuation signs. So with JS,, the space factor ...

12


11

You could set the \sfcode of the "end of sentence" chars to something different and test for it: \documentclass[10pt]{report} \sfcode\.=1001 \sfcode\?=1001 \sfcode\!=1001 \sfcode\:=1001 \newcommand\secname{\ifnum\spacefactor=1001 Secname\else secname\fi} \begin{document} abc. \secname\ is \secname. e.g.\@ \secname \end{document} ...

11

The problem is that \uppercase is not expandable. You can't use it with \expandafter. I would expand the argument first, as good measure, then read the first letter using a second, internal macro, then use \uppercase to change that letter. Finally a second internal macro reads the new uppercase letter and the rest of the name and makes the definition. The ...

10

I'd say that \newcommand*{\AddIndexEntry}[2]{% % #1 = indexed term, #2 = word to index this under \par\noindent \lowercase{\def\temp{#2}}% Indexing: #2% \expandafter\index\expandafter{\temp!#1}% } should be what you need. How does \lowercase works? It sends its argument to a further processor (it's not a macro, so it doesn't its work ...

10

You could use \MakeLowercase: \documentclass{amsart} \title{Topics on \MakeLowercase{de} R\MakeLowercase{ham} cohomology} \author{The Author} \begin{document} \maketitle \end{document} I am not sure about using lowercase for the last name; perhaps \title{Topics on \MakeLowercase{de} Rham cohomology} could be better?

10

You could define a macro for this expression: \newcommand{\Cq}{C_q} and protect it when you use it in such headings: \section{Properties of $\protect\Cq$} \protect prevents early expansion of the macro, this way also becoming uppercase is prevented. You may use this macro later in your math expression as well, of course, that's why I did not start math ...

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