3

I'm having troubles using unicode characters U+023A and U+A7CC.

\documentclass[12pt,a4paper]{report} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \renewcommand{\baselinestretch}{1.5} \setmainfont{EB Garamond} %\setmainfont{Times New Roman} \ExplSyntaxOn \NewExpandableDocumentCommand{\uni}{O{12}m} { \char_generate:nn { \int_from_hex:n { #2 } } { #1 } } \ExplSyntaxOff \begin{document} \uni{338S} \uni{023A} \end{document} 

I'm using LuaLaTex compiler and some suggestions in some other answers. The suggestions that I found work well for the first symbol but the second does not appear in the pdf. What is the standard clean way to insert such symbols in the text?

In particular I would like to write in Times New Roman.

7
  • 2
    U+A7CC has been added to unicode in september 2024 and I don't know of a font that supports it. Ⱥ should work with times. Commented Jan 26 at 12:05
  • Do you actually need the unicode symbol or just something which looks like U+A7CC? Commented Jan 26 at 12:53
  • Until you get a font, you can manually compose it using \llap or\kern. Or insert a sized image en.m.wiktionary.org/wiki/%EA%9F%8C Commented Jan 26 at 12:54
  • @samcarter_is_at_topanswers.xyz I only need something that looks like it Commented Jan 26 at 12:54
  • @Vanja That's much easier :) Where you do you want to use the symbol? In math mode or in normal text? Commented Jan 26 at 12:56

4 Answers 4

3

You could produce a similar symbol with the cancel package:

% !TeX TS-program = lualatex \documentclass{report} \usepackage{fontspec} \setmainfont{Times New Roman} \usepackage{cancel} % from https://tex.stackexchange.com/a/302884/36296 % to allow usage at the start of a paragraph \makeatletter \DeclareRobustCommand\cancel[1]{\ifmmode \mathpalette{\@cancel{\@can@slash{}}}{#1}\else \leavevmode\@cancel{\@can@slash{}}\hbox{#1}\fi} \makeatother \begin{document} test \cancel{S}blabla \cancel{A}blabla \end{document} 

enter image description here

4

Some fonts support U+023A, none that I know supports U+A7CC.

You might be able to get away with U+0338 COMBINING LONG SOLIDUS OVERLAY, but as it's a combining character it should go after the main character, so

S\uni{0338} 

could work. Not with every font, though.

Here I show a comparison using a few font families. When you have decided which one you want, use \setmainfont, of course.

\documentclass[12pt,a4paper]{report} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{fontsetup} % New Computer Modern % font families for experiments \newfontfamily{\ebgar}{EB Garamond} \newfontfamily{\tmr}{Times New Roman} \newfontfamily{\libser}{Libertinus Serif} \begin{document} \subsubsection*{New Computer Modern} S\symbol{"0338} \symbol{"023A} \subsubsection*{EB Garamond} {\ebgar S\symbol{"0338} \symbol{"023A}} \subsubsection*{Times New Roman} {\tmr S\symbol{"0338} \symbol{"023A}} \subsubsection*{Libertinus} {\libser S\symbol{"0338} \symbol{"023A}} \end{document} 

output

You see that the result is good only with New Computer Modern and Libertinus Serif. Note also that you don't need \uni, which you can simplify the definition of with

\newcommand{\uni}[1]{\symbol{"#1}} 

so you're able to input \uni{023A}.

If you want to use Times New Roman you can superimpose the solidus U+2044 to an S. It seems to work well also with EB Garamond. Again, I show the comparison with various font families.

\documentclass[12pt,a4paper]{report} \usepackage[italian]{babel} \usepackage{fontspec} \usepackage{fontsetup} % New Computer Modern % font families for experiments \newfontfamily{\ebgar}{EB Garamond} \newfontfamily{\tmr}{Times New Roman} \newfontfamily{\libser}{Libertinus Serif} \newcommand{\Sstroke}{{% \vphantom{\symbol{"2044}S}% for the bounding box \ooalign{S\cr\hidewidth\symbol{"2044}\hidewidth\cr}% }} \begin{document} \subsubsection*{New Computer Modern} \Sstroke{} S\symbol{"0338} \symbol{"023A} \subsubsection*{EB Garamond} {\ebgar \Sstroke{} S\symbol{"0338} \symbol{"023A}} \subsubsection*{Times New Roman} {\tmr \Sstroke{} S\symbol{"0338} \symbol{"023A}} \subsubsection*{Libertinus} {\libser \Sstroke{} S\symbol{"0338} \symbol{"023A}} \end{document} 

sstroke

CAVEAT

Load neither inputenc nor fontenc along with fontspec. Actually the latter might be loaded in very special situations, which yours isn't.

2

We can draw the slash over S by \pdfliteral. For example in OpTeX:

\def\slashS{\quitvmode \setbox0=\hbox{S}% \pdfliteral{q \bp{.04em} w 0 \bp{-.3ex} m \bp{\wd0} \bp{1.8ex} l S Q}S} \adef^^^^a7cc{\slashS} \fontfam[lm] Latin Modern: \slashS. \fontfam[Termes] Termes: \slashS. \fontfam[Garamond] EB Garamond: \slashS. \fontfam[Libertinus] Libertinus: \slashS. \bye 

slashS

0

Use the kern command to fine-tune the horizontal positioning between pairs, e.g., S\kern-0.425em/.

kern

MWE

\documentclass[12pt,a4paper]{report} \usepackage{fontspec} \renewcommand{\baselinestretch}{1.5} \setmainfont{EB Garamond} \begin{document} S/ = S -kernXXem /, where XX = \begin{tabular}{ll} S\kern-1.0em{/}&-1.0\\ S\kern-0.9em{/}& -0.9 \\ S\kern-0.8em{/}&-0.8\\ S\kern-0.7em{/}&-0.7\\ S\kern-0.6em{/}&-0.6\\ S\kern-0.5em{/}&-0.5\\ S\kern-0.4em{/}&-0.4\\ S\kern-0.3em{/}&-0.3\\ S\kern-0.2em{/}&-0.2\\ S\kern-0.1em{/}&-0.1\\ S\kern0em{/}&0\\ \end{tabular} \end{document} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.