Replace a single character in LaTeX? - latex

I am using Linux Libertine 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. 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.
Thank you in advance.

Related

Title not being rendered with LaTeX

So I have the following document:
\include{preamble}
\title{test title}
\begin{document}
\maketitle
\begin{equation*}
\begin{aligned}
\pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\sqrt{\pi\dots}}}}}
\end{aligned}
\end{equation*}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
the contents of my preamble.tex file is:
%%%%% Document Setup %%%%%%%%
\documentclass[10pt,onecolumn]{revtex4} % Font size (10,11 or 12pt) and column number (one or two).
\usepackage{times} % Times New Roman font type
\usepackage[a4paper, left=1.85cm, right=1.85cm,top=1.85cm, bottom=1.85cm]{geometry} % Defines paper size and margin length
\usepackage[font=small, labelfont=bf]{caption} % Defines caption font size as 9pt and caption title bolded
\usepackage{graphics,graphicx,epsfig,ulem} % Makes sure all graphics works
\usepackage{amsmath} % Adds mathematical features for equations
\usepackage{etoolbox} % Customise date to preferred format
\usepackage{subcaption}
\usepackage{caption}
\makeatletter
\patchcmd{\frontmatter#RRAP#format}{(}{}{}{}
\patchcmd{\frontmatter#RRAP#format}{)}{}{}{}
\renewcommand\Dated#name{}
\makeatother
\usepackage{fancyhdr}
\def\bibsection{\section*{References}} % Position reference section correctly
\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{xcolor}
\newcommand{\incfig}[2][1]{%
\def\svgwidth{#1\columnwidth}
\import{./figures/}{#2.pdf_tex}
}
\pdfsuppresswarningpagegroup=1
For some reason the title just will not be included on the pdf when I compile the code, I am sure I have \title{} and \maketitle in the correct positions. Any help as to why this is would be much appreciated.
Move the title after \begin{document}:
\documentclass{revtex4}
\begin{document}
\title{test title}
\maketitle
\end{document}
(don't do this with other documentclasses. Most of the time it is better to have the \title in the preamble, e.g. to get sensible pdf meta data if combined with hyperref)

LaTeX two-column layout does not keep text between borders

I am using the \twocolumn tag to use the two-column layout in LaTeX. The problem is that this does not work properly and the text seems not to be fixed between the borders. Not sure if that minimal example helps, but at least you can see my includes and the text with which it happens.
\documentclass[12pt,a4paper, abstracton]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[backend=biber, sorting=none]{biblatex}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\twocolumn
\section{Introduction}
Glutamate carboxypeptidase II (GCPII), N-acetyl-L-aspartyl-L-glutamate peptidase I (NAALADase I), NAAG peptidase or prostate-specific membrane antigen (PSMA) \dots
\end{document}
Screenshot of left column in PDF that shows the problem
Why does LaTeX write from the first column into the second column and how can I fix that? I would like to avoid change each line separately, where that happens. I am looking for a global solution.
Since the workarounds of the accepted answer were not satisfactory to me, I kept searching and found a more adequate and fast workaround, adding to my preamble the following:
\setlength{\emergencystretch}{3em}
The length 3em can be changed as needed, just keep it as low as possible in order to preserve optimal appearance.
More details here.
Latex has trouble finding a suitable break point because words with multiple capital letters are normally assumed to be acronyms which should not be hyphenated.
Possible workarounds:
force a line break with \linebreak before the word. This might result in undesirable large spaces in the line, especially in your situation in with only a single white space in the line
tell latex where possible break points are with long\-word (I don't know if there are any possible hyphenation points in NAALADase). This can also be globally for the whole document with \hyphenation{long-word} in your preamble
rephrase the sentence
use another layout. Very short lines combined with very long and unbreakable words is a tough combination
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[backend=biber, sorting=none]{biblatex}
\usepackage{hyperref}
\usepackage[hyphenbreaks]{breakurl}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\begin{document}
\twocolumn
\section{Introduction}
Glutamate carboxypeptidase II (GCPII), N-acetyl-L-aspartyl-L-glutamate peptidase I \linebreak (NAALADase I), NAAG peptidase or prostate-specific membrane antigen (PSMA) \dots
\end{document}

How to write the below in LaTeX?

I'm trying to write the big C in the picture below, Could anyone tell me how to write it?. And what is the name of this kind of letters?
With the amsfonts package, you can use the so-called blackboard bold font:
\documentclass{article}
\usepackage{amsfonts}
\begin{document}
\[
\mathbb{C}
\]
\end{document}

latex latin modern bfseries font scale

I use
\titleformat{\section}{\normalfont\bfseries\color{blue}}{\thesection}{0.5em}{}
to set the section title heading as bold font, but i found the title scale is not look good, i would like to set scale =0.9 or smaller only on title heading, how could i do that? my latex engine is xelatex. thanks for the help.
MWE:
\documentclass[10pt,a4paper,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{titlesec}
\titleformat{\part}{\normalfont\bfseries\color{black}}{\makebox[2em] {\thepart}}{0.5em}{}
\titleformat{\chapter}{\normalfont\bfseries\color{red}}{\thechapter}{0.5em}{}
\usepackage{graphicx}
\begin{document}
This line is Latin Modern font\\
This line is Latin Modern font\\
\bfseries{This line is Latin Modern font bold}
\end{document}

LaTeX: issue when using multicol with RTL languages

I'm trying to use LaTeX with RTL language. when I set columns count to 2, LaTeX use LTR direction as default.
I try to use \RLmulticolcolumns command but it does not work!
\usepackage{multicol}
\begin{document}
\RLmulticolcolumns
\begin{multicols}{2}
some RTL text...
\end{multicols}
\end{document}
Any help?

Resources