# uptex utarticle class and geometry package and setup

I try to define a specific geometry for a project using the geometry package. I have no issue when using the ujarticle from uptex, but everything gone wrong when using the utarticle class. (utarticle is a tategaki class of uptex)

Does someone have the same behaviour ? Maybe there is another package to change the geometry of a page ?

EDIT: Sorry I missed the minimal example.

\documentclass{ujarticle}
%\documentclass{utarticle}

\usepackage{geometry}

\geometry{%
paperheight=148mm, paperwidth=210mm,%
layoutheight=105mm, layoutwidth=148mm,%
layoutvoffset=21.5mm, layouthoffset=31mm,%
tmargin=18mm, bmargin=18mm,%
lmargin=18mm, rmargin=18mm,%
%
marginparwidth=0mm, marginparsep=0mm,%
showframe=true,%
showcrop=true%
}

\begin{document}

テスト

\end{document}


When using the utarticle class, the text is off the intended text space.

• Can you show the code for a small complete example document that shows the unexpected behavior? – Marijn Dec 28 '19 at 9:54
• @Marijn Sorry, I totally missed the basics. – krshk Dec 28 '19 at 13:29

Currently geometry.sty does not know vertical writing classes (e.g. tarticle.cls in platex, utarticle.cls in uplatex) at all; this is a well-known issue here in Japan. As a workaround, lltjp-geometry.sty provided by luatexja project team can be used: it should be loaded before geometry.sty as follows:

\usepackage[...]{lltjp-geometry}
\usepackage[...]{geometry}


Please note that lltjp-geometry should not be used with horizontal writing classes.

[community wiki as this isn't really an answer, just some pointers]

I used

 \usepackage[dvipdfmx]{geometry}


in your example and generated PDF with dvipdfmx following uplatex.

The results from the two classes are :

The geometry package has no information about the writing direction support in ptex and so is "confused". Probably it would not be hard to add to the package but would need someone who understood ptex rather better than me, pull requests to https://github.com/davidcarlisle/geometry would be welcome