latex latin modern bfseries font scale - latex

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}

Related

Use ttf file in overleaf Latex for standard font

UPDATE:
Ok i think a lot of problems are solved now. First I needed to include ttf. Than I had some issues with the headlines. But the last listing will show my solution :D Thank you :D
(step 1 of 3)
Hi I want to change my standard font of my overleaf testfile..
The example is strange because I need to write a custom comand before my code.
But I just want to use my ttf as standard everywhere!
%
% Example of how to use a custom TTF font by following the directions here:
% http://math.stanford.edu/~jyzhao/latexfonts.php
%
% In this case, the custom font is LoKinderSchrift, from
% http://www.fonts101.com/fonts/view/Uncategorized/22887/LoKinderSchrift
%
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\newcommand\customfont[1]{{\usefont{T1}{custom}{m}{n} #1 }}
\title{Example: Custom Font}
\author{writeLaTeX}
\begin{document}
\maketitle
Normal Font Text.
\Huge\customfont{Custom Font Text!}
\end{document}
(Step2 of 3)
Ok thank you I was able to introduce my ttf into my document.
It looks like the numebr is to small?
How to delete the point after
the number at chapter?
ODD
The Table of content looks ok.
How to make Chapter names bold?
content looks ok
% !TeX TS-program = xelatex
\documentclass{report}
\usepackage[german]{babel}
%\usepackage[utf8x]{inputenc} % don't use `utf8x`
%\newcommand\customfont[1]{{\usefont{T1}{custom}{m}{n} #1 }}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter{. }}{0pt}{\Huge\bfseries}
\usepackage{fontspec}
\setmainfont{test.ttf}
\title{Example: Custom Font}
\author{writeLaTeX}
\begin{document}
\maketitle
\tableofcontents
\chapter{Testchapter}
How to delete the point before the chapter?
The NUMBER looks smaller than the TEXT ?!
WHY?
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
It
\chapter{Testchapter}
How to delete the point before the chapter?
Why
this is a chaptertext
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
\section{testsection}
this is a section test
Normal Font Text.
It
\end{document}
(step 3 of 3)
Final solution:
\documentclass[report]{scrreprt}
\usepackage[fontsize=12pt]{fontsize}
\usepackage[left=6cm,right=1cm,top=1.5cm,bottom=1cm,includeheadfoot]{geometry}
\usepackage[ngerman]{babel}
\usepackage{blindtext}
\usepackage{fontspec}
\setmainfont{test.ttf}
\begin {document}
\tableofcontents
\blinddocument
\end {document}
I suggest to compile your document with xelatex or lualatex. This way, you can use the fontspec package and easily use fonts installed on your computer or even just .ttf files:
% !TeX TS-program = xelatex
\documentclass{article}
\usepackage[english]{babel}
%\usepackage[utf8x]{inputenc} % don't use `utf8x`
%\newcommand\customfont[1]{{\usefont{T1}{custom}{m}{n} #1 }}
\usepackage{fontspec}
\setmainfont{lokisd__.ttf}
\title{Example: Custom Font}
\author{writeLaTeX}
\begin{document}
\maketitle
Normal Font Text.
\Huge Custom Font Text!
\end{document}

Changing fontsize of word "References" in Latex

I'm a beginner to latex, I was writing an article. At the end when adding references. I did:
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
After compiling, the word "Reference" appears in pdf, and it is too big in size. I want its font size to be 12pt. How can I do that?
Using the titlesec package, you can temporarily change the size of section headings:
\documentclass[12pt]{article}
\usepackage{titlesec}
\begin{document}
test
\begingroup
\titleformat*{\section}{\fontsize{12pt}{14pt}\bfseries\selectfont}
\begin{thebibliography}{100}
Some bibitems here
\end{thebibliography}
\endgroup
\end{document}

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 change font and color of sections in memoir?

I have a test document using memoir and I'd like to figure out how to change the font and color of sections and lower levels.
\documentclass{memoir}
\usepackage{fontspec}
\setmainfont{Times New Roman}
\setsansfont{Helvetica}
\usepackage{blindtext}
\begin{document}
\blinddocument
\end{document}
I understand that memoir includes the functionality of titlesec, and this seems to be described in section 6 of the manual, but I just can't figure out the incantation to make it work. If I wanted \section to be in the sans font in blue, and the lower levels to be in green, what are the commands to make this happen?
Use \setXheadstyle{<style>} to set the <style> of X where
sec denotes \section,
subsec denotes \subsection
subsubsec denotes \subsubsection,
para denotes \paragraph, and
subpara denotes \subparagraph.
\documentclass{memoir}
\usepackage{blindtext,xcolor}
\setsecheadstyle{\sffamily\color{blue}}% Set \section style
\setsubsecheadstyle{\sffamily\color{green}}% Set \subsection style
\begin{document}
\blinddocument
\end{document}

Resources