Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special characters broken in the PDF content - apidoc #6973

Closed
davidsonalencar opened this issue Jan 22, 2015 · 3 comments
Closed

Special characters broken in the PDF content - apidoc #6973

davidsonalencar opened this issue Jan 22, 2015 · 3 comments
Assignees

Comments

@davidsonalencar
Copy link
Contributor

I ran the following command to export the pt-BR guide in PDF.

extensions/apidoc/apidoc guide docs/guide-pt-BR ./output
cd ./output
make pdf

When I analyzed the PDF content, I realized that the comments with special characters in code blocks were broken.

main

Is there some setting I can apply or is even an error?

@cebe
Copy link
Member

cebe commented Jan 22, 2015

this is an issue with latex listing environment, not sure how to make it work with UTF-8 characters correctly. Will check it later.

@cebe cebe added this to the 2.0.x milestone Jan 22, 2015
@cebe cebe self-assigned this Jan 22, 2015
@davidsonalencar
Copy link
Contributor Author

@cebe, I manually changed the Latex file and was able to show accented characters.

Latex original code:

\lstset{language=php}\begin{lstlisting}
class MinhaClasse extends \yii\base\Object
{
    public function __construct($param1, $param2, $config = [])
    {
        // ... inicialização antes da configuração ser aplicada

        parent::__construct($config);
    }

    public function init()
    {
        parent::init();

        // ... inicialização depois da configuração ser aplicada
    }
}
\end{lstlisting}

Example of code changed Latex:

\lstset{%
        language=php,
        extendedchars=true,
        literate=%
        {é}{{\'{e}}}1
        {è}{{\`{e}}}1
        {ê}{{\^{e}}}1
        {ë}{{\¨{e}}}1
        {É}{{\'{E}}}1
        {Ê}{{\^{E}}}1
        {û}{{\^{u}}}1
        {ù}{{\`{u}}}1
        {â}{{\^{a}}}1
        {à}{{\`{a}}}1
        {á}{{\'{a}}}1
        {ã}{{\~{a}}}1
        {Á}{{\'{A}}}1
        {Â}{{\^{A}}}1
        {Ã}{{\~{A}}}1
        {ç}{{\c{c}}}1
        {Ç}{{\c{C}}}1
        {õ}{{\~{o}}}1
        {ó}{{\'{o}}}1
        {ô}{{\^{o}}}1
        {Õ}{{\~{O}}}1
        {Ó}{{\'{O}}}1
        {Ô}{{\^{O}}}1
        {î}{{\^{i}}}1
        {Î}{{\^{I}}}1
        {í}{{\'{i}}}1
        {Í}{{\~{Í}}}1
}
\begin{lstlisting}
class MinhaClasse extends \yii\base\Object
{
    public function __construct($param1, $param2, $config = [])
    {
        // ... inicialização antes da configuração ser aplicada

        parent::__construct($config);
    }

    public function init()
    {
        parent::init();

        // ... inicialização depois da configuração ser aplicada
    }
}
\end{lstlisting}

PDF result working:

main2

@yii-bot
Copy link

yii-bot commented Jan 24, 2016

Issue moved to yiisoft/yii2-apidoc#53

@yii-bot yii-bot closed this as completed Jan 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants