Tag Info

New answers tagged

0

Well, as @jon said in the comment, this is a grammatical problem. Maybe I'm using the passive voice too much. The easy solution is avoiding those \citeauthor{key} at the end of a phrase. The technical solution uses biblatex, as recommended in the post linked in OP (here again as a reference: Preventing repeated periods in citations). I'm adding this as an ...


1

The approach of the other answer is certainly better, but heres what I came up with: You want to replace periods, so do just that \documentclass{article} \usepackage{xstring} \begin{document} \section{original tex} %one paragraph from lipsum package Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, %cut that here \section{with ...


4

To add bullets, you can make the period an active character and define a macro that adds the bullets: \documentclass{article} \begin{document} \begingroup % EDIT \let\origdot=. \catcode`.=\active \def.{\origdot\ensuremath{\bullet}} Hello. I am a sentence. Mr.\@ Black knows too little. \endgroup % EDIT \end{document} This results in: ...


1

Here is what works for me. It is based on the following observation: Closing quotes are the ones followed by a space or a punctuation mark, and all other quotes are opening quotes This rule can be implemented using \new@ifnextchar command from amsgen.sty that does not ignore spaces: \usepackage{amsgen} \makeatletter ...


2

It's really easy with xparse: \usepackage{xparse} \NewDocumentCommand{\ocite}{om}{% \IfNoValueTF{#1} {% no optional argument in the input \cite{#2}% } {% optional argument has been given #1,~\cite{#2}% note the tie }% } The list of arguments, instead of being a number, says o for an optional argument without a default ...


5

You can test if the optional argument is empty. How to check if a macro value is empty or will not create text with plain TeX conditionals? gives several possible ways how to do that. I picked one here: \documentclass{article} % traditional solution: \newcommand*\mycommand[2][]{% \if\relax\detokenize{#1}\relax \else #1,\nobreakspace \fi ...


2

Do \usepackage{amsthm} that has an interesting \@addpunct macro and carry the current value of \spacefactor inside the \hbox: \usepackage{amsthm} %Make a dot before the page number \makeatletter \renewcommand*{\cftfigureformatpnum}[1]{% \edef\savespacefactor{\the\spacefactor}% \cftfigureformatpnumhook{#1}% \hbox to \@pnumwidth{% ...


1

I solved this using the xstring package, which includes a good amount of functionality for working with strings. The IfEndWith and StrGobbleRight commands were particularly useful. After including the package, I redefined the caption function with the following: %Renew the caption command \let\oldcaption=\caption \renewcommand{\caption}[1]{% ...


4

You shouldn't be using the german package that's obsolete and present only for compatibility with older documents. However, the problem is present also with babel. I'll add the code for working around the issue. \documentclass{article} \usepackage[ngerman]{babel} \usepackage{libertine} \usepackage{ifxetex} \ifxetex ...


1

Based on the answer given by @daleif in How to delete a full stop on reference ending, I added \newcommand\EatDot[1]{} in the main file and amended the bibliography file to: @article{test1, note = "\href{http://www.blah1.com/}{Title 1}\EatDot", } @article{test2, note = "\href{http://www.blah2.com/}{Title 2}\EatDot", } The output file is: [1] ...



Top 50 recent answers are included