3

I'm trying to enter two Unicode characters in my document. The first is and the second is . However, none of the solutions I've seen thus far have been able to help me implement these two characters. The following code is where I try to insert the characters using the methods mentioned in other posts like

\newunicodechar{}{}

or

\DeclareUnicodeCharacter{}{}

or

\char"

I am not entirely sure if I have used these commands correctly that's why I have provided the entirety of my code below.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}

\newunicodechar{「}{\mopen}
\newunicodechar{」}{\mclose}

\DeclareUnicodeCharacter{14A5}{\mopen2}
\DeclareUnicodeCharacter{14A7}{\mclose2}

\title{Unicode char test}
\author{Skip}
\date{}

\begin{document}

\maketitle
\mopen「test\mclose」
\char"14A5

\end{document}

In this document I'm trying to print "test" and below that just the character "". In the output, I just get "Test" and for some reason, it prints "14A52 14A72" on the preceding page. The output is accompanied by a few undefined control sequence errors relating to the use of

\DeclareUnicodeCharacter{}{} 

and

\mopen 
\mclose

For further information; I am using XeLaTeX on Sharelatex.

I hope the information provided will be sufficient to answer my question.

  • if you are using xelatex then do not use inputenc – David Carlisle Nov 12 '17 at 15:24
  • 2
    have you seen \mopen defined anywhere? it is not a command name that I recognise. – David Carlisle Nov 12 '17 at 15:26
  • you could use \lceil and/or \rfloor from amsmath package. (table 92 in The Comprehensive LaTeX Symbol List) – naphaneal Nov 12 '17 at 15:42
  • 1
    @naphaneal they are defined in the format, no package needed. – David Carlisle Nov 12 '17 at 15:58
  • 1
    The character U+14A5 is CANADIAN SYLLABICS MI, probably not what you're looking for. The characters you're using are U+300C LEFT CORNER BRACKET and U+300D RIGHT CORNER BRACKET, available with amssymb as \ulcorner and \lrcorner. – egreg Nov 12 '17 at 16:47
6

enter image description here

\documentclass{article}

\usepackage{newunicodechar}

\newunicodechar{「}{\ensuremath\lceil}
\newunicodechar{」}{\ensuremath\rfloor}
\title{Unicode char test}

\author{Skip}
\date{}
\usepackage{fontspec}
%\setmainfont{Times New Roman}

\begin{document}


「test」


\end{document}
  • I used Times for the example image, just to demonstrate xelatex, but that is commented out as not needed for the answer. – David Carlisle Nov 12 '17 at 15:32
  • Your example, with \setmainfont, would also work in LuaLaTeX, yes? – user139954 Nov 12 '17 at 15:38
  • @RobtAll yes... – David Carlisle Nov 12 '17 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.