Rather than using floor and ceiling, I'd rather use what I would consider a proper UTF-8
character for Japanese quotation marks. Not only is it more intuitive, but it looks better (or should). I can do this using ctrl+K <'
and ctrl+K >'
in Vim, my text editor of choice since.
However, when I try to compile this, it throws errors at me. In particular:
! Package inputenc Error: Unicode character 」 (U+300C) (inputenc)
not set up for use with LaTeX.See the inputenc package documentation for explanation.
So I press H
for immediate help, and it mentions that I need to \DeclareUnicodeCharacter
so put in
\DeclareUnicodeCharacter{300C}{「}
\DeclareUnicodeCharacter{300D}{」}
But it still fails with the same error.
I also tried \DeclareUnicodeCharacter{300D}{\「}
and \DeclareUnicodeCharacter{300C}{\」}
I also tried \DeclareUnicodeCharacter{300D}{\jpr}
but was given an "undefined control sequence error". However, even if this did work, it isn't what I want. I was doing this as a troubleshooting step.
This is especially frustrating since looking on line at sample docs, people just use the brackets without any special treatment, yet I'm using the CJK
package.
I've also tried \usepackage[utf8x]{inputenc}
which I previously chose not to use because it lead to undesirable behavior. Again, a troubleshooting step.
It was suggested I produce a minimum "working" example. Below is that example.
\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{CJK}
\begin{document}
「
\end{document}
Another piece of info not requested is the compiler. Its pdflatex
without any options.
pdflatex
? I believelualatex
andxelatex
are especially suited to dealing with unicode.\DeclareUnicodeCharacter{300C}{「}
or\DeclareUnicodeCharacter{300C}{\「}
— the whole point is to define what should be done with that Unicode character, in terms of things already known to the engine (i.e. give it a definition that does not involve that Unicode character). (Assuming not XeTeX/LuaTeX….) Also, if you want to type Unicode characters in the file, you need inputenc. (Explained many times on this site, e.g. 1, 2, 3.)