How to escape caret symbol in ZPL2 - printing

Does anybody know how to escape the caret symbol (^), which ZPL2 / zebra printers recognize as a control character for commands, to print this character as a text onto the zpl2 label?
Maybe I'm blind, but I could not find this info in the official zpl2 programming guide.

Use the Field Hex command. ^FH
^XA
^FO100,100
^AD^FH
^FDCaret _5E^FS
^XZ
Answer lifted from the ZPL guide page 186:
https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf

Related

need to print greek characters from zpl ii commands using a zebra printer

i have problem printing greek characters to a Zebra GC420 desktop printer. My code is:
$printarr[] = '^XA^CWZ,E:TT0003M_.FNT^FS^XZ^XA^FWN^FO70,50^A0,30,25^FH^FD'.labels_utf8_parse($name).'^FS^FO70,90^BY2^B3,,100^FD' . $node->field_o['und'][0]['value'] . '^FS^XZ';
What am i doing wrong? Instead of greek letters i get crosses. The strange part is that in another area of the code,the below code prints correctly greek characters:
$toprint = '^XA^CWZ,E:TT0003M_.FNT^FS^XZ^XA^FWR';
What should i do, how should i proceed to see what is the problem and how could i solve it?
You need to set the character encoding to UTF-8 using ^CI28. Put it near the top of the format, for example, after the ^XA^FWN.

How can I print a subscript like E_{n} with ZPL II?

I want to send a String to the Zebra printer in which I have e.g. the energy E_{N} printed whereas N must be a subscript of E. I can send strings to the printer which are in a normal format (e.g. 'bla=7'), but I have no idea how to include this subscript. Up to now I have strings like '^FDbla^FS'
I searched for the problem but could only find a solution for fixed problems like ^2, which were solved with a special character. There was no general solution.
The way I solved this was to strip out the subscripts and print them on the next half-line down.
^XA
^FT78,76^A0N,28,28^FH_^FDH PO ^FS
^FT78,90^A0N,28,28^FH_^FD 3 4^FS
^XZ

printing backslash AND unicode characters in one field

let's say I want to print a backslash and the pound symbol on a label: \£
I cant. I can only print either the backslash or the pound symbol, but the other one will render incorrectly.
This will print correctly the pound symbol, but will print a cent symbol instead of the backslash:
^XA
^CI28
^FO^AT^FH^FD_c2_a3^FS
^XZ
And this will print correctly the backslash, but not the pound symbol:
^XA
^CI13
^FO^AT^FH^FD_c2_a3^FS
^XZ
Do you know a way to combine these two in one single field ?
Thanks
Use the Field Hex feature:
^XA
^FO10,10^A0,40,40^FH_^FDEuro Symbol/_15/^FS
^XZ
As per ZPL script documents, they mentioned "You can mix character sets on a label." using ^CI command.
But there is no example scripts are available to mix character sets, Instead of that the example scripts are just explaining "how to remap the characters".
Also the document has clearly mentioned that If you want to print backslash, you should use ^CI13(^CI13 must be selected to print a backslash (\)). But If we use ^CI13, Latin characters are not printing properly which expects ^CI28.
So I'm not sure if it's possible to print both Latin characters and backslash (\) in same label.

accented characters in latex

I am writing a document in spanish, and I'm trying to add 'í' to the word
Montréal.However if I put the i like this: \'{e} in the code below, I just get a space instead of the é. Why is this not working?
\begin{tabbing}%
\hspace{2.3in}\= \hspace{2.6in}\= \kill % set up two tab positions
{\bf Engineer}\> Panagro S.A.\> Summers 2004-2010\\
\>Montréal, Colombia
\end{tabbing}\vspace{-15pt}
Also I might add that when I try putting Montréal outside of the tabbing block, it works fine.
Ted
Tabbing environment
Some of the accent marks used in running text have other uses in the tabbing environment. In that case they can be created with the following command:
\a' for an acute accent
\a` for a grave accent
\a= for a macron accent
source: LaTeX/Accents at Wikibooks
Related question on tex.stackexchange with a great solution to accented characters.
Save your file as UTF-8 and put
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
in your preamble.
Then you can just type the characters normally into your source file.
Or, use XeLaTeX which accepts UTF-8 input natively. In that case you need to add
\usepackage{fontspec}
to your preamble.
If your text editor doesn't support UTF-8 encoded files, you should probably get another editor. But if you're stuck with one, you can also use:
\usepackage[latin1]{inputenc} % for PCs
\usepackage[applemac]{inputenc} % for Macs
and save the files in the default encoding for your machine.
Thanks to Alan Munn for the solution!

How to write programming code containing the ' character in latex?

I am trying to write programming code in latex using the verbatim environment, but when I write
\begin{verbatim}
char ch = 'x';
\end{verbatim}
then the ' -characters around x are displayed incorrectly (they look "curly"). How can I fix this problem?
Load the upquote package to fix this issue in verbatim mode.
If you want straight quotes in monospaced text mode (e.g., \texttt{...}), or indeed in any other font, then you can use the \textquotesingle command defined in the textcomp package:
\documentclass{article}
\usepackage{upquote,textcomp}
\begin{document}
\newcommand\upquote[1]{\textquotesingle#1\textquotesingle}
\verb|'c'| \texttt{\upquote{h}}
\textsf{\upquote{h}} \upquote{h}
\end{document}
This will work well for fonts in any encoding rather than depending on a specific glyph slot (such as \char13 in the default OT1 encoding).
Adding \usepackage{upquote} to my preamble was sufficient.
Perhaps older versions of LaTeX or upquote required more work.
I have
What is wrong?
New
If you want to get something like this
write
\makeatletter
\let \#sverbatim \#verbatim
\def \#verbatim {\#sverbatim \verbatimplus}
{\catcode`'=13 \gdef \verbatimplus{\catcode`'=13 \chardef '=13 }}
\makeatother
For displaying source code, you might consider using the listings package; it is quite powerful and offers an option to display “straight” quotation marks.
If you're seeing curly single right quotes in a verbatim environment, then the single right quote in your typewriter font is curly, and that's the correct one to use for what you're doing (which I assume is displaying some C code).
\textsf{``} and \textsf{''} come pretty close to straight quotes. No need for using any special packages.
This is what I got from another source, and this works.
Use `` to start the double quotes (this symbol is below ~ symbol on our keyboard)
Use '' to close the double quotes (this symbol is below the " symbol on our keyboard)
So, `` quote double, unquote double''
Same goes for single quotes, `quote single, unquote single'

Resources