LaTeX forum ⇒ Text Formattingvertical alignment about the question env of exsheets Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

vertical alignment about the question env of exsheets

Postby inkmathematics » Sat Aug 06, 2016 11:42 am

Here is my code segment.How can I program to make there no text below the number 1?I want the question environment be vertical alignment with "这".Anyone can help me ? Thank you.

  1. \documentclass{article}
  2. \usepackage{ctex}
  3. \usepackage{exsheets}
  4. \usepackage[showframe]{geometry}
  5.  
  6. \begin{document}
  7.  
  8. \SetupExSheets{headings=runin-nr}
  9.  
  10. \begin{question}
  11. 这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确解答方法呢?
  12. \end{question}
  13.  
  14. \end{document}
Last edited by cgnieder on Sat Aug 06, 2016 12:25 pm, edited 1 time in total.
Reason: added code markup

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat Aug 06, 2016 11:59 am

Hi and welcome, i bet the issue also arises without cjk-stuff. It would be easier for the helpers to read and test, as no special fonts are needed. Can you check and update?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sat Aug 06, 2016 12:45 pm

Something like this?

  1. \documentclass{article}
  2. \usepackage{exsheets}
  3. \usepackage{scrextend}% provides the {addmargin} environment
  4.  
  5. \SetupExSheets{
  6. headings = margin-nr ,
  7. question/pre-hook = \addmargin[2em]{0pt} ,
  8. question/post-hook = \endaddmargin ,
  9. question/no-skip-below
  10. }
  11.  
  12. \usepackage[showframe]{geometry}
  13. \usepackage{lipsum}
  14.  
  15. \begin{document}
  16.  
  17. \lipsum[1]
  18. \begin{question}
  19. \lipsum[2]
  20. \end{question}
  21. \begin{question}
  22. \lipsum[3]
  23. \end{question}
  24. \lipsum[4]
  25.  
  26. \end{document}


exsheets.png
exsheets.png (88.5 KiB) Viewed 2477 times


The {addmargin} environment takes a mandatory argument for left and right margin and an optional argument for setting a different left margin than on the right. The example above sets the additional margin to zero but adds a left margin of 2em and puts the question number in the margin.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

Postby inkmathematics » Sun Aug 07, 2016 4:37 am

@cgnieder ,Thanks for your reply,Thoug your solution works well with English words ,it does not work well with Chinese words.Can you help me ?

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Sun Aug 07, 2016 11:11 am

inkmathematics wrote:@cgnieder ,Thanks for your reply,Thoug your solution works well with English words ,it does not work well with Chinese words.

What do you mean with “it does not work well”?

  1. \documentclass{article}
  2. \usepackage{ctex}
  3. \usepackage{exsheets}
  4. \usepackage{scrextend}
  5.  
  6. \SetupExSheets{
  7. headings = margin-nr ,
  8. question/pre-hook = \addmargin[2em]{0pt} ,
  9. question/post-hook = \endaddmargin ,
  10. question/no-skip-below
  11. }
  12.  
  13. \usepackage[showframe]{geometry}
  14.  
  15. \begin{document}
  16.  
  17. 这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出
  18. 来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确
  19. 解答方法呢?
  20. \begin{question}
  21. 这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答
  22. 出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种
  23. 正确解答方法呢?
  24. \end{question}
  25. \begin{question}
  26. 这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答
  27. 出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种
  28. 正确解答方法呢?
  29. \end{question}
  30. 这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出
  31. 来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确
  32. 解答方法呢?
  33.  
  34. \end{document}


exsheets.png
exsheets.png (62.8 KiB) Viewed 2348 times
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

Postby inkmathematics » Thu Aug 11, 2016 11:53 am

@cgnieder Thank you very much.You solution has solved my question.


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 4 guests