Text Formatting`x' instead of ‘x’

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
DanielOMoneyRain
Posts: 4
Joined: Mon Dec 29, 2014 4:36 pm

`x' instead of ‘x’

Post by DanielOMoneyRain »

Hi,

I have a problem when writing `x'. TeXShop will turn this into ‘x’
Any ideas how to solve this problem?

These are the packages I use:

Code: Select all

\documentclass[paper=a4, fontsize=12pt]{scrartcl}
\usepackage[danish]{babel} 
\usepackage{amsmath,amsfonts,amsthm,mathrsfs}
\usepackage{tikz,pgfplots} 
\usepackage{subcaption,caption} 
\usepackage{sectsty} 
\usepackage{accents} 
\usepackage{fancyhdr} 
\usepackage{verbatim} 
\usepackage{graphicx} 
\usepackage{setspace} 
\usepackage{icomma} 
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usetikzlibrary{patterns,calc,shapes.geometric, arrows,decorations} 
And the I have this for when writing in another font:
\newenvironment{stata}{\fontfamily{lmtt}\selectfont}{\par}

The problem appears using the font or not :?:
Attachments
Skærmbillede 2015-12-29 kl. 15.35.13.png
Skærmbillede 2015-12-29 kl. 15.35.13.png (17.48 KiB) Viewed 7295 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

DanielOMoneyRain
Posts: 4
Joined: Mon Dec 29, 2014 4:36 pm

`x' instead of ‘x’

Post by DanielOMoneyRain »

Here is a MWE

Code: Select all

\documentclass[paper=a4, fontsize=12pt]{scrartcl}
\usepackage[danish]{babel} 
\usepackage{amsmath,amsfonts,amsthm,mathrsfs} 
\newenvironment{stata}{\fontfamily{lmtt}\selectfont}{\par}

\begin{document}
`x'   \\

\begin{stata}
	`x'
\end{stata}
\end{document}
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: `x' instead of ‘x’

Post by josephwright »

I'm perhaps being dim here: what is the expected difference between those two x's?
Joseph Wright
DanielOMoneyRain
Posts: 4
Joined: Mon Dec 29, 2014 4:36 pm

Re: `x' instead of ‘x’

Post by DanielOMoneyRain »

The x's are exactly equivalent. But what is not equivalent are the symbols ` ' and ‘ ’
Latex will turn this sign: `
Into this:‘
and this sign:'
into this:’

The reason why I need it not to tranform the signs is because the statistical software I'm writing a note on can tell the difference.

I hope it made sense :-)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10343
Joined: Mon Mar 10, 2008 9:44 pm

`x' instead of ‘x’

Post by Stefan Kottwitz »

Hi Daniel,

welcome to the forum!

How about this?

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\newcommand*{\backtick}{${}^{\backprime}$}
\newcommand*{\tick}{${}'$}
\begin{document}
\backtick x\textquotesingle
\end{document}
Stefan
LaTeX.org admin
DanielOMoneyRain
Posts: 4
Joined: Mon Dec 29, 2014 4:36 pm

`x' instead of ‘x’

Post by DanielOMoneyRain »

Hey Stefan,

Thank you for your reply!

Changing the code you sent just a little worked it out!
Specificly I changed ${}^{\backprime}$ to $\grave{}$ and now it works! Thanks! :D

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage[T1]{fontenc}
\newcommand*{\backtick}{$\grave{}$}
\newcommand*{\tick}{${}'$}
\begin{document}
\backtick x\textquotesingle
\end{document}
Post Reply