1

This is somewhat of a repost, but all the help I got did not really help. I am using Linux Libertine in LaTeX as my font in my thesis and I love every character except for the italic uppercase J. However, the uppercase J in mathmode is nice and I would like to replace the italic J with the mathmode J throughout the whole document. Is this possible? MWE:

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{libertine} 
\usepackage[libertine]{newtxmath}

\begin{document}

I do not like the italic \textit{J}, I want $J$ for that.

\end{document}

Output:

MWE compiled

I know that mathmode J is produced by the newtxmath package, whereas the italic J is provided by the libertine package itself. I found several examples on how to redefine mathmode characters using \DeclareMathSymbol, but I only want to change textmode italic uppercase J to be the $J$.

Thank you in advance.

keyuu
  • 11
  • Have you considered defining a macro for this using \newcommand? That would be a much simpler approach (at least, as far as I know, and I looked into similar stuff for my own thesis). However, that is best for stand-along things and may not do what you need if you sometimes have an italic uppercase J in part of a word. – baileythegreen Apr 01 '22 at 09:08
  • How would I do this exactly using \newcommand? Also, this mainly concerns my Bibliography, in which many scientific Journals get abbreviated, e.g. J. Chem. Edu. The Bibliography is generated by natbib from a .bib file. – keyuu Apr 01 '22 at 09:17
  • You would put something like this\newcommand{\J}{$J$} into your preamble, then use it like this: \J. The bibliography wrinkle may make it more difficult, but you could try replacing the J in journal names with it. Note: if you want to use it as a stand-alone character (so there is a space after it), you will have to do \J{}. Otherwise the following space just gets consumed. – baileythegreen Apr 01 '22 at 09:36
  • This sounds like it's worth a try, although it would include replacing every J in my .bib file with \J. Maybe there is a more elegant way...? Anyway, thank you for your suggestion! – keyuu Apr 01 '22 at 09:46
  • Regular expressions? But that requires knowing how to use them, and also depends on where you're writing the document. If you do try it, just test it on one, or a few references before replacing all of them. – baileythegreen Apr 01 '22 at 09:53
  • you should probably link to the previous post so people can adapt answers if necessary. Also you could be clearer about your requirements, getting the letter is easy you can just do $J$ but if you don't want to break hyphenation of words starting with J then you really need to do this at the font level so it's harder, but if you just care about J. Chem that isn't an issue. – David Carlisle Apr 01 '22 at 10:08
  • spacing and hyphenation will be broken if you do that. Check e.g. $J$\textit{ournal} – Ulrike Fischer Apr 01 '22 at 10:09
  • The previous did not recieve any answers related to the original problem... And since I am using LaTeX and not XeLaTeX I was just wondering if there was a simple method to replace a single textmode character. Apparently there is not, so thank you for your answers! :) – keyuu Apr 04 '22 at 09:10

0 Answers0